content stringlengths 5 1.04M | avg_line_length float64 1.75 12.9k | max_line_length int64 2 244k | alphanum_fraction float64 0 0.98 | licenses list | repository_name stringlengths 7 92 | path stringlengths 3 249 | size int64 5 1.04M | lang stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|
namespace Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801
{
using static Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Extensions;
/// <summary>BackupRequest resource specific properties</summary>
public partial class BackupRequestProperties :
Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupRequestProperties,
Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupRequestPropertiesInternal
{
/// <summary>Backing field for <see cref="BackupName" /> property.</summary>
private string _backupName;
/// <summary>Name of the backup.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Origin(Microsoft.Azure.PowerShell.Cmdlets.Functions.PropertyOrigin.Owned)]
public string BackupName { get => this._backupName; set => this._backupName = value; }
/// <summary>Backing field for <see cref="BackupSchedule" /> property.</summary>
private Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupSchedule _backupSchedule;
/// <summary>Schedule for the backup if it is executed periodically.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Origin(Microsoft.Azure.PowerShell.Cmdlets.Functions.PropertyOrigin.Owned)]
internal Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupSchedule BackupSchedule { get => (this._backupSchedule = this._backupSchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.BackupSchedule()); set => this._backupSchedule = value; }
/// <summary>
/// How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set
/// to Day)
/// </summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Origin(Microsoft.Azure.PowerShell.Cmdlets.Functions.PropertyOrigin.Inlined)]
public int? BackupScheduleFrequencyInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupScheduleInternal)BackupSchedule).FrequencyInterval; set => ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupScheduleInternal)BackupSchedule).FrequencyInterval = value ?? default(int); }
/// <summary>
/// The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval
/// should be set to 7)
/// </summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Origin(Microsoft.Azure.PowerShell.Cmdlets.Functions.PropertyOrigin.Inlined)]
public Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.FrequencyUnit? BackupScheduleFrequencyUnit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupScheduleInternal)BackupSchedule).FrequencyUnit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupScheduleInternal)BackupSchedule).FrequencyUnit = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.FrequencyUnit)""); }
/// <summary>
/// True if the retention policy should always keep at least one backup in the storage account, regardless how old it is;
/// false otherwise.
/// </summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Origin(Microsoft.Azure.PowerShell.Cmdlets.Functions.PropertyOrigin.Inlined)]
public bool? BackupScheduleKeepAtLeastOneBackup { get => ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupScheduleInternal)BackupSchedule).KeepAtLeastOneBackup; set => ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupScheduleInternal)BackupSchedule).KeepAtLeastOneBackup = value ?? default(bool); }
/// <summary>Last time when this schedule was triggered.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Origin(Microsoft.Azure.PowerShell.Cmdlets.Functions.PropertyOrigin.Inlined)]
public global::System.DateTime? BackupScheduleLastExecutionTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupScheduleInternal)BackupSchedule).LastExecutionTime; }
/// <summary>After how many days backups should be deleted.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Origin(Microsoft.Azure.PowerShell.Cmdlets.Functions.PropertyOrigin.Inlined)]
public int? BackupScheduleRetentionPeriodInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupScheduleInternal)BackupSchedule).RetentionPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupScheduleInternal)BackupSchedule).RetentionPeriodInDay = value ?? default(int); }
/// <summary>When the schedule should start working.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Origin(Microsoft.Azure.PowerShell.Cmdlets.Functions.PropertyOrigin.Inlined)]
public global::System.DateTime? BackupScheduleStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupScheduleInternal)BackupSchedule).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupScheduleInternal)BackupSchedule).StartTime = value ?? default(global::System.DateTime); }
/// <summary>Backing field for <see cref="Database" /> property.</summary>
private Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IDatabaseBackupSetting[] _database;
/// <summary>Databases included in the backup.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Origin(Microsoft.Azure.PowerShell.Cmdlets.Functions.PropertyOrigin.Owned)]
public Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IDatabaseBackupSetting[] Database { get => this._database; set => this._database = value; }
/// <summary>Backing field for <see cref="Enabled" /> property.</summary>
private bool? _enabled;
/// <summary>
/// True if the backup schedule is enabled (must be included in that case), false if the backup schedule should be disabled.
/// </summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Origin(Microsoft.Azure.PowerShell.Cmdlets.Functions.PropertyOrigin.Owned)]
public bool? Enabled { get => this._enabled; set => this._enabled = value; }
/// <summary>Internal Acessors for BackupSchedule</summary>
Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupSchedule Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupRequestPropertiesInternal.BackupSchedule { get => (this._backupSchedule = this._backupSchedule ?? new Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.BackupSchedule()); set { {_backupSchedule = value;} } }
/// <summary>Internal Acessors for BackupScheduleLastExecutionTime</summary>
global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupRequestPropertiesInternal.BackupScheduleLastExecutionTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupScheduleInternal)BackupSchedule).LastExecutionTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupScheduleInternal)BackupSchedule).LastExecutionTime = value; }
/// <summary>Backing field for <see cref="StorageAccountUrl" /> property.</summary>
private string _storageAccountUrl;
/// <summary>SAS URL to the container.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Origin(Microsoft.Azure.PowerShell.Cmdlets.Functions.PropertyOrigin.Owned)]
public string StorageAccountUrl { get => this._storageAccountUrl; set => this._storageAccountUrl = value; }
/// <summary>Creates an new <see cref="BackupRequestProperties" /> instance.</summary>
public BackupRequestProperties()
{
}
}
/// BackupRequest resource specific properties
public partial interface IBackupRequestProperties :
Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.IJsonSerializable
{
/// <summary>Name of the backup.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"Name of the backup.",
SerializedName = @"backupName",
PossibleTypes = new [] { typeof(string) })]
string BackupName { get; set; }
/// <summary>
/// How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set
/// to Day)
/// </summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day)",
SerializedName = @"frequencyInterval",
PossibleTypes = new [] { typeof(int) })]
int? BackupScheduleFrequencyInterval { get; set; }
/// <summary>
/// The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval
/// should be set to 7)
/// </summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7)",
SerializedName = @"frequencyUnit",
PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.FrequencyUnit) })]
Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.FrequencyUnit? BackupScheduleFrequencyUnit { get; set; }
/// <summary>
/// True if the retention policy should always keep at least one backup in the storage account, regardless how old it is;
/// false otherwise.
/// </summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"True if the retention policy should always keep at least one backup in the storage account, regardless how old it is; false otherwise.",
SerializedName = @"keepAtLeastOneBackup",
PossibleTypes = new [] { typeof(bool) })]
bool? BackupScheduleKeepAtLeastOneBackup { get; set; }
/// <summary>Last time when this schedule was triggered.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Info(
Required = false,
ReadOnly = true,
Description = @"Last time when this schedule was triggered.",
SerializedName = @"lastExecutionTime",
PossibleTypes = new [] { typeof(global::System.DateTime) })]
global::System.DateTime? BackupScheduleLastExecutionTime { get; }
/// <summary>After how many days backups should be deleted.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"After how many days backups should be deleted.",
SerializedName = @"retentionPeriodInDays",
PossibleTypes = new [] { typeof(int) })]
int? BackupScheduleRetentionPeriodInDay { get; set; }
/// <summary>When the schedule should start working.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"When the schedule should start working.",
SerializedName = @"startTime",
PossibleTypes = new [] { typeof(global::System.DateTime) })]
global::System.DateTime? BackupScheduleStartTime { get; set; }
/// <summary>Databases included in the backup.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"Databases included in the backup.",
SerializedName = @"databases",
PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IDatabaseBackupSetting) })]
Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IDatabaseBackupSetting[] Database { get; set; }
/// <summary>
/// True if the backup schedule is enabled (must be included in that case), false if the backup schedule should be disabled.
/// </summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Info(
Required = false,
ReadOnly = false,
Description = @"True if the backup schedule is enabled (must be included in that case), false if the backup schedule should be disabled.",
SerializedName = @"enabled",
PossibleTypes = new [] { typeof(bool) })]
bool? Enabled { get; set; }
/// <summary>SAS URL to the container.</summary>
[Microsoft.Azure.PowerShell.Cmdlets.Functions.Runtime.Info(
Required = true,
ReadOnly = false,
Description = @"SAS URL to the container.",
SerializedName = @"storageAccountUrl",
PossibleTypes = new [] { typeof(string) })]
string StorageAccountUrl { get; set; }
}
/// BackupRequest resource specific properties
internal partial interface IBackupRequestPropertiesInternal
{
/// <summary>Name of the backup.</summary>
string BackupName { get; set; }
/// <summary>Schedule for the backup if it is executed periodically.</summary>
Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IBackupSchedule BackupSchedule { get; set; }
/// <summary>
/// How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set
/// to Day)
/// </summary>
int? BackupScheduleFrequencyInterval { get; set; }
/// <summary>
/// The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval
/// should be set to 7)
/// </summary>
Microsoft.Azure.PowerShell.Cmdlets.Functions.Support.FrequencyUnit? BackupScheduleFrequencyUnit { get; set; }
/// <summary>
/// True if the retention policy should always keep at least one backup in the storage account, regardless how old it is;
/// false otherwise.
/// </summary>
bool? BackupScheduleKeepAtLeastOneBackup { get; set; }
/// <summary>Last time when this schedule was triggered.</summary>
global::System.DateTime? BackupScheduleLastExecutionTime { get; set; }
/// <summary>After how many days backups should be deleted.</summary>
int? BackupScheduleRetentionPeriodInDay { get; set; }
/// <summary>When the schedule should start working.</summary>
global::System.DateTime? BackupScheduleStartTime { get; set; }
/// <summary>Databases included in the backup.</summary>
Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190801.IDatabaseBackupSetting[] Database { get; set; }
/// <summary>
/// True if the backup schedule is enabled (must be included in that case), false if the backup schedule should be disabled.
/// </summary>
bool? Enabled { get; set; }
/// <summary>SAS URL to the container.</summary>
string StorageAccountUrl { get; set; }
}
} | 69.20524 | 455 | 0.699142 | [
"MIT"
] | AndriiKalinichenko/azure-powershell | src/Functions/generated/api/Models/Api20190801/BackupRequestProperties.cs | 15,620 | C# |
// Copyright (c) Aloïs DENIEL. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using SkiaSharp;
namespace Microcharts
{
/// <summary>
/// A chart.
/// </summary>
public abstract class Chart : INotifyPropertyChanged
{
#region Fields
/// <summary>
/// IEnumerable of <seealso cref="T:Microcharts.ChartEntry" /> corresponding of Entries of the chart.
/// </summary>
protected IEnumerable<ChartEntry> entries;
private float animationProgress, margin = 20, labelTextSize = 16;
private SKColor backgroundColor = SKColors.White;
private SKColor labelColor = SKColors.Gray;
private SKTypeface typeface;
private float? internalMinValue, internalMaxValue;
private bool isAnimated = true, isAnimating = false;
private TimeSpan animationDuration = TimeSpan.FromSeconds(1.5f);
private Task invalidationPlanification;
private CancellationTokenSource animationCancellation;
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="T:Microcharts.Chart"/> class.
/// </summary>
public Chart()
{
PropertyChanged += OnPropertyChanged;
}
#endregion
#region Events
/// <summary>
/// Occurs when property changed.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Occurs when the chart is invalidated.
/// </summary>
public event EventHandler Invalidated;
#endregion
#region Properties
/// <summary>
/// Gets or sets a value indicating whether this <see cref="T:Microcharts.Chart"/> is animated when entries change.
/// </summary>
/// <value><c>true</c> if is animated; otherwise, <c>false</c>.</value>
public bool IsAnimated
{
get => isAnimated;
set
{
if (Set(ref isAnimated, value))
{
if (!value)
{
AnimationProgress = 1;
}
}
}
}
/// <summary>
/// Gets a value indicating whether this <see cref="T:Microcharts.Chart"/> is currently animating.
/// </summary>
/// <value><c>true</c> if is animating; otherwise, <c>false</c>.</value>
public bool IsAnimating
{
get => isAnimating;
private set => Set(ref isAnimating, value);
}
/// <summary>
/// Gets or sets the duration of the animation.
/// </summary>
/// <value>The duration of the animation.</value>
public TimeSpan AnimationDuration
{
get => animationDuration;
set => Set(ref animationDuration, value);
}
/// <summary>
/// Gets or sets the global margin.
/// </summary>
/// <value>The margin.</value>
public float Margin
{
get => margin;
set => Set(ref margin, value);
}
/// <summary>
/// Gets or sets the animation progress.
/// </summary>
/// <value>The animation progress.</value>
public float AnimationProgress
{
get => animationProgress;
set
{
value = Math.Min(1, Math.Max(value, 0));
Set(ref animationProgress, value);
}
}
/// <summary>
/// Gets or sets the text size of the labels.
/// </summary>
/// <value>The size of the label text.</value>
public float LabelTextSize
{
get => labelTextSize;
set
{
Set(ref labelTextSize, value);
OnLabelTextSizeChanged();
}
}
/// <summary>
/// Method call when LabelTextSizeChanged
/// </summary>
protected virtual void OnLabelTextSizeChanged()
{
}
/// <summary>
/// Typeface for labels
/// </summary>
public SKTypeface Typeface
{
get => typeface;
set => Set(ref typeface, value);
}
/// <summary>
/// Gets or sets the color of the chart background.
/// </summary>
/// <value>The color of the background.</value>
public SKColor BackgroundColor
{
get => backgroundColor;
set => Set(ref backgroundColor, value);
}
/// <summary>
/// Gets or sets the color of the labels.
/// </summary>
/// <value>The color of the labels.</value>
public SKColor LabelColor
{
get => labelColor;
set => Set(ref labelColor, value);
}
/// <summary>
/// Gets or sets the minimum value from entries. If not defined, it will be the minimum between zero and the
/// minimal entry value.
/// </summary>
/// <value>The minimum value.</value>
public float MinValue
{
get
{
if (!entries.Any())
{
return 0;
}
if (InternalMinValue == null)
{
return Math.Min(0, entries.Min(x => x.Value));
}
return Math.Min(InternalMinValue.Value, entries.Min(x => x.Value));
}
set => InternalMinValue = value;
}
/// <summary>
/// Gets or sets the maximum value from entries. If not defined, it will be the maximum between zero and the
/// maximum entry value.
/// </summary>
/// <value>The minimum value.</value>
public float MaxValue
{
get
{
if (!entries.Any())
{
return 0;
}
if (InternalMaxValue == null)
{
return Math.Max(0, entries.Max(x => x.Value));
}
return Math.Max(InternalMaxValue.Value, entries.Max(x => x.Value));
}
set => InternalMaxValue = value;
}
/// <summary>
/// Value range of the chart entries
/// </summary>
protected virtual float ValueRange => MaxValue - MinValue;
/// <summary>
/// Gets or sets a value whether debug rectangles should be drawn.
/// </summary>
internal bool DrawDebugRectangles { get; private set; }
/// <summary>
/// Gets or sets the internal minimum value (that can be null).
/// </summary>
/// <value>The internal minimum value.</value>
protected float? InternalMinValue
{
get => internalMinValue;
set
{
if (Set(ref internalMinValue, value))
{
RaisePropertyChanged(nameof(MinValue));
}
}
}
/// <summary>
/// Gets or sets the internal max value (that can be null).
/// </summary>
/// <value>The internal max value.</value>
protected float? InternalMaxValue
{
get => internalMaxValue;
set
{
if (Set(ref internalMaxValue, value))
{
RaisePropertyChanged(nameof(MaxValue));
}
}
}
/// <summary>
/// Gets the drawable chart area (is set <see cref="DrawCaptionElements"/>).
/// This is the total chart size minus the area allocated by caption elements.
/// </summary>
protected SKRect DrawableChartArea { get; private set; }
#endregion
#region Methods
/// <summary>
/// Draw the graph onto the specified canvas.
/// </summary>
/// <param name="canvas">The canvas.</param>
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
public void Draw(SKCanvas canvas, int width, int height)
{
canvas.Clear(BackgroundColor);
DrawableChartArea = new SKRect(0, 0, width, height);
DrawContent(canvas, width, height);
}
/// <summary>
/// Draws the chart content.
/// </summary>
/// <param name="canvas">The canvas.</param>
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
public abstract void DrawContent(SKCanvas canvas, int width, int height);
/// <summary>
/// Draws caption elements on the right or left side of the chart.
/// </summary>
/// <param name="canvas">The canvas.</param>
/// <param name="width">The width.</param>
/// <param name="height">The height.</param>
/// <param name="entries">The entries.</param>
/// <param name="isLeft">If set to <c>true</c> is left.</param>
/// <param name="isGraphCentered">Should the chart in the center always?</param>
protected void DrawCaptionElements(SKCanvas canvas, int width, int height, List<ChartEntry> entries, bool isLeft, bool isGraphCentered)
{
var totalMargin = 2 * Margin;
var availableHeight = height - (2 * totalMargin);
var x = isLeft ? Margin : (width - Margin - LabelTextSize);
var ySpace = (availableHeight - LabelTextSize) / ((entries.Count <= 1) ? 1 : entries.Count - 1);
for (int i = 0; i < entries.Count; i++)
{
var entry = entries.ElementAt(i);
var y = totalMargin + (i * ySpace);
if (entries.Count <= 1)
{
y += (availableHeight - LabelTextSize) / 2;
}
var hasLabel = !string.IsNullOrEmpty(entry.Label);
var hasValueLabel = !string.IsNullOrEmpty(entry.ValueLabel);
if (hasLabel || hasValueLabel)
{
var captionMargin = LabelTextSize * 0.60f;
var captionX = isLeft ? Margin : width - Margin - LabelTextSize;
var legendColor = entry.Color.WithAlpha((byte)(entry.Color.Alpha * AnimationProgress));
var valueColor = entry.ValueLabelColor.WithAlpha((byte)(entry.ValueLabelColor.Alpha * AnimationProgress));
var lblColor = entry.TextColor.WithAlpha((byte)(entry.TextColor.Alpha * AnimationProgress));
var rect = SKRect.Create(captionX, y, LabelTextSize, LabelTextSize);
using (var paint = new SKPaint
{
Style = SKPaintStyle.Fill,
Color = legendColor
})
{
canvas.DrawRect(rect, paint);
}
if (isLeft)
{
captionX += LabelTextSize + captionMargin;
}
else
{
captionX -= captionMargin;
}
canvas.DrawCaptionLabels(entry.Label, lblColor, entry.ValueLabel, valueColor, LabelTextSize, new SKPoint(captionX, y + (LabelTextSize / 2)), isLeft ? SKTextAlign.Left : SKTextAlign.Right, Typeface, out var labelBounds);
labelBounds.Union(rect);
if (DrawDebugRectangles)
{
using (var paint = new SKPaint
{
Style = SKPaintStyle.Fill,
Color = entry.Color,
IsStroke = true
})
{
canvas.DrawRect(labelBounds, paint);
}
}
if (isLeft)
{
DrawableChartArea = new SKRect(Math.Max(DrawableChartArea.Left, labelBounds.Right), 0, DrawableChartArea.Right, DrawableChartArea.Bottom);
}
else
{ // Draws the chart centered for right labelmode only
var left = isGraphCentered == true ? Math.Abs(width - DrawableChartArea.Right) : 0;
DrawableChartArea = new SKRect(left, 0, Math.Min(DrawableChartArea.Right, labelBounds.Left), DrawableChartArea.Bottom);
}
if (entries.Count == 0 && isGraphCentered)
{ // Draws the chart centered if there isn't any left values
DrawableChartArea = new SKRect(Math.Abs(width - DrawableChartArea.Right), 0, DrawableChartArea.Right, DrawableChartArea.Bottom);
}
}
}
}
/// <summary>
/// Invoked whenever a property changed.
/// </summary>
/// <param name="sender">Sender.</param>
/// <param name="e">E.</param>
protected virtual void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
case nameof(AnimationProgress):
Invalidate();
break;
case nameof(LabelTextSize):
case nameof(MaxValue):
case nameof(MinValue):
case nameof(BackgroundColor):
PlanifyInvalidate();
break;
default:
break;
}
}
/// <summary>
/// Invalidate the chart.
/// </summary>
protected void Invalidate() => Invalidated?.Invoke(this, EventArgs.Empty);
/// <summary>
/// Planifies the invalidation.
/// </summary>
protected async void PlanifyInvalidate()
{
if (invalidationPlanification != null)
{
await invalidationPlanification;
}
else
{
invalidationPlanification = Task.Delay(200);
await invalidationPlanification;
Invalidate();
invalidationPlanification = null;
}
}
#region Weak event handlers
/// <summary>
/// Adds a weak event handler to observe invalidate changes.
/// </summary>
/// <param name="target">The target instance.</param>
/// <param name="onInvalidate">Callback when chart is invalidated.</param>
/// <typeparam name="TTarget">The target subsriber type.</typeparam>
public InvalidatedWeakEventHandler<TTarget> ObserveInvalidate<TTarget>(TTarget target, Action<TTarget> onInvalidate)
where TTarget : class
{
var weakHandler = new InvalidatedWeakEventHandler<TTarget>(this, target, onInvalidate);
weakHandler.Subsribe();
return weakHandler;
}
#endregion
/// <summary>
/// Animates the view.
/// </summary>
/// <returns>The async.</returns>
/// <param name="entrance">If set to <c>true</c> entrance.</param>
/// <param name="token">Token.</param>
public async Task AnimateAsync(bool entrance, CancellationToken token = default(CancellationToken))
{
var watch = new Stopwatch();
var start = entrance ? 0 : 1;
var end = entrance ? 1 : 0;
var range = end - start;
AnimationProgress = start;
IsAnimating = true;
watch.Start();
var source = new TaskCompletionSource<bool>();
var timer = Timer.Create();
timer.Start(TimeSpan.FromSeconds(1.0 / 30), () =>
{
if (token.IsCancellationRequested)
{
source.SetCanceled();
return false;
}
var progress = (float)(watch.Elapsed.TotalSeconds / animationDuration.TotalSeconds);
progress = entrance ? Ease.In(progress) : Ease.Out(progress);
AnimationProgress = start + (progress * (end - start));
var shouldContinue = (entrance && AnimationProgress < 1) || (!entrance && AnimationProgress > 0);
if (!shouldContinue)
{
source.SetResult(true);
}
return shouldContinue;
});
await source.Task;
watch.Stop();
IsAnimating = false;
}
/// <summary>
/// Base method of the generation items on entries changed
/// </summary>
/// <param name="value"></param>
protected async void UpdateEntries(IEnumerable<ChartEntry> value)
{
try
{
if (animationCancellation != null)
{
animationCancellation.Cancel();
}
var cancellation = new CancellationTokenSource();
animationCancellation = cancellation;
if (!cancellation.Token.IsCancellationRequested && entries != null && IsAnimated)
{
await AnimateAsync(false, cancellation.Token);
}
else
{
AnimationProgress = 0;
}
if (Set(ref entries, value))
{
RaisePropertyChanged(nameof(MinValue));
RaisePropertyChanged(nameof(MaxValue));
}
if (!cancellation.Token.IsCancellationRequested && entries != null && IsAnimated)
{
await AnimateAsync(true, cancellation.Token);
}
else
{
AnimationProgress = 1;
}
}
catch
{
if (Set(ref entries, value))
{
RaisePropertyChanged(nameof(MinValue));
RaisePropertyChanged(nameof(MaxValue));
}
Invalidate();
}
finally
{
animationCancellation = null;
}
}
#region INotifyPropertyChanged
/// <summary>
/// Raises the property change.
/// </summary>
/// <param name="property">The property name.</param>
protected void RaisePropertyChanged([CallerMemberName]string property = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
}
/// <summary>
/// Set the specified field and raise a property change if new value is different.
/// </summary>
/// <returns>The set.</returns>
/// <param name="field">The field reference.</param>
/// <param name="value">The new value.</param>
/// <param name="property">The property name.</param>
/// <typeparam name="T">The 1st type parameter.</typeparam>
protected bool Set<T>(ref T field, T value, [CallerMemberName]string property = null)
{
if (!EqualityComparer<T>.Equals(field, property))
{
field = value;
RaisePropertyChanged(property);
return true;
}
return false;
}
#endregion
#endregion
}
}
| 32.86743 | 239 | 0.50234 | [
"MIT"
] | LyckanSv/Microcharts | Sources/Microcharts/Charts/Chart.cs | 20,083 | C# |
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using StandBy.Models;
namespace StandBy.Controllers
{
public class PrincipalController : Controller
{
public IActionResult Inicio()
{
return View();
}
public IActionResult Privacidade()
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult _Error()
{
return View(new ErrorViewModel {RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier});
}
}
} | 24.64 | 110 | 0.61526 | [
"MIT"
] | pedrogdocouto/stand-by | StandBy/Controllers/PrincipalController.cs | 618 | C# |
/*
* Copyright 2017 Mikhail Shiryaev
*
* 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.
*
*
* Product : Rapid SCADA
* Module : SCADA-Server Service
* Summary : Program execution management
*
* Author : Mikhail Shiryaev
* Created : 2015
* Modified : 2017
*/
using Scada.Server.Modules;
using System;
using System.Diagnostics;
using Utils;
namespace Scada.Server.Svc
{
/// <summary>
/// Program execution management
/// <para>Управление работой программы</para>
/// </summary>
sealed class Manager
{
private MainLogic mainLogic; // объект, реализующий логику сервера
private Log appLog; // журнал приложения
/// <summary>
/// Конструктор
/// </summary>
public Manager()
{
mainLogic = new MainLogic();
appLog = mainLogic.AppLog;
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
}
/// <summary>
/// Вывести информацию о необработанном исключении в журнал
/// </summary>
private void OnUnhandledException(object sender, UnhandledExceptionEventArgs args)
{
Exception ex = args.ExceptionObject as Exception;
appLog.WriteAction(string.Format(Localization.UseRussian ? "Необработанное исключение{0}" :
"Unhandled exception{0}", ex == null ? "" : ": " + ex.ToString()), Log.ActTypes.Exception);
appLog.WriteBreak();
}
/// <summary>
/// Запустить службу
/// </summary>
public void StartService()
{
// инициализация необходимых директорий
bool dirsExist; // необходимые директории существуют
bool logDirExists; // директория log-файлов существует
mainLogic.InitAppDirs(out dirsExist, out logDirExists);
if (logDirExists)
{
appLog.WriteBreak();
appLog.WriteAction(string.Format(Localization.UseRussian ?
"Служба ScadaServerService {0} запущена" :
"ScadaServerService {0} is started", ServerUtils.AppVersion), Log.ActTypes.Action);
}
if (dirsExist)
{
// локализация приложения
string errMsg;
if (Localization.LoadDictionaries(mainLogic.AppDirs.LangDir, "ScadaData", out errMsg))
CommonPhrases.Init();
else
appLog.WriteAction(errMsg, Log.ActTypes.Error);
if (Localization.LoadDictionaries(mainLogic.AppDirs.LangDir, "ScadaServer", out errMsg))
ModPhrases.InitFromDictionaries();
else
appLog.WriteAction(errMsg, Log.ActTypes.Error);
// запуск работы SCADA-Сервера
if (!mainLogic.Start())
appLog.WriteAction(Localization.UseRussian ?
"Нормальная работа программы невозможна." :
"Normal program execution is impossible.", Log.ActTypes.Error);
}
else
{
string errMsg = string.Format(Localization.UseRussian ?
"Не существуют необходимые директории:{0}{1}{0}{2}{0}{3}{0}{4}{0}" +
"Нормальная работа программы невозможна." :
"Required directories are not exist:{0}{1}{0}{2}{0}{3}{0}{4}{0}" +
"Normal program execution is impossible.",
Environment.NewLine, mainLogic.AppDirs.ConfigDir, mainLogic.AppDirs.LangDir,
mainLogic.AppDirs.LogDir, mainLogic.AppDirs.ModDir);
try
{
if (EventLog.SourceExists("ScadaServerService"))
EventLog.WriteEvent("ScadaServerService",
new EventInstance(0, 0, EventLogEntryType.Error), errMsg);
}
catch { }
if (logDirExists)
appLog.WriteAction(errMsg, Log.ActTypes.Error);
}
}
/// <summary>
/// Остановить службу
/// </summary>
public void StopService()
{
mainLogic.Stop();
appLog.WriteAction(Localization.UseRussian ?
"Служба ScadaServerService остановлена" :
"ScadaServerService is stopped", Log.ActTypes.Action);
appLog.WriteBreak();
}
/// <summary>
/// Отключить службу немедленно при выключении компьютера
/// </summary>
public void ShutdownService()
{
mainLogic.Stop();
appLog.WriteAction(Localization.UseRussian ?
"Служба ScadaServerService отключена" :
"ScadaServerService is shutdown", Log.ActTypes.Action);
appLog.WriteBreak();
}
}
} | 36.205298 | 107 | 0.567953 | [
"Apache-2.0"
] | JoygenZhang/Rapid-SCADA-sources | ScadaServer/ScadaServerSvc/Manager.cs | 5,984 | C# |
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
//
using UnityEngine;
namespace HUX.InputValidator
{
public abstract class AInputValidator : Interaction.InteractibleObject
{
#region Editor Variables
[SerializeField]
protected TextItem[] m_Messages;
#endregion
//--------------------------------------------------------------
#region Unity Methods
protected virtual void Start()
{
AddInputListeners();
}
protected virtual void OnDestroy()
{
RemoveInputListeners();
}
#endregion
//--------------------------------------------------------------
#region Message Handling
protected void AddMessage(string str)
{
for (int i = m_Messages.Length - 1; i >= 1; --i)
{
m_Messages[i].CopyFrom(m_Messages[i - 1]);
}
m_Messages[0].SetText(str);
m_Messages[0].Highlight();
}
#endregion
//--------------------------------------------------------------
#region Abstract Functions
/// <summary>
/// Method to Add all needed listeners for input in.
/// </summary>
protected abstract void AddInputListeners();
/// <summary>
/// Method to remove all needed listeners for input in.
/// </summary>
protected abstract void RemoveInputListeners();
#endregion
}
}
| 21.758065 | 91 | 0.589325 | [
"MIT"
] | AllBecomesGood/Share-UpdateHolograms | ShareAndKeepSynced/Assets/MRDesignLab/HUX/Examples/Scripts/InputValidator/AInputValidator.cs | 1,351 | C# |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.AzureNextGen.Devices.V20200401.Outputs
{
[OutputType]
public sealed class FallbackRoutePropertiesResponse
{
/// <summary>
/// The condition which is evaluated in order to apply the fallback route. If the condition is not provided it will evaluate to true by default. For grammar, See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language
/// </summary>
public readonly string? Condition;
/// <summary>
/// The list of endpoints to which the messages that satisfy the condition are routed to. Currently only 1 endpoint is allowed.
/// </summary>
public readonly ImmutableArray<string> EndpointNames;
/// <summary>
/// Used to specify whether the fallback route is enabled.
/// </summary>
public readonly bool IsEnabled;
/// <summary>
/// The name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique.
/// </summary>
public readonly string? Name;
/// <summary>
/// The source to which the routing rule is to be applied to. For example, DeviceMessages
/// </summary>
public readonly string Source;
[OutputConstructor]
private FallbackRoutePropertiesResponse(
string? condition,
ImmutableArray<string> endpointNames,
bool isEnabled,
string? name,
string source)
{
Condition = condition;
EndpointNames = endpointNames;
IsEnabled = isEnabled;
Name = name;
Source = source;
}
}
}
| 35.859649 | 243 | 0.639922 | [
"Apache-2.0"
] | pulumi/pulumi-azure-nextgen | sdk/dotnet/Devices/V20200401/Outputs/FallbackRoutePropertiesResponse.cs | 2,044 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FuzzySetCreater
{
class BinaryFSOperator
{
protected static Random rnd = new Random();
//properties
public virtual string Title { get => ""; }
// event
public event EventHandler ParameterChanged;
// public virtual double Evaluate( double a) { throw new Exception("No implemented"); }
public virtual double Evaluate(double a, double b) { throw new Exception("No implemented"); }// { return 0.0; }
protected void FireParameterChangedEvent()
{
if (ParameterChanged != null) ParameterChanged(this, null);
}
}
class Union : BinaryFSOperator
{
public override string Title => "Union";
public override double Evaluate(double a,double b)
{
return Math.Max(a,b);
}
}
class Intersection : BinaryFSOperator
{
public override string Title => "Intersection";
public override double Evaluate(double a, double b)
{
return Math.Min(a,b);
}
}
class TMin : BinaryFSOperator
{
public override string Title => "Minimum T-norm";
public override double Evaluate(double a, double b)
{
return Math.Min(a, b);
}
}
class Tap : BinaryFSOperator
{
public override string Title => "Algebraic product";
public override double Evaluate(double a, double b)
{
return a*b;
}
}
class Tbp : BinaryFSOperator
{
public override string Title => "Bounded product";
public override double Evaluate(double a, double b)
{
return Math.Max(0, (a+b-1));
}
}
class Tdp : BinaryFSOperator
{
public override string Title => "Drastic product";
public override double Evaluate(double a, double b)
{
if ( b >= 0.998 && b <= 1.002 ) return a;
else if ( a >= 0.998 && a <= 1.002 ) return b;
else return 0;// if(a < 1 && b < 1)
}
}
class SMax : BinaryFSOperator
{
public override string Title => "Maximum S-norm";
public override double Evaluate(double a, double b)
{
return Math.Max(a, b);
}
}
class Sas : BinaryFSOperator
{
public override string Title => "Algebraic sum S-norm";
public override double Evaluate(double a, double b)
{
return a +b - a * b;
}
}
class Sbs : BinaryFSOperator
{
public override string Title => "Bounded sum S-norm";
public override double Evaluate(double a, double b)
{
return Math.Min(1, (a + b));
}
}
class Sds : BinaryFSOperator
{
public override string Title => "Drastic sum S-norm";
public override double Evaluate(double a, double b)
{
if (b >= -0.998 && b <= 0.002) return a;
else if (a >= -0.998 && a <= 0.002) return b;
else return 0;// if(a < 1 && b < 1)
}
}
}
| 26.666667 | 119 | 0.551563 | [
"MIT"
] | SashaWanChen/FuzzySetCreater | FuzzySetCreater/BinaryFSOperator.cs | 3,202 | C# |
using System.Xml.Serialization;
namespace CarDealer.DTO.Export
{
[XmlType("car")]
public class ExportCarsFromMakeBmw
{
[XmlAttribute("id")]
public int Id { get; set; }
[XmlAttribute("model")]
public string Model { get; set; }
[XmlAttribute("travelled-distance")]
public long TravelledDistance { get; set; }
}
}
| 21.055556 | 51 | 0.604222 | [
"MIT"
] | PetroslavGochev/CSharpDatabaseModule | Entity Framework Core/09.XML PROCESSING/CarDealer/CarDealer/DTO/Export/ExportCarsFromMakeBmw.cs | 381 | C# |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Build.UnitTests.OM.ObjectModelRemoting
{
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Build.Construction;
using Microsoft.Build.ObjectModelRemoting;
using Microsoft.Build.Evaluation;
using Xunit;
using System.Runtime.ExceptionServices;
using System.Xml.Schema;
using System.Collections;
using Microsoft.Build.Framework;
internal enum ObjectType
{
Real = 1,
View = 2
}
internal class LinkPair<T>
{
public LinkPair(T view, T real)
{
ViewValidation.VerifyLinkedNotNull(view);
ViewValidation.VerifyNotLinkedNotNull(real);
this.View = view;
this.Real = real;
}
public T Get(ObjectType type) => type == ObjectType.Real ? this.Real : this.View;
public T View { get; }
public T Real { get; }
public void VerifyNotSame(LinkPair<T> other)
{
Assert.NotSame((object)this.View, (object)other.View);
Assert.NotSame((object)this.Real, (object)other.Real);
}
public void VerifySame(LinkPair<T> other)
{
Assert.Same((object)this.View, (object)other.View);
Assert.Same((object)this.Real, (object)other.Real);
}
public void VerifySetter(bool finalValue, Func<T, bool> getter, Action<T, bool> setter)
{
var current = getter(this.Real);
Assert.Equal(current, getter(this.View));
// set via the view
setter(this.View, !current);
Assert.Equal(!current, getter(this.View));
Assert.Equal(!current, getter(this.Real));
// set via the real.
setter(this.Real, current);
Assert.Equal(current, getter(this.View));
Assert.Equal(current, getter(this.Real));
setter(this.View, finalValue);
Assert.Equal(finalValue, getter(this.View));
Assert.Equal(finalValue, getter(this.Real));
}
public void VerifySetter(string newValue, Func<T, string> getter, Action<T, string> setter)
{
var newValue1 = newValue.Ver(1);
var current = getter(this.Real);
Assert.Equal(current, getter(this.View));
Assert.NotEqual(current, newValue);
Assert.NotEqual(current, newValue1);
// set via the view
setter(this.View, newValue1);
Assert.Equal(newValue1, getter(this.View));
Assert.Equal(newValue1, getter(this.Real));
// set via the real.
setter(this.Real, newValue);
Assert.Equal(newValue, getter(this.View));
Assert.Equal(newValue, getter(this.Real));
this.Verify();
}
public virtual void Verify()
{
ViewValidation.VerifyFindType(this.View, this.Real);
}
}
internal class ValidationContext
{
public ValidationContext() { }
public ValidationContext(ProjectPair pair) { this.Pair = pair; }
public ProjectPair Pair { get; set; }
public Action<ElementLocation, ElementLocation> ValidateLocation { get; set; }
}
internal static partial class ViewValidation
{
private static bool VerifyCheckType<T>(object view, object real, ValidationContext context, Action<T, T, ValidationContext> elementValidator)
{
if (view is T viewTypedXml)
{
Assert.True(real is T);
elementValidator(viewTypedXml, (T)real, context);
return true;
}
else
{
Assert.False(real is T);
return false;
}
}
// "Slow" Verify, probing all known link types
public static void VerifyFindType(object view, object real, ValidationContext context = null)
{
if (view == null && real == null) return;
VerifyLinkedNotNull(view);
VerifyNotLinkedNotNull(real);
// construction
if (VerifyCheckType<ProjectMetadataElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectChooseElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectWhenElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectOtherwiseElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectTaskElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectOutputElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectUsingTaskBodyElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectUsingTaskParameterElement>(view, real, context, Verify)) return;
if (VerifyCheckType<UsingTaskParameterGroupElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectUsingTaskElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectTargetElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectRootElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectExtensionsElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectImportElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectImportGroupElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectItemDefinitionElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectItemDefinitionGroupElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectItemElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectItemGroupElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectPropertyElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectPropertyGroupElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectSdkElement>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectOnErrorElement>(view, real, context, Verify)) return;
// evaluation
if (VerifyCheckType<ProjectProperty>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectMetadata>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectItemDefinition>(view, real, context, Verify)) return;
if (VerifyCheckType<ProjectItem>(view, real, context, Verify)) return;
if (VerifyCheckType<Project>(view, real, context, Verify)) return;
throw new NotImplementedException($"Unknown type:{view.GetType().Name}");
}
public static void VerifyMetadata(IEnumerable<KeyValuePair<string, string>> expected, Func<string, string> getMetadata, Func<string, bool> hasMetadata = null)
{
if (expected == null) return;
foreach (var md in expected)
{
if (hasMetadata != null)
{
Assert.True(hasMetadata(md.Key));
}
Assert.Equal(md.Value, getMetadata(md.Key));
}
}
public static void Verify<T>(IEnumerable<T> viewCollection, IEnumerable<T> realCollection, Action<T, T, ValidationContext> validator, ValidationContext context = null)
{
if (viewCollection == null && realCollection == null) return;
Assert.NotNull(viewCollection);
Assert.NotNull(realCollection);
var viewXmlList = viewCollection.ToList();
var realXmlList = realCollection.ToList();
Assert.Equal(realXmlList.Count, viewXmlList.Count);
for (int i = 0; i < realXmlList.Count; i++)
{
validator(viewXmlList[i], realXmlList[i], context);
}
}
public static void Verify<T>(IDictionary<string, T> viewCollection, IDictionary<string, T> realCollection, Action<T, T, ValidationContext> validator, ValidationContext context = null)
{
if (viewCollection == null && realCollection == null) return;
Assert.NotNull(viewCollection);
Assert.NotNull(realCollection);
Assert.Equal(realCollection.Count, viewCollection.Count);
foreach (var k in realCollection.Keys)
{
Assert.True(viewCollection.TryGetValue(k, out var vv));
Assert.True(realCollection.TryGetValue(k, out var rv));
validator(vv, rv, context);
}
}
public static void Verify<T>(IEnumerable<T> viewXmlCollection, IEnumerable<T> realXmlCollection, ValidationContext context = null)
{
var viewXmlList = viewXmlCollection.ToList();
var realXmlList = realXmlCollection.ToList();
Assert.Equal(realXmlList.Count, viewXmlList.Count);
for (int i = 0; i < realXmlList.Count; i++)
{
VerifyFindType(viewXmlList[i], realXmlList[i], context);
}
}
}
}
| 42.246637 | 191 | 0.615858 | [
"MIT"
] | 3F/msbuild | src/Build.OM.UnitTests/ObjectModelRemoting/Helpers/ViewValidation.cs | 9,423 | C# |
namespace Gripper.ChromeDevTools.Emulation
{
using Newtonsoft.Json;
/// <summary>
/// Automatically render all web contents using a dark theme.
/// </summary>
public sealed class SetAutoDarkModeOverrideCommand : ICommand
{
private const string ChromeRemoteInterface_CommandName = "Emulation.setAutoDarkModeOverride";
[JsonIgnore]
public string CommandName
{
get { return ChromeRemoteInterface_CommandName; }
}
/// <summary>
/// Whether to enable or disable automatic dark mode.
/// If not specified, any existing override will be cleared.
/// </summary>
[JsonProperty("enabled", DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool? Enabled
{
get;
set;
}
}
public sealed class SetAutoDarkModeOverrideCommandResponse : ICommandResponse<SetAutoDarkModeOverrideCommand>
{
}
} | 29.575758 | 113 | 0.63832 | [
"MIT"
] | tomaskrupka/Gripper | src/Gripper.ChromeDevTools/Emulation/SetAutoDarkModeOverrideCommand.cs | 976 | C# |
#pragma checksum "C:\Code\DungeonStats\StatRoller\StatRoller\_Imports.razor" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "7806673c258f6c80714514ed6ddb9d12fe9d8ec6"
// <auto-generated/>
#pragma warning disable 1591
#pragma warning disable 0414
#pragma warning disable 0649
#pragma warning disable 0169
namespace StatRoller
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
#nullable restore
#line 1 "C:\Code\DungeonStats\StatRoller\StatRoller\_Imports.razor"
using System.Net.Http;
#line default
#line hidden
#nullable disable
#nullable restore
#line 2 "C:\Code\DungeonStats\StatRoller\StatRoller\_Imports.razor"
using Microsoft.AspNetCore.Authorization;
#line default
#line hidden
#nullable disable
#nullable restore
#line 3 "C:\Code\DungeonStats\StatRoller\StatRoller\_Imports.razor"
using Microsoft.AspNetCore.Components.Authorization;
#line default
#line hidden
#nullable disable
#nullable restore
#line 4 "C:\Code\DungeonStats\StatRoller\StatRoller\_Imports.razor"
using Microsoft.AspNetCore.Components.Forms;
#line default
#line hidden
#nullable disable
#nullable restore
#line 5 "C:\Code\DungeonStats\StatRoller\StatRoller\_Imports.razor"
using Microsoft.AspNetCore.Components.Routing;
#line default
#line hidden
#nullable disable
#nullable restore
#line 6 "C:\Code\DungeonStats\StatRoller\StatRoller\_Imports.razor"
using Microsoft.AspNetCore.Components.Web;
#line default
#line hidden
#nullable disable
#nullable restore
#line 7 "C:\Code\DungeonStats\StatRoller\StatRoller\_Imports.razor"
using Microsoft.JSInterop;
#line default
#line hidden
#nullable disable
#nullable restore
#line 8 "C:\Code\DungeonStats\StatRoller\StatRoller\_Imports.razor"
using StatRoller;
#line default
#line hidden
#nullable disable
#nullable restore
#line 9 "C:\Code\DungeonStats\StatRoller\StatRoller\_Imports.razor"
using StatRoller.Shared;
#line default
#line hidden
#nullable disable
public class _Imports : System.Object
{
#pragma warning disable 1998
protected void Execute()
{
}
#pragma warning restore 1998
}
}
#pragma warning restore 1591
| 24.921348 | 160 | 0.785843 | [
"MIT"
] | Jareson/DungeonStats | StatRoller/StatRoller/obj/Debug/netcoreapp3.0/RazorDeclaration/_Imports.razor.g.cs | 2,218 | 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 lightsail-2016-11-28.normal.json service model.
*/
using System;
using System.Collections.Generic;
using Amazon.Lightsail.Model;
using Amazon.Lightsail.Model.Internal.MarshallTransformations;
using Amazon.Lightsail.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.Lightsail
{
/// <summary>
/// Implementation for accessing Lightsail
///
/// Amazon Lightsail is the easiest way to get started with AWS for developers who just
/// need virtual private servers. Lightsail includes everything you need to launch your
/// project quickly - a virtual machine, SSD-based storage, data transfer, DNS management,
/// and a static IP - for a low, predictable price. You manage those Lightsail servers
/// through the Lightsail console or by using the API or command-line interface (CLI).
///
///
/// <para>
/// For more information about Lightsail concepts and tasks, see the <a href="https://lightsail.aws.amazon.com/ls/docs/all">Lightsail
/// Dev Guide</a>.
/// </para>
///
/// <para>
/// To use the Lightsail API or the CLI, you will need to use AWS Identity and Access
/// Management (IAM) to generate access keys. For details about how to set this up, see
/// the <a href="http://lightsail.aws.amazon.com/ls/docs/how-to/article/lightsail-how-to-set-up-access-keys-to-use-sdk-api-cli">Lightsail
/// Dev Guide</a>.
/// </para>
/// </summary>
public partial class AmazonLightsailClient : AmazonServiceClient, IAmazonLightsail
{
private static IServiceMetadata serviceMetadata = new AmazonLightsailMetadata();
#region Constructors
/// <summary>
/// Constructs AmazonLightsailClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
public AmazonLightsailClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonLightsailConfig()) { }
/// <summary>
/// Constructs AmazonLightsailClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name="region">The region to connect.</param>
public AmazonLightsailClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonLightsailConfig{RegionEndpoint = region}) { }
/// <summary>
/// Constructs AmazonLightsailClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name="config">The AmazonLightsailClient Configuration Object</param>
public AmazonLightsailClient(AmazonLightsailConfig config)
: base(FallbackCredentialsFactory.GetCredentials(), config) { }
/// <summary>
/// Constructs AmazonLightsailClient with AWS Credentials
/// </summary>
/// <param name="credentials">AWS Credentials</param>
public AmazonLightsailClient(AWSCredentials credentials)
: this(credentials, new AmazonLightsailConfig())
{
}
/// <summary>
/// Constructs AmazonLightsailClient with AWS Credentials
/// </summary>
/// <param name="credentials">AWS Credentials</param>
/// <param name="region">The region to connect.</param>
public AmazonLightsailClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonLightsailConfig{RegionEndpoint = region})
{
}
/// <summary>
/// Constructs AmazonLightsailClient with AWS Credentials and an
/// AmazonLightsailClient Configuration object.
/// </summary>
/// <param name="credentials">AWS Credentials</param>
/// <param name="clientConfig">The AmazonLightsailClient Configuration Object</param>
public AmazonLightsailClient(AWSCredentials credentials, AmazonLightsailConfig clientConfig)
: base(credentials, clientConfig)
{
}
/// <summary>
/// Constructs AmazonLightsailClient with AWS Access Key ID and AWS Secret Key
/// </summary>
/// <param name="awsAccessKeyId">AWS Access Key ID</param>
/// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
public AmazonLightsailClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonLightsailConfig())
{
}
/// <summary>
/// Constructs AmazonLightsailClient with AWS Access Key ID and AWS Secret Key
/// </summary>
/// <param name="awsAccessKeyId">AWS Access Key ID</param>
/// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
/// <param name="region">The region to connect.</param>
public AmazonLightsailClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonLightsailConfig() {RegionEndpoint=region})
{
}
/// <summary>
/// Constructs AmazonLightsailClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonLightsailClient Configuration object.
/// </summary>
/// <param name="awsAccessKeyId">AWS Access Key ID</param>
/// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
/// <param name="clientConfig">The AmazonLightsailClient Configuration Object</param>
public AmazonLightsailClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonLightsailConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
/// <summary>
/// Constructs AmazonLightsailClient with AWS Access Key ID and AWS Secret Key
/// </summary>
/// <param name="awsAccessKeyId">AWS Access Key ID</param>
/// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
/// <param name="awsSessionToken">AWS Session Token</param>
public AmazonLightsailClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonLightsailConfig())
{
}
/// <summary>
/// Constructs AmazonLightsailClient with AWS Access Key ID and AWS Secret Key
/// </summary>
/// <param name="awsAccessKeyId">AWS Access Key ID</param>
/// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
/// <param name="awsSessionToken">AWS Session Token</param>
/// <param name="region">The region to connect.</param>
public AmazonLightsailClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonLightsailConfig{RegionEndpoint = region})
{
}
/// <summary>
/// Constructs AmazonLightsailClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonLightsailClient Configuration object.
/// </summary>
/// <param name="awsAccessKeyId">AWS Access Key ID</param>
/// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
/// <param name="awsSessionToken">AWS Session Token</param>
/// <param name="clientConfig">The AmazonLightsailClient Configuration Object</param>
public AmazonLightsailClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonLightsailConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig)
{
}
#endregion
#region Overrides
/// <summary>
/// Creates the signer for the service.
/// </summary>
protected override AbstractAWSSigner CreateSigner()
{
return new AWS4Signer();
}
/// <summary>
/// Capture metadata for the service.
/// </summary>
protected override IServiceMetadata ServiceMetadata
{
get
{
return serviceMetadata;
}
}
#endregion
#region Dispose
/// <summary>
/// Disposes the service client.
/// </summary>
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
#endregion
#region AllocateStaticIp
/// <summary>
/// Allocates a static IP address.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AllocateStaticIp service method.</param>
///
/// <returns>The response from the AllocateStaticIp service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AllocateStaticIp">REST API Reference for AllocateStaticIp Operation</seealso>
public virtual AllocateStaticIpResponse AllocateStaticIp(AllocateStaticIpRequest request)
{
var marshaller = AllocateStaticIpRequestMarshaller.Instance;
var unmarshaller = AllocateStaticIpResponseUnmarshaller.Instance;
return Invoke<AllocateStaticIpRequest,AllocateStaticIpResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the AllocateStaticIp operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AllocateStaticIp operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAllocateStaticIp
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AllocateStaticIp">REST API Reference for AllocateStaticIp Operation</seealso>
public virtual IAsyncResult BeginAllocateStaticIp(AllocateStaticIpRequest request, AsyncCallback callback, object state)
{
var marshaller = AllocateStaticIpRequestMarshaller.Instance;
var unmarshaller = AllocateStaticIpResponseUnmarshaller.Instance;
return BeginInvoke<AllocateStaticIpRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AllocateStaticIp operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAllocateStaticIp.</param>
///
/// <returns>Returns a AllocateStaticIpResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AllocateStaticIp">REST API Reference for AllocateStaticIp Operation</seealso>
public virtual AllocateStaticIpResponse EndAllocateStaticIp(IAsyncResult asyncResult)
{
return EndInvoke<AllocateStaticIpResponse>(asyncResult);
}
#endregion
#region AttachDisk
/// <summary>
/// Attaches a block storage disk to a running or stopped Lightsail instance and exposes
/// it to the instance with the specified disk name.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AttachDisk service method.</param>
///
/// <returns>The response from the AttachDisk service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachDisk">REST API Reference for AttachDisk Operation</seealso>
public virtual AttachDiskResponse AttachDisk(AttachDiskRequest request)
{
var marshaller = AttachDiskRequestMarshaller.Instance;
var unmarshaller = AttachDiskResponseUnmarshaller.Instance;
return Invoke<AttachDiskRequest,AttachDiskResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the AttachDisk operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AttachDisk operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAttachDisk
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachDisk">REST API Reference for AttachDisk Operation</seealso>
public virtual IAsyncResult BeginAttachDisk(AttachDiskRequest request, AsyncCallback callback, object state)
{
var marshaller = AttachDiskRequestMarshaller.Instance;
var unmarshaller = AttachDiskResponseUnmarshaller.Instance;
return BeginInvoke<AttachDiskRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AttachDisk operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAttachDisk.</param>
///
/// <returns>Returns a AttachDiskResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachDisk">REST API Reference for AttachDisk Operation</seealso>
public virtual AttachDiskResponse EndAttachDisk(IAsyncResult asyncResult)
{
return EndInvoke<AttachDiskResponse>(asyncResult);
}
#endregion
#region AttachInstancesToLoadBalancer
/// <summary>
/// Attaches one or more Lightsail instances to a load balancer.
///
///
/// <para>
/// After some time, the instances are attached to the load balancer and the health check
/// status is available.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AttachInstancesToLoadBalancer service method.</param>
///
/// <returns>The response from the AttachInstancesToLoadBalancer service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachInstancesToLoadBalancer">REST API Reference for AttachInstancesToLoadBalancer Operation</seealso>
public virtual AttachInstancesToLoadBalancerResponse AttachInstancesToLoadBalancer(AttachInstancesToLoadBalancerRequest request)
{
var marshaller = AttachInstancesToLoadBalancerRequestMarshaller.Instance;
var unmarshaller = AttachInstancesToLoadBalancerResponseUnmarshaller.Instance;
return Invoke<AttachInstancesToLoadBalancerRequest,AttachInstancesToLoadBalancerResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the AttachInstancesToLoadBalancer operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AttachInstancesToLoadBalancer operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAttachInstancesToLoadBalancer
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachInstancesToLoadBalancer">REST API Reference for AttachInstancesToLoadBalancer Operation</seealso>
public virtual IAsyncResult BeginAttachInstancesToLoadBalancer(AttachInstancesToLoadBalancerRequest request, AsyncCallback callback, object state)
{
var marshaller = AttachInstancesToLoadBalancerRequestMarshaller.Instance;
var unmarshaller = AttachInstancesToLoadBalancerResponseUnmarshaller.Instance;
return BeginInvoke<AttachInstancesToLoadBalancerRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AttachInstancesToLoadBalancer operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAttachInstancesToLoadBalancer.</param>
///
/// <returns>Returns a AttachInstancesToLoadBalancerResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachInstancesToLoadBalancer">REST API Reference for AttachInstancesToLoadBalancer Operation</seealso>
public virtual AttachInstancesToLoadBalancerResponse EndAttachInstancesToLoadBalancer(IAsyncResult asyncResult)
{
return EndInvoke<AttachInstancesToLoadBalancerResponse>(asyncResult);
}
#endregion
#region AttachLoadBalancerTlsCertificate
/// <summary>
/// Attaches a Transport Layer Security (TLS) certificate to your load balancer. TLS is
/// just an updated, more secure version of Secure Socket Layer (SSL).
///
///
/// <para>
/// Once you create and validate your certificate, you can attach it to your load balancer.
/// You can also use this API to rotate the certificates on your account. Use the <code>AttachLoadBalancerTlsCertificate</code>
/// operation with the non-attached certificate, and it will replace the existing one
/// and become the attached certificate.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AttachLoadBalancerTlsCertificate service method.</param>
///
/// <returns>The response from the AttachLoadBalancerTlsCertificate service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachLoadBalancerTlsCertificate">REST API Reference for AttachLoadBalancerTlsCertificate Operation</seealso>
public virtual AttachLoadBalancerTlsCertificateResponse AttachLoadBalancerTlsCertificate(AttachLoadBalancerTlsCertificateRequest request)
{
var marshaller = AttachLoadBalancerTlsCertificateRequestMarshaller.Instance;
var unmarshaller = AttachLoadBalancerTlsCertificateResponseUnmarshaller.Instance;
return Invoke<AttachLoadBalancerTlsCertificateRequest,AttachLoadBalancerTlsCertificateResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the AttachLoadBalancerTlsCertificate operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AttachLoadBalancerTlsCertificate operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAttachLoadBalancerTlsCertificate
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachLoadBalancerTlsCertificate">REST API Reference for AttachLoadBalancerTlsCertificate Operation</seealso>
public virtual IAsyncResult BeginAttachLoadBalancerTlsCertificate(AttachLoadBalancerTlsCertificateRequest request, AsyncCallback callback, object state)
{
var marshaller = AttachLoadBalancerTlsCertificateRequestMarshaller.Instance;
var unmarshaller = AttachLoadBalancerTlsCertificateResponseUnmarshaller.Instance;
return BeginInvoke<AttachLoadBalancerTlsCertificateRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AttachLoadBalancerTlsCertificate operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAttachLoadBalancerTlsCertificate.</param>
///
/// <returns>Returns a AttachLoadBalancerTlsCertificateResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachLoadBalancerTlsCertificate">REST API Reference for AttachLoadBalancerTlsCertificate Operation</seealso>
public virtual AttachLoadBalancerTlsCertificateResponse EndAttachLoadBalancerTlsCertificate(IAsyncResult asyncResult)
{
return EndInvoke<AttachLoadBalancerTlsCertificateResponse>(asyncResult);
}
#endregion
#region AttachStaticIp
/// <summary>
/// Attaches a static IP address to a specific Amazon Lightsail instance.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AttachStaticIp service method.</param>
///
/// <returns>The response from the AttachStaticIp service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachStaticIp">REST API Reference for AttachStaticIp Operation</seealso>
public virtual AttachStaticIpResponse AttachStaticIp(AttachStaticIpRequest request)
{
var marshaller = AttachStaticIpRequestMarshaller.Instance;
var unmarshaller = AttachStaticIpResponseUnmarshaller.Instance;
return Invoke<AttachStaticIpRequest,AttachStaticIpResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the AttachStaticIp operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AttachStaticIp operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAttachStaticIp
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachStaticIp">REST API Reference for AttachStaticIp Operation</seealso>
public virtual IAsyncResult BeginAttachStaticIp(AttachStaticIpRequest request, AsyncCallback callback, object state)
{
var marshaller = AttachStaticIpRequestMarshaller.Instance;
var unmarshaller = AttachStaticIpResponseUnmarshaller.Instance;
return BeginInvoke<AttachStaticIpRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AttachStaticIp operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAttachStaticIp.</param>
///
/// <returns>Returns a AttachStaticIpResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachStaticIp">REST API Reference for AttachStaticIp Operation</seealso>
public virtual AttachStaticIpResponse EndAttachStaticIp(IAsyncResult asyncResult)
{
return EndInvoke<AttachStaticIpResponse>(asyncResult);
}
#endregion
#region CloseInstancePublicPorts
/// <summary>
/// Closes the public ports on a specific Amazon Lightsail instance.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CloseInstancePublicPorts service method.</param>
///
/// <returns>The response from the CloseInstancePublicPorts service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CloseInstancePublicPorts">REST API Reference for CloseInstancePublicPorts Operation</seealso>
public virtual CloseInstancePublicPortsResponse CloseInstancePublicPorts(CloseInstancePublicPortsRequest request)
{
var marshaller = CloseInstancePublicPortsRequestMarshaller.Instance;
var unmarshaller = CloseInstancePublicPortsResponseUnmarshaller.Instance;
return Invoke<CloseInstancePublicPortsRequest,CloseInstancePublicPortsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CloseInstancePublicPorts operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CloseInstancePublicPorts operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCloseInstancePublicPorts
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CloseInstancePublicPorts">REST API Reference for CloseInstancePublicPorts Operation</seealso>
public virtual IAsyncResult BeginCloseInstancePublicPorts(CloseInstancePublicPortsRequest request, AsyncCallback callback, object state)
{
var marshaller = CloseInstancePublicPortsRequestMarshaller.Instance;
var unmarshaller = CloseInstancePublicPortsResponseUnmarshaller.Instance;
return BeginInvoke<CloseInstancePublicPortsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CloseInstancePublicPorts operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCloseInstancePublicPorts.</param>
///
/// <returns>Returns a CloseInstancePublicPortsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CloseInstancePublicPorts">REST API Reference for CloseInstancePublicPorts Operation</seealso>
public virtual CloseInstancePublicPortsResponse EndCloseInstancePublicPorts(IAsyncResult asyncResult)
{
return EndInvoke<CloseInstancePublicPortsResponse>(asyncResult);
}
#endregion
#region CreateDisk
/// <summary>
/// Creates a block storage disk that can be attached to a Lightsail instance in the same
/// Availability Zone (e.g., <code>us-east-2a</code>). The disk is created in the regional
/// endpoint that you send the HTTP request to. For more information, see <a href="https://lightsail.aws.amazon.com/ls/docs/overview/article/understanding-regions-and-availability-zones-in-amazon-lightsail">Regions
/// and Availability Zones in Lightsail</a>.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateDisk service method.</param>
///
/// <returns>The response from the CreateDisk service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDisk">REST API Reference for CreateDisk Operation</seealso>
public virtual CreateDiskResponse CreateDisk(CreateDiskRequest request)
{
var marshaller = CreateDiskRequestMarshaller.Instance;
var unmarshaller = CreateDiskResponseUnmarshaller.Instance;
return Invoke<CreateDiskRequest,CreateDiskResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateDisk operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateDisk operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateDisk
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDisk">REST API Reference for CreateDisk Operation</seealso>
public virtual IAsyncResult BeginCreateDisk(CreateDiskRequest request, AsyncCallback callback, object state)
{
var marshaller = CreateDiskRequestMarshaller.Instance;
var unmarshaller = CreateDiskResponseUnmarshaller.Instance;
return BeginInvoke<CreateDiskRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateDisk operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateDisk.</param>
///
/// <returns>Returns a CreateDiskResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDisk">REST API Reference for CreateDisk Operation</seealso>
public virtual CreateDiskResponse EndCreateDisk(IAsyncResult asyncResult)
{
return EndInvoke<CreateDiskResponse>(asyncResult);
}
#endregion
#region CreateDiskFromSnapshot
/// <summary>
/// Creates a block storage disk from a disk snapshot that can be attached to a Lightsail
/// instance in the same Availability Zone (e.g., <code>us-east-2a</code>). The disk is
/// created in the regional endpoint that you send the HTTP request to. For more information,
/// see <a href="https://lightsail.aws.amazon.com/ls/docs/overview/article/understanding-regions-and-availability-zones-in-amazon-lightsail">Regions
/// and Availability Zones in Lightsail</a>.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateDiskFromSnapshot service method.</param>
///
/// <returns>The response from the CreateDiskFromSnapshot service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDiskFromSnapshot">REST API Reference for CreateDiskFromSnapshot Operation</seealso>
public virtual CreateDiskFromSnapshotResponse CreateDiskFromSnapshot(CreateDiskFromSnapshotRequest request)
{
var marshaller = CreateDiskFromSnapshotRequestMarshaller.Instance;
var unmarshaller = CreateDiskFromSnapshotResponseUnmarshaller.Instance;
return Invoke<CreateDiskFromSnapshotRequest,CreateDiskFromSnapshotResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateDiskFromSnapshot operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateDiskFromSnapshot operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateDiskFromSnapshot
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDiskFromSnapshot">REST API Reference for CreateDiskFromSnapshot Operation</seealso>
public virtual IAsyncResult BeginCreateDiskFromSnapshot(CreateDiskFromSnapshotRequest request, AsyncCallback callback, object state)
{
var marshaller = CreateDiskFromSnapshotRequestMarshaller.Instance;
var unmarshaller = CreateDiskFromSnapshotResponseUnmarshaller.Instance;
return BeginInvoke<CreateDiskFromSnapshotRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateDiskFromSnapshot operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateDiskFromSnapshot.</param>
///
/// <returns>Returns a CreateDiskFromSnapshotResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDiskFromSnapshot">REST API Reference for CreateDiskFromSnapshot Operation</seealso>
public virtual CreateDiskFromSnapshotResponse EndCreateDiskFromSnapshot(IAsyncResult asyncResult)
{
return EndInvoke<CreateDiskFromSnapshotResponse>(asyncResult);
}
#endregion
#region CreateDiskSnapshot
/// <summary>
/// Creates a snapshot of a block storage disk. You can use snapshots for backups, to
/// make copies of disks, and to save data before shutting down a Lightsail instance.
///
///
/// <para>
/// You can take a snapshot of an attached disk that is in use; however, snapshots only
/// capture data that has been written to your disk at the time the snapshot command is
/// issued. This may exclude any data that has been cached by any applications or the
/// operating system. If you can pause any file systems on the disk long enough to take
/// a snapshot, your snapshot should be complete. Nevertheless, if you cannot pause all
/// file writes to the disk, you should unmount the disk from within the Lightsail instance,
/// issue the create disk snapshot command, and then remount the disk to ensure a consistent
/// and complete snapshot. You may remount and use your disk while the snapshot status
/// is pending.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateDiskSnapshot service method.</param>
///
/// <returns>The response from the CreateDiskSnapshot service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDiskSnapshot">REST API Reference for CreateDiskSnapshot Operation</seealso>
public virtual CreateDiskSnapshotResponse CreateDiskSnapshot(CreateDiskSnapshotRequest request)
{
var marshaller = CreateDiskSnapshotRequestMarshaller.Instance;
var unmarshaller = CreateDiskSnapshotResponseUnmarshaller.Instance;
return Invoke<CreateDiskSnapshotRequest,CreateDiskSnapshotResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateDiskSnapshot operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateDiskSnapshot operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateDiskSnapshot
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDiskSnapshot">REST API Reference for CreateDiskSnapshot Operation</seealso>
public virtual IAsyncResult BeginCreateDiskSnapshot(CreateDiskSnapshotRequest request, AsyncCallback callback, object state)
{
var marshaller = CreateDiskSnapshotRequestMarshaller.Instance;
var unmarshaller = CreateDiskSnapshotResponseUnmarshaller.Instance;
return BeginInvoke<CreateDiskSnapshotRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateDiskSnapshot operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateDiskSnapshot.</param>
///
/// <returns>Returns a CreateDiskSnapshotResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDiskSnapshot">REST API Reference for CreateDiskSnapshot Operation</seealso>
public virtual CreateDiskSnapshotResponse EndCreateDiskSnapshot(IAsyncResult asyncResult)
{
return EndInvoke<CreateDiskSnapshotResponse>(asyncResult);
}
#endregion
#region CreateDomain
/// <summary>
/// Creates a domain resource for the specified domain (e.g., example.com).
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateDomain service method.</param>
///
/// <returns>The response from the CreateDomain service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomain">REST API Reference for CreateDomain Operation</seealso>
public virtual CreateDomainResponse CreateDomain(CreateDomainRequest request)
{
var marshaller = CreateDomainRequestMarshaller.Instance;
var unmarshaller = CreateDomainResponseUnmarshaller.Instance;
return Invoke<CreateDomainRequest,CreateDomainResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateDomain operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateDomain operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateDomain
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomain">REST API Reference for CreateDomain Operation</seealso>
public virtual IAsyncResult BeginCreateDomain(CreateDomainRequest request, AsyncCallback callback, object state)
{
var marshaller = CreateDomainRequestMarshaller.Instance;
var unmarshaller = CreateDomainResponseUnmarshaller.Instance;
return BeginInvoke<CreateDomainRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateDomain operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateDomain.</param>
///
/// <returns>Returns a CreateDomainResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomain">REST API Reference for CreateDomain Operation</seealso>
public virtual CreateDomainResponse EndCreateDomain(IAsyncResult asyncResult)
{
return EndInvoke<CreateDomainResponse>(asyncResult);
}
#endregion
#region CreateDomainEntry
/// <summary>
/// Creates one of the following entry records associated with the domain: A record, CNAME
/// record, TXT record, or MX record.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateDomainEntry service method.</param>
///
/// <returns>The response from the CreateDomainEntry service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomainEntry">REST API Reference for CreateDomainEntry Operation</seealso>
public virtual CreateDomainEntryResponse CreateDomainEntry(CreateDomainEntryRequest request)
{
var marshaller = CreateDomainEntryRequestMarshaller.Instance;
var unmarshaller = CreateDomainEntryResponseUnmarshaller.Instance;
return Invoke<CreateDomainEntryRequest,CreateDomainEntryResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateDomainEntry operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateDomainEntry operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateDomainEntry
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomainEntry">REST API Reference for CreateDomainEntry Operation</seealso>
public virtual IAsyncResult BeginCreateDomainEntry(CreateDomainEntryRequest request, AsyncCallback callback, object state)
{
var marshaller = CreateDomainEntryRequestMarshaller.Instance;
var unmarshaller = CreateDomainEntryResponseUnmarshaller.Instance;
return BeginInvoke<CreateDomainEntryRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateDomainEntry operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateDomainEntry.</param>
///
/// <returns>Returns a CreateDomainEntryResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomainEntry">REST API Reference for CreateDomainEntry Operation</seealso>
public virtual CreateDomainEntryResponse EndCreateDomainEntry(IAsyncResult asyncResult)
{
return EndInvoke<CreateDomainEntryResponse>(asyncResult);
}
#endregion
#region CreateInstances
/// <summary>
/// Creates one or more Amazon Lightsail virtual private servers, or <i>instances</i>.
/// Create instances using active blueprints. Inactive blueprints are listed to support
/// customers with existing instances but are not necessarily available for launch of
/// new instances. Blueprints are marked inactive when they become outdated due to operating
/// system updates or new application releases. Use the get blueprints operation to return
/// a list of available blueprints.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateInstances service method.</param>
///
/// <returns>The response from the CreateInstances service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstances">REST API Reference for CreateInstances Operation</seealso>
public virtual CreateInstancesResponse CreateInstances(CreateInstancesRequest request)
{
var marshaller = CreateInstancesRequestMarshaller.Instance;
var unmarshaller = CreateInstancesResponseUnmarshaller.Instance;
return Invoke<CreateInstancesRequest,CreateInstancesResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateInstances operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateInstances operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateInstances
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstances">REST API Reference for CreateInstances Operation</seealso>
public virtual IAsyncResult BeginCreateInstances(CreateInstancesRequest request, AsyncCallback callback, object state)
{
var marshaller = CreateInstancesRequestMarshaller.Instance;
var unmarshaller = CreateInstancesResponseUnmarshaller.Instance;
return BeginInvoke<CreateInstancesRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateInstances operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateInstances.</param>
///
/// <returns>Returns a CreateInstancesResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstances">REST API Reference for CreateInstances Operation</seealso>
public virtual CreateInstancesResponse EndCreateInstances(IAsyncResult asyncResult)
{
return EndInvoke<CreateInstancesResponse>(asyncResult);
}
#endregion
#region CreateInstancesFromSnapshot
/// <summary>
/// Uses a specific snapshot as a blueprint for creating one or more new instances that
/// are based on that identical configuration.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateInstancesFromSnapshot service method.</param>
///
/// <returns>The response from the CreateInstancesFromSnapshot service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstancesFromSnapshot">REST API Reference for CreateInstancesFromSnapshot Operation</seealso>
public virtual CreateInstancesFromSnapshotResponse CreateInstancesFromSnapshot(CreateInstancesFromSnapshotRequest request)
{
var marshaller = CreateInstancesFromSnapshotRequestMarshaller.Instance;
var unmarshaller = CreateInstancesFromSnapshotResponseUnmarshaller.Instance;
return Invoke<CreateInstancesFromSnapshotRequest,CreateInstancesFromSnapshotResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateInstancesFromSnapshot operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateInstancesFromSnapshot operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateInstancesFromSnapshot
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstancesFromSnapshot">REST API Reference for CreateInstancesFromSnapshot Operation</seealso>
public virtual IAsyncResult BeginCreateInstancesFromSnapshot(CreateInstancesFromSnapshotRequest request, AsyncCallback callback, object state)
{
var marshaller = CreateInstancesFromSnapshotRequestMarshaller.Instance;
var unmarshaller = CreateInstancesFromSnapshotResponseUnmarshaller.Instance;
return BeginInvoke<CreateInstancesFromSnapshotRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateInstancesFromSnapshot operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateInstancesFromSnapshot.</param>
///
/// <returns>Returns a CreateInstancesFromSnapshotResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstancesFromSnapshot">REST API Reference for CreateInstancesFromSnapshot Operation</seealso>
public virtual CreateInstancesFromSnapshotResponse EndCreateInstancesFromSnapshot(IAsyncResult asyncResult)
{
return EndInvoke<CreateInstancesFromSnapshotResponse>(asyncResult);
}
#endregion
#region CreateInstanceSnapshot
/// <summary>
/// Creates a snapshot of a specific virtual private server, or <i>instance</i>. You can
/// use a snapshot to create a new instance that is based on that snapshot.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateInstanceSnapshot service method.</param>
///
/// <returns>The response from the CreateInstanceSnapshot service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstanceSnapshot">REST API Reference for CreateInstanceSnapshot Operation</seealso>
public virtual CreateInstanceSnapshotResponse CreateInstanceSnapshot(CreateInstanceSnapshotRequest request)
{
var marshaller = CreateInstanceSnapshotRequestMarshaller.Instance;
var unmarshaller = CreateInstanceSnapshotResponseUnmarshaller.Instance;
return Invoke<CreateInstanceSnapshotRequest,CreateInstanceSnapshotResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateInstanceSnapshot operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateInstanceSnapshot operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateInstanceSnapshot
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstanceSnapshot">REST API Reference for CreateInstanceSnapshot Operation</seealso>
public virtual IAsyncResult BeginCreateInstanceSnapshot(CreateInstanceSnapshotRequest request, AsyncCallback callback, object state)
{
var marshaller = CreateInstanceSnapshotRequestMarshaller.Instance;
var unmarshaller = CreateInstanceSnapshotResponseUnmarshaller.Instance;
return BeginInvoke<CreateInstanceSnapshotRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateInstanceSnapshot operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateInstanceSnapshot.</param>
///
/// <returns>Returns a CreateInstanceSnapshotResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstanceSnapshot">REST API Reference for CreateInstanceSnapshot Operation</seealso>
public virtual CreateInstanceSnapshotResponse EndCreateInstanceSnapshot(IAsyncResult asyncResult)
{
return EndInvoke<CreateInstanceSnapshotResponse>(asyncResult);
}
#endregion
#region CreateKeyPair
/// <summary>
/// Creates an SSH key pair.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateKeyPair service method.</param>
///
/// <returns>The response from the CreateKeyPair service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateKeyPair">REST API Reference for CreateKeyPair Operation</seealso>
public virtual CreateKeyPairResponse CreateKeyPair(CreateKeyPairRequest request)
{
var marshaller = CreateKeyPairRequestMarshaller.Instance;
var unmarshaller = CreateKeyPairResponseUnmarshaller.Instance;
return Invoke<CreateKeyPairRequest,CreateKeyPairResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateKeyPair operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateKeyPair operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateKeyPair
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateKeyPair">REST API Reference for CreateKeyPair Operation</seealso>
public virtual IAsyncResult BeginCreateKeyPair(CreateKeyPairRequest request, AsyncCallback callback, object state)
{
var marshaller = CreateKeyPairRequestMarshaller.Instance;
var unmarshaller = CreateKeyPairResponseUnmarshaller.Instance;
return BeginInvoke<CreateKeyPairRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateKeyPair operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateKeyPair.</param>
///
/// <returns>Returns a CreateKeyPairResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateKeyPair">REST API Reference for CreateKeyPair Operation</seealso>
public virtual CreateKeyPairResponse EndCreateKeyPair(IAsyncResult asyncResult)
{
return EndInvoke<CreateKeyPairResponse>(asyncResult);
}
#endregion
#region CreateLoadBalancer
/// <summary>
/// Creates a Lightsail load balancer. To learn more about deciding whether to load balance
/// your application, see <a href="https://lightsail.aws.amazon.com/ls/docs/how-to/article/configure-lightsail-instances-for-load-balancing">Configure
/// your Lightsail instances for load balancing</a>. You can create up to 5 load balancers
/// per AWS Region in your account.
///
///
/// <para>
/// When you create a load balancer, you can specify a unique name and port settings.
/// To change additional load balancer settings, use the <code>UpdateLoadBalancerAttribute</code>
/// operation.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateLoadBalancer service method.</param>
///
/// <returns>The response from the CreateLoadBalancer service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateLoadBalancer">REST API Reference for CreateLoadBalancer Operation</seealso>
public virtual CreateLoadBalancerResponse CreateLoadBalancer(CreateLoadBalancerRequest request)
{
var marshaller = CreateLoadBalancerRequestMarshaller.Instance;
var unmarshaller = CreateLoadBalancerResponseUnmarshaller.Instance;
return Invoke<CreateLoadBalancerRequest,CreateLoadBalancerResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateLoadBalancer operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateLoadBalancer operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateLoadBalancer
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateLoadBalancer">REST API Reference for CreateLoadBalancer Operation</seealso>
public virtual IAsyncResult BeginCreateLoadBalancer(CreateLoadBalancerRequest request, AsyncCallback callback, object state)
{
var marshaller = CreateLoadBalancerRequestMarshaller.Instance;
var unmarshaller = CreateLoadBalancerResponseUnmarshaller.Instance;
return BeginInvoke<CreateLoadBalancerRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateLoadBalancer operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateLoadBalancer.</param>
///
/// <returns>Returns a CreateLoadBalancerResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateLoadBalancer">REST API Reference for CreateLoadBalancer Operation</seealso>
public virtual CreateLoadBalancerResponse EndCreateLoadBalancer(IAsyncResult asyncResult)
{
return EndInvoke<CreateLoadBalancerResponse>(asyncResult);
}
#endregion
#region CreateLoadBalancerTlsCertificate
/// <summary>
/// Creates a Lightsail load balancer TLS certificate.
///
///
/// <para>
/// TLS is just an updated, more secure version of Secure Socket Layer (SSL).
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateLoadBalancerTlsCertificate service method.</param>
///
/// <returns>The response from the CreateLoadBalancerTlsCertificate service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateLoadBalancerTlsCertificate">REST API Reference for CreateLoadBalancerTlsCertificate Operation</seealso>
public virtual CreateLoadBalancerTlsCertificateResponse CreateLoadBalancerTlsCertificate(CreateLoadBalancerTlsCertificateRequest request)
{
var marshaller = CreateLoadBalancerTlsCertificateRequestMarshaller.Instance;
var unmarshaller = CreateLoadBalancerTlsCertificateResponseUnmarshaller.Instance;
return Invoke<CreateLoadBalancerTlsCertificateRequest,CreateLoadBalancerTlsCertificateResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateLoadBalancerTlsCertificate operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateLoadBalancerTlsCertificate operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateLoadBalancerTlsCertificate
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateLoadBalancerTlsCertificate">REST API Reference for CreateLoadBalancerTlsCertificate Operation</seealso>
public virtual IAsyncResult BeginCreateLoadBalancerTlsCertificate(CreateLoadBalancerTlsCertificateRequest request, AsyncCallback callback, object state)
{
var marshaller = CreateLoadBalancerTlsCertificateRequestMarshaller.Instance;
var unmarshaller = CreateLoadBalancerTlsCertificateResponseUnmarshaller.Instance;
return BeginInvoke<CreateLoadBalancerTlsCertificateRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateLoadBalancerTlsCertificate operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateLoadBalancerTlsCertificate.</param>
///
/// <returns>Returns a CreateLoadBalancerTlsCertificateResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateLoadBalancerTlsCertificate">REST API Reference for CreateLoadBalancerTlsCertificate Operation</seealso>
public virtual CreateLoadBalancerTlsCertificateResponse EndCreateLoadBalancerTlsCertificate(IAsyncResult asyncResult)
{
return EndInvoke<CreateLoadBalancerTlsCertificateResponse>(asyncResult);
}
#endregion
#region CreateRelationalDatabase
/// <summary>
/// Creates a new database in Amazon Lightsail.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateRelationalDatabase service method.</param>
///
/// <returns>The response from the CreateRelationalDatabase service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabase">REST API Reference for CreateRelationalDatabase Operation</seealso>
public virtual CreateRelationalDatabaseResponse CreateRelationalDatabase(CreateRelationalDatabaseRequest request)
{
var marshaller = CreateRelationalDatabaseRequestMarshaller.Instance;
var unmarshaller = CreateRelationalDatabaseResponseUnmarshaller.Instance;
return Invoke<CreateRelationalDatabaseRequest,CreateRelationalDatabaseResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateRelationalDatabase operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateRelationalDatabase operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateRelationalDatabase
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabase">REST API Reference for CreateRelationalDatabase Operation</seealso>
public virtual IAsyncResult BeginCreateRelationalDatabase(CreateRelationalDatabaseRequest request, AsyncCallback callback, object state)
{
var marshaller = CreateRelationalDatabaseRequestMarshaller.Instance;
var unmarshaller = CreateRelationalDatabaseResponseUnmarshaller.Instance;
return BeginInvoke<CreateRelationalDatabaseRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateRelationalDatabase operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateRelationalDatabase.</param>
///
/// <returns>Returns a CreateRelationalDatabaseResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabase">REST API Reference for CreateRelationalDatabase Operation</seealso>
public virtual CreateRelationalDatabaseResponse EndCreateRelationalDatabase(IAsyncResult asyncResult)
{
return EndInvoke<CreateRelationalDatabaseResponse>(asyncResult);
}
#endregion
#region CreateRelationalDatabaseFromSnapshot
/// <summary>
/// Creates a new database from an existing database snapshot in Amazon Lightsail.
///
///
/// <para>
/// You can create a new database from a snapshot in if something goes wrong with your
/// original database, or to change it to a different plan, such as a high availability
/// or standard plan.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateRelationalDatabaseFromSnapshot service method.</param>
///
/// <returns>The response from the CreateRelationalDatabaseFromSnapshot service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabaseFromSnapshot">REST API Reference for CreateRelationalDatabaseFromSnapshot Operation</seealso>
public virtual CreateRelationalDatabaseFromSnapshotResponse CreateRelationalDatabaseFromSnapshot(CreateRelationalDatabaseFromSnapshotRequest request)
{
var marshaller = CreateRelationalDatabaseFromSnapshotRequestMarshaller.Instance;
var unmarshaller = CreateRelationalDatabaseFromSnapshotResponseUnmarshaller.Instance;
return Invoke<CreateRelationalDatabaseFromSnapshotRequest,CreateRelationalDatabaseFromSnapshotResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateRelationalDatabaseFromSnapshot operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateRelationalDatabaseFromSnapshot operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateRelationalDatabaseFromSnapshot
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabaseFromSnapshot">REST API Reference for CreateRelationalDatabaseFromSnapshot Operation</seealso>
public virtual IAsyncResult BeginCreateRelationalDatabaseFromSnapshot(CreateRelationalDatabaseFromSnapshotRequest request, AsyncCallback callback, object state)
{
var marshaller = CreateRelationalDatabaseFromSnapshotRequestMarshaller.Instance;
var unmarshaller = CreateRelationalDatabaseFromSnapshotResponseUnmarshaller.Instance;
return BeginInvoke<CreateRelationalDatabaseFromSnapshotRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateRelationalDatabaseFromSnapshot operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateRelationalDatabaseFromSnapshot.</param>
///
/// <returns>Returns a CreateRelationalDatabaseFromSnapshotResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabaseFromSnapshot">REST API Reference for CreateRelationalDatabaseFromSnapshot Operation</seealso>
public virtual CreateRelationalDatabaseFromSnapshotResponse EndCreateRelationalDatabaseFromSnapshot(IAsyncResult asyncResult)
{
return EndInvoke<CreateRelationalDatabaseFromSnapshotResponse>(asyncResult);
}
#endregion
#region CreateRelationalDatabaseSnapshot
/// <summary>
/// Creates a snapshot of your database in Amazon Lightsail. You can use snapshots for
/// backups, to make copies of a database, and to save data before deleting a database.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateRelationalDatabaseSnapshot service method.</param>
///
/// <returns>The response from the CreateRelationalDatabaseSnapshot service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabaseSnapshot">REST API Reference for CreateRelationalDatabaseSnapshot Operation</seealso>
public virtual CreateRelationalDatabaseSnapshotResponse CreateRelationalDatabaseSnapshot(CreateRelationalDatabaseSnapshotRequest request)
{
var marshaller = CreateRelationalDatabaseSnapshotRequestMarshaller.Instance;
var unmarshaller = CreateRelationalDatabaseSnapshotResponseUnmarshaller.Instance;
return Invoke<CreateRelationalDatabaseSnapshotRequest,CreateRelationalDatabaseSnapshotResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateRelationalDatabaseSnapshot operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateRelationalDatabaseSnapshot operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateRelationalDatabaseSnapshot
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabaseSnapshot">REST API Reference for CreateRelationalDatabaseSnapshot Operation</seealso>
public virtual IAsyncResult BeginCreateRelationalDatabaseSnapshot(CreateRelationalDatabaseSnapshotRequest request, AsyncCallback callback, object state)
{
var marshaller = CreateRelationalDatabaseSnapshotRequestMarshaller.Instance;
var unmarshaller = CreateRelationalDatabaseSnapshotResponseUnmarshaller.Instance;
return BeginInvoke<CreateRelationalDatabaseSnapshotRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateRelationalDatabaseSnapshot operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateRelationalDatabaseSnapshot.</param>
///
/// <returns>Returns a CreateRelationalDatabaseSnapshotResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabaseSnapshot">REST API Reference for CreateRelationalDatabaseSnapshot Operation</seealso>
public virtual CreateRelationalDatabaseSnapshotResponse EndCreateRelationalDatabaseSnapshot(IAsyncResult asyncResult)
{
return EndInvoke<CreateRelationalDatabaseSnapshotResponse>(asyncResult);
}
#endregion
#region DeleteDisk
/// <summary>
/// Deletes the specified block storage disk. The disk must be in the <code>available</code>
/// state (not attached to a Lightsail instance).
///
/// <note>
/// <para>
/// The disk may remain in the <code>deleting</code> state for several minutes.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteDisk service method.</param>
///
/// <returns>The response from the DeleteDisk service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDisk">REST API Reference for DeleteDisk Operation</seealso>
public virtual DeleteDiskResponse DeleteDisk(DeleteDiskRequest request)
{
var marshaller = DeleteDiskRequestMarshaller.Instance;
var unmarshaller = DeleteDiskResponseUnmarshaller.Instance;
return Invoke<DeleteDiskRequest,DeleteDiskResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteDisk operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteDisk operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteDisk
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDisk">REST API Reference for DeleteDisk Operation</seealso>
public virtual IAsyncResult BeginDeleteDisk(DeleteDiskRequest request, AsyncCallback callback, object state)
{
var marshaller = DeleteDiskRequestMarshaller.Instance;
var unmarshaller = DeleteDiskResponseUnmarshaller.Instance;
return BeginInvoke<DeleteDiskRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteDisk operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteDisk.</param>
///
/// <returns>Returns a DeleteDiskResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDisk">REST API Reference for DeleteDisk Operation</seealso>
public virtual DeleteDiskResponse EndDeleteDisk(IAsyncResult asyncResult)
{
return EndInvoke<DeleteDiskResponse>(asyncResult);
}
#endregion
#region DeleteDiskSnapshot
/// <summary>
/// Deletes the specified disk snapshot.
///
///
/// <para>
/// When you make periodic snapshots of a disk, the snapshots are incremental, and only
/// the blocks on the device that have changed since your last snapshot are saved in the
/// new snapshot. When you delete a snapshot, only the data not needed for any other snapshot
/// is removed. So regardless of which prior snapshots have been deleted, all active snapshots
/// will have access to all the information needed to restore the disk.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteDiskSnapshot service method.</param>
///
/// <returns>The response from the DeleteDiskSnapshot service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDiskSnapshot">REST API Reference for DeleteDiskSnapshot Operation</seealso>
public virtual DeleteDiskSnapshotResponse DeleteDiskSnapshot(DeleteDiskSnapshotRequest request)
{
var marshaller = DeleteDiskSnapshotRequestMarshaller.Instance;
var unmarshaller = DeleteDiskSnapshotResponseUnmarshaller.Instance;
return Invoke<DeleteDiskSnapshotRequest,DeleteDiskSnapshotResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteDiskSnapshot operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteDiskSnapshot operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteDiskSnapshot
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDiskSnapshot">REST API Reference for DeleteDiskSnapshot Operation</seealso>
public virtual IAsyncResult BeginDeleteDiskSnapshot(DeleteDiskSnapshotRequest request, AsyncCallback callback, object state)
{
var marshaller = DeleteDiskSnapshotRequestMarshaller.Instance;
var unmarshaller = DeleteDiskSnapshotResponseUnmarshaller.Instance;
return BeginInvoke<DeleteDiskSnapshotRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteDiskSnapshot operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteDiskSnapshot.</param>
///
/// <returns>Returns a DeleteDiskSnapshotResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDiskSnapshot">REST API Reference for DeleteDiskSnapshot Operation</seealso>
public virtual DeleteDiskSnapshotResponse EndDeleteDiskSnapshot(IAsyncResult asyncResult)
{
return EndInvoke<DeleteDiskSnapshotResponse>(asyncResult);
}
#endregion
#region DeleteDomain
/// <summary>
/// Deletes the specified domain recordset and all of its domain records.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteDomain service method.</param>
///
/// <returns>The response from the DeleteDomain service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomain">REST API Reference for DeleteDomain Operation</seealso>
public virtual DeleteDomainResponse DeleteDomain(DeleteDomainRequest request)
{
var marshaller = DeleteDomainRequestMarshaller.Instance;
var unmarshaller = DeleteDomainResponseUnmarshaller.Instance;
return Invoke<DeleteDomainRequest,DeleteDomainResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteDomain operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteDomain operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteDomain
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomain">REST API Reference for DeleteDomain Operation</seealso>
public virtual IAsyncResult BeginDeleteDomain(DeleteDomainRequest request, AsyncCallback callback, object state)
{
var marshaller = DeleteDomainRequestMarshaller.Instance;
var unmarshaller = DeleteDomainResponseUnmarshaller.Instance;
return BeginInvoke<DeleteDomainRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteDomain operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteDomain.</param>
///
/// <returns>Returns a DeleteDomainResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomain">REST API Reference for DeleteDomain Operation</seealso>
public virtual DeleteDomainResponse EndDeleteDomain(IAsyncResult asyncResult)
{
return EndInvoke<DeleteDomainResponse>(asyncResult);
}
#endregion
#region DeleteDomainEntry
/// <summary>
/// Deletes a specific domain entry.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteDomainEntry service method.</param>
///
/// <returns>The response from the DeleteDomainEntry service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomainEntry">REST API Reference for DeleteDomainEntry Operation</seealso>
public virtual DeleteDomainEntryResponse DeleteDomainEntry(DeleteDomainEntryRequest request)
{
var marshaller = DeleteDomainEntryRequestMarshaller.Instance;
var unmarshaller = DeleteDomainEntryResponseUnmarshaller.Instance;
return Invoke<DeleteDomainEntryRequest,DeleteDomainEntryResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteDomainEntry operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteDomainEntry operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteDomainEntry
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomainEntry">REST API Reference for DeleteDomainEntry Operation</seealso>
public virtual IAsyncResult BeginDeleteDomainEntry(DeleteDomainEntryRequest request, AsyncCallback callback, object state)
{
var marshaller = DeleteDomainEntryRequestMarshaller.Instance;
var unmarshaller = DeleteDomainEntryResponseUnmarshaller.Instance;
return BeginInvoke<DeleteDomainEntryRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteDomainEntry operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteDomainEntry.</param>
///
/// <returns>Returns a DeleteDomainEntryResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomainEntry">REST API Reference for DeleteDomainEntry Operation</seealso>
public virtual DeleteDomainEntryResponse EndDeleteDomainEntry(IAsyncResult asyncResult)
{
return EndInvoke<DeleteDomainEntryResponse>(asyncResult);
}
#endregion
#region DeleteInstance
/// <summary>
/// Deletes a specific Amazon Lightsail virtual private server, or <i>instance</i>.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteInstance service method.</param>
///
/// <returns>The response from the DeleteInstance service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstance">REST API Reference for DeleteInstance Operation</seealso>
public virtual DeleteInstanceResponse DeleteInstance(DeleteInstanceRequest request)
{
var marshaller = DeleteInstanceRequestMarshaller.Instance;
var unmarshaller = DeleteInstanceResponseUnmarshaller.Instance;
return Invoke<DeleteInstanceRequest,DeleteInstanceResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteInstance operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteInstance operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteInstance
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstance">REST API Reference for DeleteInstance Operation</seealso>
public virtual IAsyncResult BeginDeleteInstance(DeleteInstanceRequest request, AsyncCallback callback, object state)
{
var marshaller = DeleteInstanceRequestMarshaller.Instance;
var unmarshaller = DeleteInstanceResponseUnmarshaller.Instance;
return BeginInvoke<DeleteInstanceRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteInstance operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteInstance.</param>
///
/// <returns>Returns a DeleteInstanceResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstance">REST API Reference for DeleteInstance Operation</seealso>
public virtual DeleteInstanceResponse EndDeleteInstance(IAsyncResult asyncResult)
{
return EndInvoke<DeleteInstanceResponse>(asyncResult);
}
#endregion
#region DeleteInstanceSnapshot
/// <summary>
/// Deletes a specific snapshot of a virtual private server (or <i>instance</i>).
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteInstanceSnapshot service method.</param>
///
/// <returns>The response from the DeleteInstanceSnapshot service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstanceSnapshot">REST API Reference for DeleteInstanceSnapshot Operation</seealso>
public virtual DeleteInstanceSnapshotResponse DeleteInstanceSnapshot(DeleteInstanceSnapshotRequest request)
{
var marshaller = DeleteInstanceSnapshotRequestMarshaller.Instance;
var unmarshaller = DeleteInstanceSnapshotResponseUnmarshaller.Instance;
return Invoke<DeleteInstanceSnapshotRequest,DeleteInstanceSnapshotResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteInstanceSnapshot operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteInstanceSnapshot operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteInstanceSnapshot
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstanceSnapshot">REST API Reference for DeleteInstanceSnapshot Operation</seealso>
public virtual IAsyncResult BeginDeleteInstanceSnapshot(DeleteInstanceSnapshotRequest request, AsyncCallback callback, object state)
{
var marshaller = DeleteInstanceSnapshotRequestMarshaller.Instance;
var unmarshaller = DeleteInstanceSnapshotResponseUnmarshaller.Instance;
return BeginInvoke<DeleteInstanceSnapshotRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteInstanceSnapshot operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteInstanceSnapshot.</param>
///
/// <returns>Returns a DeleteInstanceSnapshotResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstanceSnapshot">REST API Reference for DeleteInstanceSnapshot Operation</seealso>
public virtual DeleteInstanceSnapshotResponse EndDeleteInstanceSnapshot(IAsyncResult asyncResult)
{
return EndInvoke<DeleteInstanceSnapshotResponse>(asyncResult);
}
#endregion
#region DeleteKeyPair
/// <summary>
/// Deletes a specific SSH key pair.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteKeyPair service method.</param>
///
/// <returns>The response from the DeleteKeyPair service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteKeyPair">REST API Reference for DeleteKeyPair Operation</seealso>
public virtual DeleteKeyPairResponse DeleteKeyPair(DeleteKeyPairRequest request)
{
var marshaller = DeleteKeyPairRequestMarshaller.Instance;
var unmarshaller = DeleteKeyPairResponseUnmarshaller.Instance;
return Invoke<DeleteKeyPairRequest,DeleteKeyPairResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteKeyPair operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteKeyPair operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteKeyPair
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteKeyPair">REST API Reference for DeleteKeyPair Operation</seealso>
public virtual IAsyncResult BeginDeleteKeyPair(DeleteKeyPairRequest request, AsyncCallback callback, object state)
{
var marshaller = DeleteKeyPairRequestMarshaller.Instance;
var unmarshaller = DeleteKeyPairResponseUnmarshaller.Instance;
return BeginInvoke<DeleteKeyPairRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteKeyPair operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteKeyPair.</param>
///
/// <returns>Returns a DeleteKeyPairResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteKeyPair">REST API Reference for DeleteKeyPair Operation</seealso>
public virtual DeleteKeyPairResponse EndDeleteKeyPair(IAsyncResult asyncResult)
{
return EndInvoke<DeleteKeyPairResponse>(asyncResult);
}
#endregion
#region DeleteLoadBalancer
/// <summary>
/// Deletes a Lightsail load balancer and all its associated SSL/TLS certificates. Once
/// the load balancer is deleted, you will need to create a new load balancer, create
/// a new certificate, and verify domain ownership again.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteLoadBalancer service method.</param>
///
/// <returns>The response from the DeleteLoadBalancer service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteLoadBalancer">REST API Reference for DeleteLoadBalancer Operation</seealso>
public virtual DeleteLoadBalancerResponse DeleteLoadBalancer(DeleteLoadBalancerRequest request)
{
var marshaller = DeleteLoadBalancerRequestMarshaller.Instance;
var unmarshaller = DeleteLoadBalancerResponseUnmarshaller.Instance;
return Invoke<DeleteLoadBalancerRequest,DeleteLoadBalancerResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteLoadBalancer operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteLoadBalancer operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteLoadBalancer
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteLoadBalancer">REST API Reference for DeleteLoadBalancer Operation</seealso>
public virtual IAsyncResult BeginDeleteLoadBalancer(DeleteLoadBalancerRequest request, AsyncCallback callback, object state)
{
var marshaller = DeleteLoadBalancerRequestMarshaller.Instance;
var unmarshaller = DeleteLoadBalancerResponseUnmarshaller.Instance;
return BeginInvoke<DeleteLoadBalancerRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteLoadBalancer operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteLoadBalancer.</param>
///
/// <returns>Returns a DeleteLoadBalancerResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteLoadBalancer">REST API Reference for DeleteLoadBalancer Operation</seealso>
public virtual DeleteLoadBalancerResponse EndDeleteLoadBalancer(IAsyncResult asyncResult)
{
return EndInvoke<DeleteLoadBalancerResponse>(asyncResult);
}
#endregion
#region DeleteLoadBalancerTlsCertificate
/// <summary>
/// Deletes an SSL/TLS certificate associated with a Lightsail load balancer.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteLoadBalancerTlsCertificate service method.</param>
///
/// <returns>The response from the DeleteLoadBalancerTlsCertificate service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteLoadBalancerTlsCertificate">REST API Reference for DeleteLoadBalancerTlsCertificate Operation</seealso>
public virtual DeleteLoadBalancerTlsCertificateResponse DeleteLoadBalancerTlsCertificate(DeleteLoadBalancerTlsCertificateRequest request)
{
var marshaller = DeleteLoadBalancerTlsCertificateRequestMarshaller.Instance;
var unmarshaller = DeleteLoadBalancerTlsCertificateResponseUnmarshaller.Instance;
return Invoke<DeleteLoadBalancerTlsCertificateRequest,DeleteLoadBalancerTlsCertificateResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteLoadBalancerTlsCertificate operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteLoadBalancerTlsCertificate operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteLoadBalancerTlsCertificate
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteLoadBalancerTlsCertificate">REST API Reference for DeleteLoadBalancerTlsCertificate Operation</seealso>
public virtual IAsyncResult BeginDeleteLoadBalancerTlsCertificate(DeleteLoadBalancerTlsCertificateRequest request, AsyncCallback callback, object state)
{
var marshaller = DeleteLoadBalancerTlsCertificateRequestMarshaller.Instance;
var unmarshaller = DeleteLoadBalancerTlsCertificateResponseUnmarshaller.Instance;
return BeginInvoke<DeleteLoadBalancerTlsCertificateRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteLoadBalancerTlsCertificate operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteLoadBalancerTlsCertificate.</param>
///
/// <returns>Returns a DeleteLoadBalancerTlsCertificateResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteLoadBalancerTlsCertificate">REST API Reference for DeleteLoadBalancerTlsCertificate Operation</seealso>
public virtual DeleteLoadBalancerTlsCertificateResponse EndDeleteLoadBalancerTlsCertificate(IAsyncResult asyncResult)
{
return EndInvoke<DeleteLoadBalancerTlsCertificateResponse>(asyncResult);
}
#endregion
#region DeleteRelationalDatabase
/// <summary>
/// Deletes a database in Amazon Lightsail.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteRelationalDatabase service method.</param>
///
/// <returns>The response from the DeleteRelationalDatabase service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteRelationalDatabase">REST API Reference for DeleteRelationalDatabase Operation</seealso>
public virtual DeleteRelationalDatabaseResponse DeleteRelationalDatabase(DeleteRelationalDatabaseRequest request)
{
var marshaller = DeleteRelationalDatabaseRequestMarshaller.Instance;
var unmarshaller = DeleteRelationalDatabaseResponseUnmarshaller.Instance;
return Invoke<DeleteRelationalDatabaseRequest,DeleteRelationalDatabaseResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteRelationalDatabase operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteRelationalDatabase operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteRelationalDatabase
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteRelationalDatabase">REST API Reference for DeleteRelationalDatabase Operation</seealso>
public virtual IAsyncResult BeginDeleteRelationalDatabase(DeleteRelationalDatabaseRequest request, AsyncCallback callback, object state)
{
var marshaller = DeleteRelationalDatabaseRequestMarshaller.Instance;
var unmarshaller = DeleteRelationalDatabaseResponseUnmarshaller.Instance;
return BeginInvoke<DeleteRelationalDatabaseRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteRelationalDatabase operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteRelationalDatabase.</param>
///
/// <returns>Returns a DeleteRelationalDatabaseResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteRelationalDatabase">REST API Reference for DeleteRelationalDatabase Operation</seealso>
public virtual DeleteRelationalDatabaseResponse EndDeleteRelationalDatabase(IAsyncResult asyncResult)
{
return EndInvoke<DeleteRelationalDatabaseResponse>(asyncResult);
}
#endregion
#region DeleteRelationalDatabaseSnapshot
/// <summary>
/// Deletes a database snapshot in Amazon Lightsail.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteRelationalDatabaseSnapshot service method.</param>
///
/// <returns>The response from the DeleteRelationalDatabaseSnapshot service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteRelationalDatabaseSnapshot">REST API Reference for DeleteRelationalDatabaseSnapshot Operation</seealso>
public virtual DeleteRelationalDatabaseSnapshotResponse DeleteRelationalDatabaseSnapshot(DeleteRelationalDatabaseSnapshotRequest request)
{
var marshaller = DeleteRelationalDatabaseSnapshotRequestMarshaller.Instance;
var unmarshaller = DeleteRelationalDatabaseSnapshotResponseUnmarshaller.Instance;
return Invoke<DeleteRelationalDatabaseSnapshotRequest,DeleteRelationalDatabaseSnapshotResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteRelationalDatabaseSnapshot operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteRelationalDatabaseSnapshot operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteRelationalDatabaseSnapshot
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteRelationalDatabaseSnapshot">REST API Reference for DeleteRelationalDatabaseSnapshot Operation</seealso>
public virtual IAsyncResult BeginDeleteRelationalDatabaseSnapshot(DeleteRelationalDatabaseSnapshotRequest request, AsyncCallback callback, object state)
{
var marshaller = DeleteRelationalDatabaseSnapshotRequestMarshaller.Instance;
var unmarshaller = DeleteRelationalDatabaseSnapshotResponseUnmarshaller.Instance;
return BeginInvoke<DeleteRelationalDatabaseSnapshotRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteRelationalDatabaseSnapshot operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteRelationalDatabaseSnapshot.</param>
///
/// <returns>Returns a DeleteRelationalDatabaseSnapshotResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteRelationalDatabaseSnapshot">REST API Reference for DeleteRelationalDatabaseSnapshot Operation</seealso>
public virtual DeleteRelationalDatabaseSnapshotResponse EndDeleteRelationalDatabaseSnapshot(IAsyncResult asyncResult)
{
return EndInvoke<DeleteRelationalDatabaseSnapshotResponse>(asyncResult);
}
#endregion
#region DetachDisk
/// <summary>
/// Detaches a stopped block storage disk from a Lightsail instance. Make sure to unmount
/// any file systems on the device within your operating system before stopping the instance
/// and detaching the disk.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DetachDisk service method.</param>
///
/// <returns>The response from the DetachDisk service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachDisk">REST API Reference for DetachDisk Operation</seealso>
public virtual DetachDiskResponse DetachDisk(DetachDiskRequest request)
{
var marshaller = DetachDiskRequestMarshaller.Instance;
var unmarshaller = DetachDiskResponseUnmarshaller.Instance;
return Invoke<DetachDiskRequest,DetachDiskResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DetachDisk operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DetachDisk operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDetachDisk
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachDisk">REST API Reference for DetachDisk Operation</seealso>
public virtual IAsyncResult BeginDetachDisk(DetachDiskRequest request, AsyncCallback callback, object state)
{
var marshaller = DetachDiskRequestMarshaller.Instance;
var unmarshaller = DetachDiskResponseUnmarshaller.Instance;
return BeginInvoke<DetachDiskRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DetachDisk operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDetachDisk.</param>
///
/// <returns>Returns a DetachDiskResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachDisk">REST API Reference for DetachDisk Operation</seealso>
public virtual DetachDiskResponse EndDetachDisk(IAsyncResult asyncResult)
{
return EndInvoke<DetachDiskResponse>(asyncResult);
}
#endregion
#region DetachInstancesFromLoadBalancer
/// <summary>
/// Detaches the specified instances from a Lightsail load balancer.
///
///
/// <para>
/// This operation waits until the instances are no longer needed before they are detached
/// from the load balancer.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DetachInstancesFromLoadBalancer service method.</param>
///
/// <returns>The response from the DetachInstancesFromLoadBalancer service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachInstancesFromLoadBalancer">REST API Reference for DetachInstancesFromLoadBalancer Operation</seealso>
public virtual DetachInstancesFromLoadBalancerResponse DetachInstancesFromLoadBalancer(DetachInstancesFromLoadBalancerRequest request)
{
var marshaller = DetachInstancesFromLoadBalancerRequestMarshaller.Instance;
var unmarshaller = DetachInstancesFromLoadBalancerResponseUnmarshaller.Instance;
return Invoke<DetachInstancesFromLoadBalancerRequest,DetachInstancesFromLoadBalancerResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DetachInstancesFromLoadBalancer operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DetachInstancesFromLoadBalancer operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDetachInstancesFromLoadBalancer
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachInstancesFromLoadBalancer">REST API Reference for DetachInstancesFromLoadBalancer Operation</seealso>
public virtual IAsyncResult BeginDetachInstancesFromLoadBalancer(DetachInstancesFromLoadBalancerRequest request, AsyncCallback callback, object state)
{
var marshaller = DetachInstancesFromLoadBalancerRequestMarshaller.Instance;
var unmarshaller = DetachInstancesFromLoadBalancerResponseUnmarshaller.Instance;
return BeginInvoke<DetachInstancesFromLoadBalancerRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DetachInstancesFromLoadBalancer operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDetachInstancesFromLoadBalancer.</param>
///
/// <returns>Returns a DetachInstancesFromLoadBalancerResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachInstancesFromLoadBalancer">REST API Reference for DetachInstancesFromLoadBalancer Operation</seealso>
public virtual DetachInstancesFromLoadBalancerResponse EndDetachInstancesFromLoadBalancer(IAsyncResult asyncResult)
{
return EndInvoke<DetachInstancesFromLoadBalancerResponse>(asyncResult);
}
#endregion
#region DetachStaticIp
/// <summary>
/// Detaches a static IP from the Amazon Lightsail instance to which it is attached.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DetachStaticIp service method.</param>
///
/// <returns>The response from the DetachStaticIp service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachStaticIp">REST API Reference for DetachStaticIp Operation</seealso>
public virtual DetachStaticIpResponse DetachStaticIp(DetachStaticIpRequest request)
{
var marshaller = DetachStaticIpRequestMarshaller.Instance;
var unmarshaller = DetachStaticIpResponseUnmarshaller.Instance;
return Invoke<DetachStaticIpRequest,DetachStaticIpResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DetachStaticIp operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DetachStaticIp operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDetachStaticIp
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachStaticIp">REST API Reference for DetachStaticIp Operation</seealso>
public virtual IAsyncResult BeginDetachStaticIp(DetachStaticIpRequest request, AsyncCallback callback, object state)
{
var marshaller = DetachStaticIpRequestMarshaller.Instance;
var unmarshaller = DetachStaticIpResponseUnmarshaller.Instance;
return BeginInvoke<DetachStaticIpRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DetachStaticIp operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDetachStaticIp.</param>
///
/// <returns>Returns a DetachStaticIpResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachStaticIp">REST API Reference for DetachStaticIp Operation</seealso>
public virtual DetachStaticIpResponse EndDetachStaticIp(IAsyncResult asyncResult)
{
return EndInvoke<DetachStaticIpResponse>(asyncResult);
}
#endregion
#region DownloadDefaultKeyPair
/// <summary>
/// Downloads the default SSH key pair from the user's account.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DownloadDefaultKeyPair service method.</param>
///
/// <returns>The response from the DownloadDefaultKeyPair service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DownloadDefaultKeyPair">REST API Reference for DownloadDefaultKeyPair Operation</seealso>
public virtual DownloadDefaultKeyPairResponse DownloadDefaultKeyPair(DownloadDefaultKeyPairRequest request)
{
var marshaller = DownloadDefaultKeyPairRequestMarshaller.Instance;
var unmarshaller = DownloadDefaultKeyPairResponseUnmarshaller.Instance;
return Invoke<DownloadDefaultKeyPairRequest,DownloadDefaultKeyPairResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DownloadDefaultKeyPair operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DownloadDefaultKeyPair operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDownloadDefaultKeyPair
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DownloadDefaultKeyPair">REST API Reference for DownloadDefaultKeyPair Operation</seealso>
public virtual IAsyncResult BeginDownloadDefaultKeyPair(DownloadDefaultKeyPairRequest request, AsyncCallback callback, object state)
{
var marshaller = DownloadDefaultKeyPairRequestMarshaller.Instance;
var unmarshaller = DownloadDefaultKeyPairResponseUnmarshaller.Instance;
return BeginInvoke<DownloadDefaultKeyPairRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DownloadDefaultKeyPair operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDownloadDefaultKeyPair.</param>
///
/// <returns>Returns a DownloadDefaultKeyPairResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DownloadDefaultKeyPair">REST API Reference for DownloadDefaultKeyPair Operation</seealso>
public virtual DownloadDefaultKeyPairResponse EndDownloadDefaultKeyPair(IAsyncResult asyncResult)
{
return EndInvoke<DownloadDefaultKeyPairResponse>(asyncResult);
}
#endregion
#region GetActiveNames
/// <summary>
/// Returns the names of all active (not deleted) resources.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetActiveNames service method.</param>
///
/// <returns>The response from the GetActiveNames service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetActiveNames">REST API Reference for GetActiveNames Operation</seealso>
public virtual GetActiveNamesResponse GetActiveNames(GetActiveNamesRequest request)
{
var marshaller = GetActiveNamesRequestMarshaller.Instance;
var unmarshaller = GetActiveNamesResponseUnmarshaller.Instance;
return Invoke<GetActiveNamesRequest,GetActiveNamesResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetActiveNames operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetActiveNames operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetActiveNames
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetActiveNames">REST API Reference for GetActiveNames Operation</seealso>
public virtual IAsyncResult BeginGetActiveNames(GetActiveNamesRequest request, AsyncCallback callback, object state)
{
var marshaller = GetActiveNamesRequestMarshaller.Instance;
var unmarshaller = GetActiveNamesResponseUnmarshaller.Instance;
return BeginInvoke<GetActiveNamesRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetActiveNames operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetActiveNames.</param>
///
/// <returns>Returns a GetActiveNamesResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetActiveNames">REST API Reference for GetActiveNames Operation</seealso>
public virtual GetActiveNamesResponse EndGetActiveNames(IAsyncResult asyncResult)
{
return EndInvoke<GetActiveNamesResponse>(asyncResult);
}
#endregion
#region GetBlueprints
/// <summary>
/// Returns the list of available instance images, or <i>blueprints</i>. You can use a
/// blueprint to create a new virtual private server already running a specific operating
/// system, as well as a preinstalled app or development stack. The software each instance
/// is running depends on the blueprint image you choose.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetBlueprints service method.</param>
///
/// <returns>The response from the GetBlueprints service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBlueprints">REST API Reference for GetBlueprints Operation</seealso>
public virtual GetBlueprintsResponse GetBlueprints(GetBlueprintsRequest request)
{
var marshaller = GetBlueprintsRequestMarshaller.Instance;
var unmarshaller = GetBlueprintsResponseUnmarshaller.Instance;
return Invoke<GetBlueprintsRequest,GetBlueprintsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetBlueprints operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetBlueprints operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetBlueprints
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBlueprints">REST API Reference for GetBlueprints Operation</seealso>
public virtual IAsyncResult BeginGetBlueprints(GetBlueprintsRequest request, AsyncCallback callback, object state)
{
var marshaller = GetBlueprintsRequestMarshaller.Instance;
var unmarshaller = GetBlueprintsResponseUnmarshaller.Instance;
return BeginInvoke<GetBlueprintsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetBlueprints operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetBlueprints.</param>
///
/// <returns>Returns a GetBlueprintsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBlueprints">REST API Reference for GetBlueprints Operation</seealso>
public virtual GetBlueprintsResponse EndGetBlueprints(IAsyncResult asyncResult)
{
return EndInvoke<GetBlueprintsResponse>(asyncResult);
}
#endregion
#region GetBundles
/// <summary>
/// Returns the list of bundles that are available for purchase. A bundle describes the
/// specs for your virtual private server (or <i>instance</i>).
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetBundles service method.</param>
///
/// <returns>The response from the GetBundles service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBundles">REST API Reference for GetBundles Operation</seealso>
public virtual GetBundlesResponse GetBundles(GetBundlesRequest request)
{
var marshaller = GetBundlesRequestMarshaller.Instance;
var unmarshaller = GetBundlesResponseUnmarshaller.Instance;
return Invoke<GetBundlesRequest,GetBundlesResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetBundles operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetBundles operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetBundles
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBundles">REST API Reference for GetBundles Operation</seealso>
public virtual IAsyncResult BeginGetBundles(GetBundlesRequest request, AsyncCallback callback, object state)
{
var marshaller = GetBundlesRequestMarshaller.Instance;
var unmarshaller = GetBundlesResponseUnmarshaller.Instance;
return BeginInvoke<GetBundlesRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetBundles operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetBundles.</param>
///
/// <returns>Returns a GetBundlesResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBundles">REST API Reference for GetBundles Operation</seealso>
public virtual GetBundlesResponse EndGetBundles(IAsyncResult asyncResult)
{
return EndInvoke<GetBundlesResponse>(asyncResult);
}
#endregion
#region GetDisk
/// <summary>
/// Returns information about a specific block storage disk.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetDisk service method.</param>
///
/// <returns>The response from the GetDisk service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDisk">REST API Reference for GetDisk Operation</seealso>
public virtual GetDiskResponse GetDisk(GetDiskRequest request)
{
var marshaller = GetDiskRequestMarshaller.Instance;
var unmarshaller = GetDiskResponseUnmarshaller.Instance;
return Invoke<GetDiskRequest,GetDiskResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetDisk operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetDisk operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetDisk
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDisk">REST API Reference for GetDisk Operation</seealso>
public virtual IAsyncResult BeginGetDisk(GetDiskRequest request, AsyncCallback callback, object state)
{
var marshaller = GetDiskRequestMarshaller.Instance;
var unmarshaller = GetDiskResponseUnmarshaller.Instance;
return BeginInvoke<GetDiskRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetDisk operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetDisk.</param>
///
/// <returns>Returns a GetDiskResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDisk">REST API Reference for GetDisk Operation</seealso>
public virtual GetDiskResponse EndGetDisk(IAsyncResult asyncResult)
{
return EndInvoke<GetDiskResponse>(asyncResult);
}
#endregion
#region GetDisks
/// <summary>
/// Returns information about all block storage disks in your AWS account and region.
///
///
/// <para>
/// If you are describing a long list of disks, you can paginate the output to make the
/// list more manageable. You can use the pageToken and nextPageToken values to retrieve
/// the next items in the list.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetDisks service method.</param>
///
/// <returns>The response from the GetDisks service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDisks">REST API Reference for GetDisks Operation</seealso>
public virtual GetDisksResponse GetDisks(GetDisksRequest request)
{
var marshaller = GetDisksRequestMarshaller.Instance;
var unmarshaller = GetDisksResponseUnmarshaller.Instance;
return Invoke<GetDisksRequest,GetDisksResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetDisks operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetDisks operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetDisks
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDisks">REST API Reference for GetDisks Operation</seealso>
public virtual IAsyncResult BeginGetDisks(GetDisksRequest request, AsyncCallback callback, object state)
{
var marshaller = GetDisksRequestMarshaller.Instance;
var unmarshaller = GetDisksResponseUnmarshaller.Instance;
return BeginInvoke<GetDisksRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetDisks operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetDisks.</param>
///
/// <returns>Returns a GetDisksResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDisks">REST API Reference for GetDisks Operation</seealso>
public virtual GetDisksResponse EndGetDisks(IAsyncResult asyncResult)
{
return EndInvoke<GetDisksResponse>(asyncResult);
}
#endregion
#region GetDiskSnapshot
/// <summary>
/// Returns information about a specific block storage disk snapshot.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetDiskSnapshot service method.</param>
///
/// <returns>The response from the GetDiskSnapshot service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDiskSnapshot">REST API Reference for GetDiskSnapshot Operation</seealso>
public virtual GetDiskSnapshotResponse GetDiskSnapshot(GetDiskSnapshotRequest request)
{
var marshaller = GetDiskSnapshotRequestMarshaller.Instance;
var unmarshaller = GetDiskSnapshotResponseUnmarshaller.Instance;
return Invoke<GetDiskSnapshotRequest,GetDiskSnapshotResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetDiskSnapshot operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetDiskSnapshot operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetDiskSnapshot
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDiskSnapshot">REST API Reference for GetDiskSnapshot Operation</seealso>
public virtual IAsyncResult BeginGetDiskSnapshot(GetDiskSnapshotRequest request, AsyncCallback callback, object state)
{
var marshaller = GetDiskSnapshotRequestMarshaller.Instance;
var unmarshaller = GetDiskSnapshotResponseUnmarshaller.Instance;
return BeginInvoke<GetDiskSnapshotRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetDiskSnapshot operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetDiskSnapshot.</param>
///
/// <returns>Returns a GetDiskSnapshotResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDiskSnapshot">REST API Reference for GetDiskSnapshot Operation</seealso>
public virtual GetDiskSnapshotResponse EndGetDiskSnapshot(IAsyncResult asyncResult)
{
return EndInvoke<GetDiskSnapshotResponse>(asyncResult);
}
#endregion
#region GetDiskSnapshots
/// <summary>
/// Returns information about all block storage disk snapshots in your AWS account and
/// region.
///
///
/// <para>
/// If you are describing a long list of disk snapshots, you can paginate the output to
/// make the list more manageable. You can use the pageToken and nextPageToken values
/// to retrieve the next items in the list.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetDiskSnapshots service method.</param>
///
/// <returns>The response from the GetDiskSnapshots service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDiskSnapshots">REST API Reference for GetDiskSnapshots Operation</seealso>
public virtual GetDiskSnapshotsResponse GetDiskSnapshots(GetDiskSnapshotsRequest request)
{
var marshaller = GetDiskSnapshotsRequestMarshaller.Instance;
var unmarshaller = GetDiskSnapshotsResponseUnmarshaller.Instance;
return Invoke<GetDiskSnapshotsRequest,GetDiskSnapshotsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetDiskSnapshots operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetDiskSnapshots operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetDiskSnapshots
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDiskSnapshots">REST API Reference for GetDiskSnapshots Operation</seealso>
public virtual IAsyncResult BeginGetDiskSnapshots(GetDiskSnapshotsRequest request, AsyncCallback callback, object state)
{
var marshaller = GetDiskSnapshotsRequestMarshaller.Instance;
var unmarshaller = GetDiskSnapshotsResponseUnmarshaller.Instance;
return BeginInvoke<GetDiskSnapshotsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetDiskSnapshots operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetDiskSnapshots.</param>
///
/// <returns>Returns a GetDiskSnapshotsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDiskSnapshots">REST API Reference for GetDiskSnapshots Operation</seealso>
public virtual GetDiskSnapshotsResponse EndGetDiskSnapshots(IAsyncResult asyncResult)
{
return EndInvoke<GetDiskSnapshotsResponse>(asyncResult);
}
#endregion
#region GetDomain
/// <summary>
/// Returns information about a specific domain recordset.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetDomain service method.</param>
///
/// <returns>The response from the GetDomain service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomain">REST API Reference for GetDomain Operation</seealso>
public virtual GetDomainResponse GetDomain(GetDomainRequest request)
{
var marshaller = GetDomainRequestMarshaller.Instance;
var unmarshaller = GetDomainResponseUnmarshaller.Instance;
return Invoke<GetDomainRequest,GetDomainResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetDomain operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetDomain operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetDomain
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomain">REST API Reference for GetDomain Operation</seealso>
public virtual IAsyncResult BeginGetDomain(GetDomainRequest request, AsyncCallback callback, object state)
{
var marshaller = GetDomainRequestMarshaller.Instance;
var unmarshaller = GetDomainResponseUnmarshaller.Instance;
return BeginInvoke<GetDomainRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetDomain operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetDomain.</param>
///
/// <returns>Returns a GetDomainResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomain">REST API Reference for GetDomain Operation</seealso>
public virtual GetDomainResponse EndGetDomain(IAsyncResult asyncResult)
{
return EndInvoke<GetDomainResponse>(asyncResult);
}
#endregion
#region GetDomains
/// <summary>
/// Returns a list of all domains in the user's account.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetDomains service method.</param>
///
/// <returns>The response from the GetDomains service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomains">REST API Reference for GetDomains Operation</seealso>
public virtual GetDomainsResponse GetDomains(GetDomainsRequest request)
{
var marshaller = GetDomainsRequestMarshaller.Instance;
var unmarshaller = GetDomainsResponseUnmarshaller.Instance;
return Invoke<GetDomainsRequest,GetDomainsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetDomains operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetDomains operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetDomains
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomains">REST API Reference for GetDomains Operation</seealso>
public virtual IAsyncResult BeginGetDomains(GetDomainsRequest request, AsyncCallback callback, object state)
{
var marshaller = GetDomainsRequestMarshaller.Instance;
var unmarshaller = GetDomainsResponseUnmarshaller.Instance;
return BeginInvoke<GetDomainsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetDomains operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetDomains.</param>
///
/// <returns>Returns a GetDomainsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomains">REST API Reference for GetDomains Operation</seealso>
public virtual GetDomainsResponse EndGetDomains(IAsyncResult asyncResult)
{
return EndInvoke<GetDomainsResponse>(asyncResult);
}
#endregion
#region GetInstance
/// <summary>
/// Returns information about a specific Amazon Lightsail instance, which is a virtual
/// private server.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetInstance service method.</param>
///
/// <returns>The response from the GetInstance service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstance">REST API Reference for GetInstance Operation</seealso>
public virtual GetInstanceResponse GetInstance(GetInstanceRequest request)
{
var marshaller = GetInstanceRequestMarshaller.Instance;
var unmarshaller = GetInstanceResponseUnmarshaller.Instance;
return Invoke<GetInstanceRequest,GetInstanceResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetInstance operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetInstance operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetInstance
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstance">REST API Reference for GetInstance Operation</seealso>
public virtual IAsyncResult BeginGetInstance(GetInstanceRequest request, AsyncCallback callback, object state)
{
var marshaller = GetInstanceRequestMarshaller.Instance;
var unmarshaller = GetInstanceResponseUnmarshaller.Instance;
return BeginInvoke<GetInstanceRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetInstance operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetInstance.</param>
///
/// <returns>Returns a GetInstanceResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstance">REST API Reference for GetInstance Operation</seealso>
public virtual GetInstanceResponse EndGetInstance(IAsyncResult asyncResult)
{
return EndInvoke<GetInstanceResponse>(asyncResult);
}
#endregion
#region GetInstanceAccessDetails
/// <summary>
/// Returns temporary SSH keys you can use to connect to a specific virtual private server,
/// or <i>instance</i>.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetInstanceAccessDetails service method.</param>
///
/// <returns>The response from the GetInstanceAccessDetails service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceAccessDetails">REST API Reference for GetInstanceAccessDetails Operation</seealso>
public virtual GetInstanceAccessDetailsResponse GetInstanceAccessDetails(GetInstanceAccessDetailsRequest request)
{
var marshaller = GetInstanceAccessDetailsRequestMarshaller.Instance;
var unmarshaller = GetInstanceAccessDetailsResponseUnmarshaller.Instance;
return Invoke<GetInstanceAccessDetailsRequest,GetInstanceAccessDetailsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetInstanceAccessDetails operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetInstanceAccessDetails operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetInstanceAccessDetails
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceAccessDetails">REST API Reference for GetInstanceAccessDetails Operation</seealso>
public virtual IAsyncResult BeginGetInstanceAccessDetails(GetInstanceAccessDetailsRequest request, AsyncCallback callback, object state)
{
var marshaller = GetInstanceAccessDetailsRequestMarshaller.Instance;
var unmarshaller = GetInstanceAccessDetailsResponseUnmarshaller.Instance;
return BeginInvoke<GetInstanceAccessDetailsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetInstanceAccessDetails operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetInstanceAccessDetails.</param>
///
/// <returns>Returns a GetInstanceAccessDetailsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceAccessDetails">REST API Reference for GetInstanceAccessDetails Operation</seealso>
public virtual GetInstanceAccessDetailsResponse EndGetInstanceAccessDetails(IAsyncResult asyncResult)
{
return EndInvoke<GetInstanceAccessDetailsResponse>(asyncResult);
}
#endregion
#region GetInstanceMetricData
/// <summary>
/// Returns the data points for the specified Amazon Lightsail instance metric, given
/// an instance name.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetInstanceMetricData service method.</param>
///
/// <returns>The response from the GetInstanceMetricData service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceMetricData">REST API Reference for GetInstanceMetricData Operation</seealso>
public virtual GetInstanceMetricDataResponse GetInstanceMetricData(GetInstanceMetricDataRequest request)
{
var marshaller = GetInstanceMetricDataRequestMarshaller.Instance;
var unmarshaller = GetInstanceMetricDataResponseUnmarshaller.Instance;
return Invoke<GetInstanceMetricDataRequest,GetInstanceMetricDataResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetInstanceMetricData operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetInstanceMetricData operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetInstanceMetricData
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceMetricData">REST API Reference for GetInstanceMetricData Operation</seealso>
public virtual IAsyncResult BeginGetInstanceMetricData(GetInstanceMetricDataRequest request, AsyncCallback callback, object state)
{
var marshaller = GetInstanceMetricDataRequestMarshaller.Instance;
var unmarshaller = GetInstanceMetricDataResponseUnmarshaller.Instance;
return BeginInvoke<GetInstanceMetricDataRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetInstanceMetricData operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetInstanceMetricData.</param>
///
/// <returns>Returns a GetInstanceMetricDataResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceMetricData">REST API Reference for GetInstanceMetricData Operation</seealso>
public virtual GetInstanceMetricDataResponse EndGetInstanceMetricData(IAsyncResult asyncResult)
{
return EndInvoke<GetInstanceMetricDataResponse>(asyncResult);
}
#endregion
#region GetInstancePortStates
/// <summary>
/// Returns the port states for a specific virtual private server, or <i>instance</i>.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetInstancePortStates service method.</param>
///
/// <returns>The response from the GetInstancePortStates service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstancePortStates">REST API Reference for GetInstancePortStates Operation</seealso>
public virtual GetInstancePortStatesResponse GetInstancePortStates(GetInstancePortStatesRequest request)
{
var marshaller = GetInstancePortStatesRequestMarshaller.Instance;
var unmarshaller = GetInstancePortStatesResponseUnmarshaller.Instance;
return Invoke<GetInstancePortStatesRequest,GetInstancePortStatesResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetInstancePortStates operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetInstancePortStates operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetInstancePortStates
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstancePortStates">REST API Reference for GetInstancePortStates Operation</seealso>
public virtual IAsyncResult BeginGetInstancePortStates(GetInstancePortStatesRequest request, AsyncCallback callback, object state)
{
var marshaller = GetInstancePortStatesRequestMarshaller.Instance;
var unmarshaller = GetInstancePortStatesResponseUnmarshaller.Instance;
return BeginInvoke<GetInstancePortStatesRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetInstancePortStates operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetInstancePortStates.</param>
///
/// <returns>Returns a GetInstancePortStatesResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstancePortStates">REST API Reference for GetInstancePortStates Operation</seealso>
public virtual GetInstancePortStatesResponse EndGetInstancePortStates(IAsyncResult asyncResult)
{
return EndInvoke<GetInstancePortStatesResponse>(asyncResult);
}
#endregion
#region GetInstances
/// <summary>
/// Returns information about all Amazon Lightsail virtual private servers, or <i>instances</i>.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetInstances service method.</param>
///
/// <returns>The response from the GetInstances service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstances">REST API Reference for GetInstances Operation</seealso>
public virtual GetInstancesResponse GetInstances(GetInstancesRequest request)
{
var marshaller = GetInstancesRequestMarshaller.Instance;
var unmarshaller = GetInstancesResponseUnmarshaller.Instance;
return Invoke<GetInstancesRequest,GetInstancesResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetInstances operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetInstances operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetInstances
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstances">REST API Reference for GetInstances Operation</seealso>
public virtual IAsyncResult BeginGetInstances(GetInstancesRequest request, AsyncCallback callback, object state)
{
var marshaller = GetInstancesRequestMarshaller.Instance;
var unmarshaller = GetInstancesResponseUnmarshaller.Instance;
return BeginInvoke<GetInstancesRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetInstances operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetInstances.</param>
///
/// <returns>Returns a GetInstancesResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstances">REST API Reference for GetInstances Operation</seealso>
public virtual GetInstancesResponse EndGetInstances(IAsyncResult asyncResult)
{
return EndInvoke<GetInstancesResponse>(asyncResult);
}
#endregion
#region GetInstanceSnapshot
/// <summary>
/// Returns information about a specific instance snapshot.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetInstanceSnapshot service method.</param>
///
/// <returns>The response from the GetInstanceSnapshot service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshot">REST API Reference for GetInstanceSnapshot Operation</seealso>
public virtual GetInstanceSnapshotResponse GetInstanceSnapshot(GetInstanceSnapshotRequest request)
{
var marshaller = GetInstanceSnapshotRequestMarshaller.Instance;
var unmarshaller = GetInstanceSnapshotResponseUnmarshaller.Instance;
return Invoke<GetInstanceSnapshotRequest,GetInstanceSnapshotResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetInstanceSnapshot operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetInstanceSnapshot operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetInstanceSnapshot
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshot">REST API Reference for GetInstanceSnapshot Operation</seealso>
public virtual IAsyncResult BeginGetInstanceSnapshot(GetInstanceSnapshotRequest request, AsyncCallback callback, object state)
{
var marshaller = GetInstanceSnapshotRequestMarshaller.Instance;
var unmarshaller = GetInstanceSnapshotResponseUnmarshaller.Instance;
return BeginInvoke<GetInstanceSnapshotRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetInstanceSnapshot operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetInstanceSnapshot.</param>
///
/// <returns>Returns a GetInstanceSnapshotResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshot">REST API Reference for GetInstanceSnapshot Operation</seealso>
public virtual GetInstanceSnapshotResponse EndGetInstanceSnapshot(IAsyncResult asyncResult)
{
return EndInvoke<GetInstanceSnapshotResponse>(asyncResult);
}
#endregion
#region GetInstanceSnapshots
/// <summary>
/// Returns all instance snapshots for the user's account.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetInstanceSnapshots service method.</param>
///
/// <returns>The response from the GetInstanceSnapshots service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshots">REST API Reference for GetInstanceSnapshots Operation</seealso>
public virtual GetInstanceSnapshotsResponse GetInstanceSnapshots(GetInstanceSnapshotsRequest request)
{
var marshaller = GetInstanceSnapshotsRequestMarshaller.Instance;
var unmarshaller = GetInstanceSnapshotsResponseUnmarshaller.Instance;
return Invoke<GetInstanceSnapshotsRequest,GetInstanceSnapshotsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetInstanceSnapshots operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetInstanceSnapshots operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetInstanceSnapshots
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshots">REST API Reference for GetInstanceSnapshots Operation</seealso>
public virtual IAsyncResult BeginGetInstanceSnapshots(GetInstanceSnapshotsRequest request, AsyncCallback callback, object state)
{
var marshaller = GetInstanceSnapshotsRequestMarshaller.Instance;
var unmarshaller = GetInstanceSnapshotsResponseUnmarshaller.Instance;
return BeginInvoke<GetInstanceSnapshotsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetInstanceSnapshots operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetInstanceSnapshots.</param>
///
/// <returns>Returns a GetInstanceSnapshotsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshots">REST API Reference for GetInstanceSnapshots Operation</seealso>
public virtual GetInstanceSnapshotsResponse EndGetInstanceSnapshots(IAsyncResult asyncResult)
{
return EndInvoke<GetInstanceSnapshotsResponse>(asyncResult);
}
#endregion
#region GetInstanceState
/// <summary>
/// Returns the state of a specific instance. Works on one instance at a time.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetInstanceState service method.</param>
///
/// <returns>The response from the GetInstanceState service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceState">REST API Reference for GetInstanceState Operation</seealso>
public virtual GetInstanceStateResponse GetInstanceState(GetInstanceStateRequest request)
{
var marshaller = GetInstanceStateRequestMarshaller.Instance;
var unmarshaller = GetInstanceStateResponseUnmarshaller.Instance;
return Invoke<GetInstanceStateRequest,GetInstanceStateResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetInstanceState operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetInstanceState operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetInstanceState
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceState">REST API Reference for GetInstanceState Operation</seealso>
public virtual IAsyncResult BeginGetInstanceState(GetInstanceStateRequest request, AsyncCallback callback, object state)
{
var marshaller = GetInstanceStateRequestMarshaller.Instance;
var unmarshaller = GetInstanceStateResponseUnmarshaller.Instance;
return BeginInvoke<GetInstanceStateRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetInstanceState operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetInstanceState.</param>
///
/// <returns>Returns a GetInstanceStateResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceState">REST API Reference for GetInstanceState Operation</seealso>
public virtual GetInstanceStateResponse EndGetInstanceState(IAsyncResult asyncResult)
{
return EndInvoke<GetInstanceStateResponse>(asyncResult);
}
#endregion
#region GetKeyPair
/// <summary>
/// Returns information about a specific key pair.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetKeyPair service method.</param>
///
/// <returns>The response from the GetKeyPair service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPair">REST API Reference for GetKeyPair Operation</seealso>
public virtual GetKeyPairResponse GetKeyPair(GetKeyPairRequest request)
{
var marshaller = GetKeyPairRequestMarshaller.Instance;
var unmarshaller = GetKeyPairResponseUnmarshaller.Instance;
return Invoke<GetKeyPairRequest,GetKeyPairResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetKeyPair operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetKeyPair operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetKeyPair
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPair">REST API Reference for GetKeyPair Operation</seealso>
public virtual IAsyncResult BeginGetKeyPair(GetKeyPairRequest request, AsyncCallback callback, object state)
{
var marshaller = GetKeyPairRequestMarshaller.Instance;
var unmarshaller = GetKeyPairResponseUnmarshaller.Instance;
return BeginInvoke<GetKeyPairRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetKeyPair operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetKeyPair.</param>
///
/// <returns>Returns a GetKeyPairResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPair">REST API Reference for GetKeyPair Operation</seealso>
public virtual GetKeyPairResponse EndGetKeyPair(IAsyncResult asyncResult)
{
return EndInvoke<GetKeyPairResponse>(asyncResult);
}
#endregion
#region GetKeyPairs
/// <summary>
/// Returns information about all key pairs in the user's account.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetKeyPairs service method.</param>
///
/// <returns>The response from the GetKeyPairs service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPairs">REST API Reference for GetKeyPairs Operation</seealso>
public virtual GetKeyPairsResponse GetKeyPairs(GetKeyPairsRequest request)
{
var marshaller = GetKeyPairsRequestMarshaller.Instance;
var unmarshaller = GetKeyPairsResponseUnmarshaller.Instance;
return Invoke<GetKeyPairsRequest,GetKeyPairsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetKeyPairs operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetKeyPairs operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetKeyPairs
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPairs">REST API Reference for GetKeyPairs Operation</seealso>
public virtual IAsyncResult BeginGetKeyPairs(GetKeyPairsRequest request, AsyncCallback callback, object state)
{
var marshaller = GetKeyPairsRequestMarshaller.Instance;
var unmarshaller = GetKeyPairsResponseUnmarshaller.Instance;
return BeginInvoke<GetKeyPairsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetKeyPairs operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetKeyPairs.</param>
///
/// <returns>Returns a GetKeyPairsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPairs">REST API Reference for GetKeyPairs Operation</seealso>
public virtual GetKeyPairsResponse EndGetKeyPairs(IAsyncResult asyncResult)
{
return EndInvoke<GetKeyPairsResponse>(asyncResult);
}
#endregion
#region GetLoadBalancer
/// <summary>
/// Returns information about the specified Lightsail load balancer.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetLoadBalancer service method.</param>
///
/// <returns>The response from the GetLoadBalancer service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancer">REST API Reference for GetLoadBalancer Operation</seealso>
public virtual GetLoadBalancerResponse GetLoadBalancer(GetLoadBalancerRequest request)
{
var marshaller = GetLoadBalancerRequestMarshaller.Instance;
var unmarshaller = GetLoadBalancerResponseUnmarshaller.Instance;
return Invoke<GetLoadBalancerRequest,GetLoadBalancerResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetLoadBalancer operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetLoadBalancer operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetLoadBalancer
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancer">REST API Reference for GetLoadBalancer Operation</seealso>
public virtual IAsyncResult BeginGetLoadBalancer(GetLoadBalancerRequest request, AsyncCallback callback, object state)
{
var marshaller = GetLoadBalancerRequestMarshaller.Instance;
var unmarshaller = GetLoadBalancerResponseUnmarshaller.Instance;
return BeginInvoke<GetLoadBalancerRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetLoadBalancer operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetLoadBalancer.</param>
///
/// <returns>Returns a GetLoadBalancerResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancer">REST API Reference for GetLoadBalancer Operation</seealso>
public virtual GetLoadBalancerResponse EndGetLoadBalancer(IAsyncResult asyncResult)
{
return EndInvoke<GetLoadBalancerResponse>(asyncResult);
}
#endregion
#region GetLoadBalancerMetricData
/// <summary>
/// Returns information about health metrics for your Lightsail load balancer.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetLoadBalancerMetricData service method.</param>
///
/// <returns>The response from the GetLoadBalancerMetricData service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancerMetricData">REST API Reference for GetLoadBalancerMetricData Operation</seealso>
public virtual GetLoadBalancerMetricDataResponse GetLoadBalancerMetricData(GetLoadBalancerMetricDataRequest request)
{
var marshaller = GetLoadBalancerMetricDataRequestMarshaller.Instance;
var unmarshaller = GetLoadBalancerMetricDataResponseUnmarshaller.Instance;
return Invoke<GetLoadBalancerMetricDataRequest,GetLoadBalancerMetricDataResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetLoadBalancerMetricData operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetLoadBalancerMetricData operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetLoadBalancerMetricData
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancerMetricData">REST API Reference for GetLoadBalancerMetricData Operation</seealso>
public virtual IAsyncResult BeginGetLoadBalancerMetricData(GetLoadBalancerMetricDataRequest request, AsyncCallback callback, object state)
{
var marshaller = GetLoadBalancerMetricDataRequestMarshaller.Instance;
var unmarshaller = GetLoadBalancerMetricDataResponseUnmarshaller.Instance;
return BeginInvoke<GetLoadBalancerMetricDataRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetLoadBalancerMetricData operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetLoadBalancerMetricData.</param>
///
/// <returns>Returns a GetLoadBalancerMetricDataResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancerMetricData">REST API Reference for GetLoadBalancerMetricData Operation</seealso>
public virtual GetLoadBalancerMetricDataResponse EndGetLoadBalancerMetricData(IAsyncResult asyncResult)
{
return EndInvoke<GetLoadBalancerMetricDataResponse>(asyncResult);
}
#endregion
#region GetLoadBalancers
/// <summary>
/// Returns information about all load balancers in an account.
///
///
/// <para>
/// If you are describing a long list of load balancers, you can paginate the output to
/// make the list more manageable. You can use the pageToken and nextPageToken values
/// to retrieve the next items in the list.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetLoadBalancers service method.</param>
///
/// <returns>The response from the GetLoadBalancers service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancers">REST API Reference for GetLoadBalancers Operation</seealso>
public virtual GetLoadBalancersResponse GetLoadBalancers(GetLoadBalancersRequest request)
{
var marshaller = GetLoadBalancersRequestMarshaller.Instance;
var unmarshaller = GetLoadBalancersResponseUnmarshaller.Instance;
return Invoke<GetLoadBalancersRequest,GetLoadBalancersResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetLoadBalancers operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetLoadBalancers operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetLoadBalancers
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancers">REST API Reference for GetLoadBalancers Operation</seealso>
public virtual IAsyncResult BeginGetLoadBalancers(GetLoadBalancersRequest request, AsyncCallback callback, object state)
{
var marshaller = GetLoadBalancersRequestMarshaller.Instance;
var unmarshaller = GetLoadBalancersResponseUnmarshaller.Instance;
return BeginInvoke<GetLoadBalancersRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetLoadBalancers operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetLoadBalancers.</param>
///
/// <returns>Returns a GetLoadBalancersResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancers">REST API Reference for GetLoadBalancers Operation</seealso>
public virtual GetLoadBalancersResponse EndGetLoadBalancers(IAsyncResult asyncResult)
{
return EndInvoke<GetLoadBalancersResponse>(asyncResult);
}
#endregion
#region GetLoadBalancerTlsCertificates
/// <summary>
/// Returns information about the TLS certificates that are associated with the specified
/// Lightsail load balancer.
///
///
/// <para>
/// TLS is just an updated, more secure version of Secure Socket Layer (SSL).
/// </para>
///
/// <para>
/// You can have a maximum of 2 certificates associated with a Lightsail load balancer.
/// One is active and the other is inactive.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetLoadBalancerTlsCertificates service method.</param>
///
/// <returns>The response from the GetLoadBalancerTlsCertificates service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancerTlsCertificates">REST API Reference for GetLoadBalancerTlsCertificates Operation</seealso>
public virtual GetLoadBalancerTlsCertificatesResponse GetLoadBalancerTlsCertificates(GetLoadBalancerTlsCertificatesRequest request)
{
var marshaller = GetLoadBalancerTlsCertificatesRequestMarshaller.Instance;
var unmarshaller = GetLoadBalancerTlsCertificatesResponseUnmarshaller.Instance;
return Invoke<GetLoadBalancerTlsCertificatesRequest,GetLoadBalancerTlsCertificatesResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetLoadBalancerTlsCertificates operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetLoadBalancerTlsCertificates operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetLoadBalancerTlsCertificates
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancerTlsCertificates">REST API Reference for GetLoadBalancerTlsCertificates Operation</seealso>
public virtual IAsyncResult BeginGetLoadBalancerTlsCertificates(GetLoadBalancerTlsCertificatesRequest request, AsyncCallback callback, object state)
{
var marshaller = GetLoadBalancerTlsCertificatesRequestMarshaller.Instance;
var unmarshaller = GetLoadBalancerTlsCertificatesResponseUnmarshaller.Instance;
return BeginInvoke<GetLoadBalancerTlsCertificatesRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetLoadBalancerTlsCertificates operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetLoadBalancerTlsCertificates.</param>
///
/// <returns>Returns a GetLoadBalancerTlsCertificatesResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancerTlsCertificates">REST API Reference for GetLoadBalancerTlsCertificates Operation</seealso>
public virtual GetLoadBalancerTlsCertificatesResponse EndGetLoadBalancerTlsCertificates(IAsyncResult asyncResult)
{
return EndInvoke<GetLoadBalancerTlsCertificatesResponse>(asyncResult);
}
#endregion
#region GetOperation
/// <summary>
/// Returns information about a specific operation. Operations include events such as
/// when you create an instance, allocate a static IP, attach a static IP, and so on.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetOperation service method.</param>
///
/// <returns>The response from the GetOperation service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperation">REST API Reference for GetOperation Operation</seealso>
public virtual GetOperationResponse GetOperation(GetOperationRequest request)
{
var marshaller = GetOperationRequestMarshaller.Instance;
var unmarshaller = GetOperationResponseUnmarshaller.Instance;
return Invoke<GetOperationRequest,GetOperationResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetOperation operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetOperation operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetOperation
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperation">REST API Reference for GetOperation Operation</seealso>
public virtual IAsyncResult BeginGetOperation(GetOperationRequest request, AsyncCallback callback, object state)
{
var marshaller = GetOperationRequestMarshaller.Instance;
var unmarshaller = GetOperationResponseUnmarshaller.Instance;
return BeginInvoke<GetOperationRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetOperation operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetOperation.</param>
///
/// <returns>Returns a GetOperationResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperation">REST API Reference for GetOperation Operation</seealso>
public virtual GetOperationResponse EndGetOperation(IAsyncResult asyncResult)
{
return EndInvoke<GetOperationResponse>(asyncResult);
}
#endregion
#region GetOperations
/// <summary>
/// Returns information about all operations.
///
///
/// <para>
/// Results are returned from oldest to newest, up to a maximum of 200. Results can be
/// paged by making each subsequent call to <code>GetOperations</code> use the maximum
/// (last) <code>statusChangedAt</code> value from the previous request.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetOperations service method.</param>
///
/// <returns>The response from the GetOperations service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperations">REST API Reference for GetOperations Operation</seealso>
public virtual GetOperationsResponse GetOperations(GetOperationsRequest request)
{
var marshaller = GetOperationsRequestMarshaller.Instance;
var unmarshaller = GetOperationsResponseUnmarshaller.Instance;
return Invoke<GetOperationsRequest,GetOperationsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetOperations operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetOperations operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetOperations
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperations">REST API Reference for GetOperations Operation</seealso>
public virtual IAsyncResult BeginGetOperations(GetOperationsRequest request, AsyncCallback callback, object state)
{
var marshaller = GetOperationsRequestMarshaller.Instance;
var unmarshaller = GetOperationsResponseUnmarshaller.Instance;
return BeginInvoke<GetOperationsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetOperations operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetOperations.</param>
///
/// <returns>Returns a GetOperationsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperations">REST API Reference for GetOperations Operation</seealso>
public virtual GetOperationsResponse EndGetOperations(IAsyncResult asyncResult)
{
return EndInvoke<GetOperationsResponse>(asyncResult);
}
#endregion
#region GetOperationsForResource
/// <summary>
/// Gets operations for a specific resource (e.g., an instance or a static IP).
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetOperationsForResource service method.</param>
///
/// <returns>The response from the GetOperationsForResource service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperationsForResource">REST API Reference for GetOperationsForResource Operation</seealso>
public virtual GetOperationsForResourceResponse GetOperationsForResource(GetOperationsForResourceRequest request)
{
var marshaller = GetOperationsForResourceRequestMarshaller.Instance;
var unmarshaller = GetOperationsForResourceResponseUnmarshaller.Instance;
return Invoke<GetOperationsForResourceRequest,GetOperationsForResourceResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetOperationsForResource operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetOperationsForResource operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetOperationsForResource
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperationsForResource">REST API Reference for GetOperationsForResource Operation</seealso>
public virtual IAsyncResult BeginGetOperationsForResource(GetOperationsForResourceRequest request, AsyncCallback callback, object state)
{
var marshaller = GetOperationsForResourceRequestMarshaller.Instance;
var unmarshaller = GetOperationsForResourceResponseUnmarshaller.Instance;
return BeginInvoke<GetOperationsForResourceRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetOperationsForResource operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetOperationsForResource.</param>
///
/// <returns>Returns a GetOperationsForResourceResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperationsForResource">REST API Reference for GetOperationsForResource Operation</seealso>
public virtual GetOperationsForResourceResponse EndGetOperationsForResource(IAsyncResult asyncResult)
{
return EndInvoke<GetOperationsForResourceResponse>(asyncResult);
}
#endregion
#region GetRegions
/// <summary>
/// Returns a list of all valid regions for Amazon Lightsail. Use the <code>include availability
/// zones</code> parameter to also return the Availability Zones in a region.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRegions service method.</param>
///
/// <returns>The response from the GetRegions service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRegions">REST API Reference for GetRegions Operation</seealso>
public virtual GetRegionsResponse GetRegions(GetRegionsRequest request)
{
var marshaller = GetRegionsRequestMarshaller.Instance;
var unmarshaller = GetRegionsResponseUnmarshaller.Instance;
return Invoke<GetRegionsRequest,GetRegionsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetRegions operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRegions operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRegions
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRegions">REST API Reference for GetRegions Operation</seealso>
public virtual IAsyncResult BeginGetRegions(GetRegionsRequest request, AsyncCallback callback, object state)
{
var marshaller = GetRegionsRequestMarshaller.Instance;
var unmarshaller = GetRegionsResponseUnmarshaller.Instance;
return BeginInvoke<GetRegionsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetRegions operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRegions.</param>
///
/// <returns>Returns a GetRegionsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRegions">REST API Reference for GetRegions Operation</seealso>
public virtual GetRegionsResponse EndGetRegions(IAsyncResult asyncResult)
{
return EndInvoke<GetRegionsResponse>(asyncResult);
}
#endregion
#region GetRelationalDatabase
/// <summary>
/// Returns information about a specific database in Amazon Lightsail.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabase service method.</param>
///
/// <returns>The response from the GetRelationalDatabase service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabase">REST API Reference for GetRelationalDatabase Operation</seealso>
public virtual GetRelationalDatabaseResponse GetRelationalDatabase(GetRelationalDatabaseRequest request)
{
var marshaller = GetRelationalDatabaseRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseResponseUnmarshaller.Instance;
return Invoke<GetRelationalDatabaseRequest,GetRelationalDatabaseResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetRelationalDatabase operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabase operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRelationalDatabase
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabase">REST API Reference for GetRelationalDatabase Operation</seealso>
public virtual IAsyncResult BeginGetRelationalDatabase(GetRelationalDatabaseRequest request, AsyncCallback callback, object state)
{
var marshaller = GetRelationalDatabaseRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseResponseUnmarshaller.Instance;
return BeginInvoke<GetRelationalDatabaseRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetRelationalDatabase operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRelationalDatabase.</param>
///
/// <returns>Returns a GetRelationalDatabaseResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabase">REST API Reference for GetRelationalDatabase Operation</seealso>
public virtual GetRelationalDatabaseResponse EndGetRelationalDatabase(IAsyncResult asyncResult)
{
return EndInvoke<GetRelationalDatabaseResponse>(asyncResult);
}
#endregion
#region GetRelationalDatabaseBlueprints
/// <summary>
/// Returns a list of available database blueprints in Amazon Lightsail. A blueprint describes
/// the major engine version of a database.
///
///
/// <para>
/// You can use a blueprint ID to create a new database that runs a specific database
/// engine.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseBlueprints service method.</param>
///
/// <returns>The response from the GetRelationalDatabaseBlueprints service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseBlueprints">REST API Reference for GetRelationalDatabaseBlueprints Operation</seealso>
public virtual GetRelationalDatabaseBlueprintsResponse GetRelationalDatabaseBlueprints(GetRelationalDatabaseBlueprintsRequest request)
{
var marshaller = GetRelationalDatabaseBlueprintsRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseBlueprintsResponseUnmarshaller.Instance;
return Invoke<GetRelationalDatabaseBlueprintsRequest,GetRelationalDatabaseBlueprintsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetRelationalDatabaseBlueprints operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseBlueprints operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRelationalDatabaseBlueprints
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseBlueprints">REST API Reference for GetRelationalDatabaseBlueprints Operation</seealso>
public virtual IAsyncResult BeginGetRelationalDatabaseBlueprints(GetRelationalDatabaseBlueprintsRequest request, AsyncCallback callback, object state)
{
var marshaller = GetRelationalDatabaseBlueprintsRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseBlueprintsResponseUnmarshaller.Instance;
return BeginInvoke<GetRelationalDatabaseBlueprintsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetRelationalDatabaseBlueprints operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRelationalDatabaseBlueprints.</param>
///
/// <returns>Returns a GetRelationalDatabaseBlueprintsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseBlueprints">REST API Reference for GetRelationalDatabaseBlueprints Operation</seealso>
public virtual GetRelationalDatabaseBlueprintsResponse EndGetRelationalDatabaseBlueprints(IAsyncResult asyncResult)
{
return EndInvoke<GetRelationalDatabaseBlueprintsResponse>(asyncResult);
}
#endregion
#region GetRelationalDatabaseBundles
/// <summary>
/// Returns the list of bundles that are available in Amazon Lightsail. A bundle describes
/// the performance specifications for a database.
///
///
/// <para>
/// You can use a bundle ID to create a new database with explicit performance specifications.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseBundles service method.</param>
///
/// <returns>The response from the GetRelationalDatabaseBundles service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseBundles">REST API Reference for GetRelationalDatabaseBundles Operation</seealso>
public virtual GetRelationalDatabaseBundlesResponse GetRelationalDatabaseBundles(GetRelationalDatabaseBundlesRequest request)
{
var marshaller = GetRelationalDatabaseBundlesRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseBundlesResponseUnmarshaller.Instance;
return Invoke<GetRelationalDatabaseBundlesRequest,GetRelationalDatabaseBundlesResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetRelationalDatabaseBundles operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseBundles operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRelationalDatabaseBundles
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseBundles">REST API Reference for GetRelationalDatabaseBundles Operation</seealso>
public virtual IAsyncResult BeginGetRelationalDatabaseBundles(GetRelationalDatabaseBundlesRequest request, AsyncCallback callback, object state)
{
var marshaller = GetRelationalDatabaseBundlesRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseBundlesResponseUnmarshaller.Instance;
return BeginInvoke<GetRelationalDatabaseBundlesRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetRelationalDatabaseBundles operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRelationalDatabaseBundles.</param>
///
/// <returns>Returns a GetRelationalDatabaseBundlesResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseBundles">REST API Reference for GetRelationalDatabaseBundles Operation</seealso>
public virtual GetRelationalDatabaseBundlesResponse EndGetRelationalDatabaseBundles(IAsyncResult asyncResult)
{
return EndInvoke<GetRelationalDatabaseBundlesResponse>(asyncResult);
}
#endregion
#region GetRelationalDatabaseEvents
/// <summary>
/// Returns a list of events for a specific database in Amazon Lightsail.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseEvents service method.</param>
///
/// <returns>The response from the GetRelationalDatabaseEvents service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseEvents">REST API Reference for GetRelationalDatabaseEvents Operation</seealso>
public virtual GetRelationalDatabaseEventsResponse GetRelationalDatabaseEvents(GetRelationalDatabaseEventsRequest request)
{
var marshaller = GetRelationalDatabaseEventsRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseEventsResponseUnmarshaller.Instance;
return Invoke<GetRelationalDatabaseEventsRequest,GetRelationalDatabaseEventsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetRelationalDatabaseEvents operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseEvents operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRelationalDatabaseEvents
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseEvents">REST API Reference for GetRelationalDatabaseEvents Operation</seealso>
public virtual IAsyncResult BeginGetRelationalDatabaseEvents(GetRelationalDatabaseEventsRequest request, AsyncCallback callback, object state)
{
var marshaller = GetRelationalDatabaseEventsRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseEventsResponseUnmarshaller.Instance;
return BeginInvoke<GetRelationalDatabaseEventsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetRelationalDatabaseEvents operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRelationalDatabaseEvents.</param>
///
/// <returns>Returns a GetRelationalDatabaseEventsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseEvents">REST API Reference for GetRelationalDatabaseEvents Operation</seealso>
public virtual GetRelationalDatabaseEventsResponse EndGetRelationalDatabaseEvents(IAsyncResult asyncResult)
{
return EndInvoke<GetRelationalDatabaseEventsResponse>(asyncResult);
}
#endregion
#region GetRelationalDatabaseLogEvents
/// <summary>
/// Returns a list of log events for a database in Amazon Lightsail.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseLogEvents service method.</param>
///
/// <returns>The response from the GetRelationalDatabaseLogEvents service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseLogEvents">REST API Reference for GetRelationalDatabaseLogEvents Operation</seealso>
public virtual GetRelationalDatabaseLogEventsResponse GetRelationalDatabaseLogEvents(GetRelationalDatabaseLogEventsRequest request)
{
var marshaller = GetRelationalDatabaseLogEventsRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseLogEventsResponseUnmarshaller.Instance;
return Invoke<GetRelationalDatabaseLogEventsRequest,GetRelationalDatabaseLogEventsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetRelationalDatabaseLogEvents operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseLogEvents operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRelationalDatabaseLogEvents
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseLogEvents">REST API Reference for GetRelationalDatabaseLogEvents Operation</seealso>
public virtual IAsyncResult BeginGetRelationalDatabaseLogEvents(GetRelationalDatabaseLogEventsRequest request, AsyncCallback callback, object state)
{
var marshaller = GetRelationalDatabaseLogEventsRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseLogEventsResponseUnmarshaller.Instance;
return BeginInvoke<GetRelationalDatabaseLogEventsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetRelationalDatabaseLogEvents operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRelationalDatabaseLogEvents.</param>
///
/// <returns>Returns a GetRelationalDatabaseLogEventsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseLogEvents">REST API Reference for GetRelationalDatabaseLogEvents Operation</seealso>
public virtual GetRelationalDatabaseLogEventsResponse EndGetRelationalDatabaseLogEvents(IAsyncResult asyncResult)
{
return EndInvoke<GetRelationalDatabaseLogEventsResponse>(asyncResult);
}
#endregion
#region GetRelationalDatabaseLogStreams
/// <summary>
/// Returns a list of available log streams for a specific database in Amazon Lightsail.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseLogStreams service method.</param>
///
/// <returns>The response from the GetRelationalDatabaseLogStreams service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseLogStreams">REST API Reference for GetRelationalDatabaseLogStreams Operation</seealso>
public virtual GetRelationalDatabaseLogStreamsResponse GetRelationalDatabaseLogStreams(GetRelationalDatabaseLogStreamsRequest request)
{
var marshaller = GetRelationalDatabaseLogStreamsRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseLogStreamsResponseUnmarshaller.Instance;
return Invoke<GetRelationalDatabaseLogStreamsRequest,GetRelationalDatabaseLogStreamsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetRelationalDatabaseLogStreams operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseLogStreams operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRelationalDatabaseLogStreams
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseLogStreams">REST API Reference for GetRelationalDatabaseLogStreams Operation</seealso>
public virtual IAsyncResult BeginGetRelationalDatabaseLogStreams(GetRelationalDatabaseLogStreamsRequest request, AsyncCallback callback, object state)
{
var marshaller = GetRelationalDatabaseLogStreamsRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseLogStreamsResponseUnmarshaller.Instance;
return BeginInvoke<GetRelationalDatabaseLogStreamsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetRelationalDatabaseLogStreams operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRelationalDatabaseLogStreams.</param>
///
/// <returns>Returns a GetRelationalDatabaseLogStreamsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseLogStreams">REST API Reference for GetRelationalDatabaseLogStreams Operation</seealso>
public virtual GetRelationalDatabaseLogStreamsResponse EndGetRelationalDatabaseLogStreams(IAsyncResult asyncResult)
{
return EndInvoke<GetRelationalDatabaseLogStreamsResponse>(asyncResult);
}
#endregion
#region GetRelationalDatabaseMasterUserPassword
/// <summary>
/// Returns the current, previous, or pending versions of the master user password for
/// a Lightsail database.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseMasterUserPassword service method.</param>
///
/// <returns>The response from the GetRelationalDatabaseMasterUserPassword service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseMasterUserPassword">REST API Reference for GetRelationalDatabaseMasterUserPassword Operation</seealso>
public virtual GetRelationalDatabaseMasterUserPasswordResponse GetRelationalDatabaseMasterUserPassword(GetRelationalDatabaseMasterUserPasswordRequest request)
{
var marshaller = GetRelationalDatabaseMasterUserPasswordRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseMasterUserPasswordResponseUnmarshaller.Instance;
return Invoke<GetRelationalDatabaseMasterUserPasswordRequest,GetRelationalDatabaseMasterUserPasswordResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetRelationalDatabaseMasterUserPassword operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseMasterUserPassword operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRelationalDatabaseMasterUserPassword
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseMasterUserPassword">REST API Reference for GetRelationalDatabaseMasterUserPassword Operation</seealso>
public virtual IAsyncResult BeginGetRelationalDatabaseMasterUserPassword(GetRelationalDatabaseMasterUserPasswordRequest request, AsyncCallback callback, object state)
{
var marshaller = GetRelationalDatabaseMasterUserPasswordRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseMasterUserPasswordResponseUnmarshaller.Instance;
return BeginInvoke<GetRelationalDatabaseMasterUserPasswordRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetRelationalDatabaseMasterUserPassword operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRelationalDatabaseMasterUserPassword.</param>
///
/// <returns>Returns a GetRelationalDatabaseMasterUserPasswordResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseMasterUserPassword">REST API Reference for GetRelationalDatabaseMasterUserPassword Operation</seealso>
public virtual GetRelationalDatabaseMasterUserPasswordResponse EndGetRelationalDatabaseMasterUserPassword(IAsyncResult asyncResult)
{
return EndInvoke<GetRelationalDatabaseMasterUserPasswordResponse>(asyncResult);
}
#endregion
#region GetRelationalDatabaseMetricData
/// <summary>
/// Returns the data points of the specified metric for a database in Amazon Lightsail.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseMetricData service method.</param>
///
/// <returns>The response from the GetRelationalDatabaseMetricData service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseMetricData">REST API Reference for GetRelationalDatabaseMetricData Operation</seealso>
public virtual GetRelationalDatabaseMetricDataResponse GetRelationalDatabaseMetricData(GetRelationalDatabaseMetricDataRequest request)
{
var marshaller = GetRelationalDatabaseMetricDataRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseMetricDataResponseUnmarshaller.Instance;
return Invoke<GetRelationalDatabaseMetricDataRequest,GetRelationalDatabaseMetricDataResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetRelationalDatabaseMetricData operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseMetricData operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRelationalDatabaseMetricData
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseMetricData">REST API Reference for GetRelationalDatabaseMetricData Operation</seealso>
public virtual IAsyncResult BeginGetRelationalDatabaseMetricData(GetRelationalDatabaseMetricDataRequest request, AsyncCallback callback, object state)
{
var marshaller = GetRelationalDatabaseMetricDataRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseMetricDataResponseUnmarshaller.Instance;
return BeginInvoke<GetRelationalDatabaseMetricDataRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetRelationalDatabaseMetricData operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRelationalDatabaseMetricData.</param>
///
/// <returns>Returns a GetRelationalDatabaseMetricDataResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseMetricData">REST API Reference for GetRelationalDatabaseMetricData Operation</seealso>
public virtual GetRelationalDatabaseMetricDataResponse EndGetRelationalDatabaseMetricData(IAsyncResult asyncResult)
{
return EndInvoke<GetRelationalDatabaseMetricDataResponse>(asyncResult);
}
#endregion
#region GetRelationalDatabaseParameters
/// <summary>
/// Returns all of the runtime parameters offered by the underlying database software,
/// or engine, for a specific database in Amazon Lightsail.
///
///
/// <para>
/// In addition to the parameter names and values, this operation returns other information
/// about each parameter. This information includes whether changes require a reboot,
/// whether the parameter is modifiable, the allowed values, and the data types.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseParameters service method.</param>
///
/// <returns>The response from the GetRelationalDatabaseParameters service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseParameters">REST API Reference for GetRelationalDatabaseParameters Operation</seealso>
public virtual GetRelationalDatabaseParametersResponse GetRelationalDatabaseParameters(GetRelationalDatabaseParametersRequest request)
{
var marshaller = GetRelationalDatabaseParametersRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseParametersResponseUnmarshaller.Instance;
return Invoke<GetRelationalDatabaseParametersRequest,GetRelationalDatabaseParametersResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetRelationalDatabaseParameters operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseParameters operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRelationalDatabaseParameters
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseParameters">REST API Reference for GetRelationalDatabaseParameters Operation</seealso>
public virtual IAsyncResult BeginGetRelationalDatabaseParameters(GetRelationalDatabaseParametersRequest request, AsyncCallback callback, object state)
{
var marshaller = GetRelationalDatabaseParametersRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseParametersResponseUnmarshaller.Instance;
return BeginInvoke<GetRelationalDatabaseParametersRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetRelationalDatabaseParameters operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRelationalDatabaseParameters.</param>
///
/// <returns>Returns a GetRelationalDatabaseParametersResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseParameters">REST API Reference for GetRelationalDatabaseParameters Operation</seealso>
public virtual GetRelationalDatabaseParametersResponse EndGetRelationalDatabaseParameters(IAsyncResult asyncResult)
{
return EndInvoke<GetRelationalDatabaseParametersResponse>(asyncResult);
}
#endregion
#region GetRelationalDatabases
/// <summary>
/// Returns information about all of your databases in Amazon Lightsail.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabases service method.</param>
///
/// <returns>The response from the GetRelationalDatabases service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabases">REST API Reference for GetRelationalDatabases Operation</seealso>
public virtual GetRelationalDatabasesResponse GetRelationalDatabases(GetRelationalDatabasesRequest request)
{
var marshaller = GetRelationalDatabasesRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabasesResponseUnmarshaller.Instance;
return Invoke<GetRelationalDatabasesRequest,GetRelationalDatabasesResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetRelationalDatabases operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabases operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRelationalDatabases
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabases">REST API Reference for GetRelationalDatabases Operation</seealso>
public virtual IAsyncResult BeginGetRelationalDatabases(GetRelationalDatabasesRequest request, AsyncCallback callback, object state)
{
var marshaller = GetRelationalDatabasesRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabasesResponseUnmarshaller.Instance;
return BeginInvoke<GetRelationalDatabasesRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetRelationalDatabases operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRelationalDatabases.</param>
///
/// <returns>Returns a GetRelationalDatabasesResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabases">REST API Reference for GetRelationalDatabases Operation</seealso>
public virtual GetRelationalDatabasesResponse EndGetRelationalDatabases(IAsyncResult asyncResult)
{
return EndInvoke<GetRelationalDatabasesResponse>(asyncResult);
}
#endregion
#region GetRelationalDatabaseSnapshot
/// <summary>
/// Returns information about a specific database snapshot in Amazon Lightsail.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseSnapshot service method.</param>
///
/// <returns>The response from the GetRelationalDatabaseSnapshot service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseSnapshot">REST API Reference for GetRelationalDatabaseSnapshot Operation</seealso>
public virtual GetRelationalDatabaseSnapshotResponse GetRelationalDatabaseSnapshot(GetRelationalDatabaseSnapshotRequest request)
{
var marshaller = GetRelationalDatabaseSnapshotRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseSnapshotResponseUnmarshaller.Instance;
return Invoke<GetRelationalDatabaseSnapshotRequest,GetRelationalDatabaseSnapshotResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetRelationalDatabaseSnapshot operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseSnapshot operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRelationalDatabaseSnapshot
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseSnapshot">REST API Reference for GetRelationalDatabaseSnapshot Operation</seealso>
public virtual IAsyncResult BeginGetRelationalDatabaseSnapshot(GetRelationalDatabaseSnapshotRequest request, AsyncCallback callback, object state)
{
var marshaller = GetRelationalDatabaseSnapshotRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseSnapshotResponseUnmarshaller.Instance;
return BeginInvoke<GetRelationalDatabaseSnapshotRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetRelationalDatabaseSnapshot operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRelationalDatabaseSnapshot.</param>
///
/// <returns>Returns a GetRelationalDatabaseSnapshotResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseSnapshot">REST API Reference for GetRelationalDatabaseSnapshot Operation</seealso>
public virtual GetRelationalDatabaseSnapshotResponse EndGetRelationalDatabaseSnapshot(IAsyncResult asyncResult)
{
return EndInvoke<GetRelationalDatabaseSnapshotResponse>(asyncResult);
}
#endregion
#region GetRelationalDatabaseSnapshots
/// <summary>
/// Returns information about all of your database snapshots in Amazon Lightsail.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseSnapshots service method.</param>
///
/// <returns>The response from the GetRelationalDatabaseSnapshots service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseSnapshots">REST API Reference for GetRelationalDatabaseSnapshots Operation</seealso>
public virtual GetRelationalDatabaseSnapshotsResponse GetRelationalDatabaseSnapshots(GetRelationalDatabaseSnapshotsRequest request)
{
var marshaller = GetRelationalDatabaseSnapshotsRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseSnapshotsResponseUnmarshaller.Instance;
return Invoke<GetRelationalDatabaseSnapshotsRequest,GetRelationalDatabaseSnapshotsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetRelationalDatabaseSnapshots operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRelationalDatabaseSnapshots operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRelationalDatabaseSnapshots
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseSnapshots">REST API Reference for GetRelationalDatabaseSnapshots Operation</seealso>
public virtual IAsyncResult BeginGetRelationalDatabaseSnapshots(GetRelationalDatabaseSnapshotsRequest request, AsyncCallback callback, object state)
{
var marshaller = GetRelationalDatabaseSnapshotsRequestMarshaller.Instance;
var unmarshaller = GetRelationalDatabaseSnapshotsResponseUnmarshaller.Instance;
return BeginInvoke<GetRelationalDatabaseSnapshotsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetRelationalDatabaseSnapshots operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRelationalDatabaseSnapshots.</param>
///
/// <returns>Returns a GetRelationalDatabaseSnapshotsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseSnapshots">REST API Reference for GetRelationalDatabaseSnapshots Operation</seealso>
public virtual GetRelationalDatabaseSnapshotsResponse EndGetRelationalDatabaseSnapshots(IAsyncResult asyncResult)
{
return EndInvoke<GetRelationalDatabaseSnapshotsResponse>(asyncResult);
}
#endregion
#region GetStaticIp
/// <summary>
/// Returns information about a specific static IP.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetStaticIp service method.</param>
///
/// <returns>The response from the GetStaticIp service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIp">REST API Reference for GetStaticIp Operation</seealso>
public virtual GetStaticIpResponse GetStaticIp(GetStaticIpRequest request)
{
var marshaller = GetStaticIpRequestMarshaller.Instance;
var unmarshaller = GetStaticIpResponseUnmarshaller.Instance;
return Invoke<GetStaticIpRequest,GetStaticIpResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetStaticIp operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetStaticIp operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetStaticIp
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIp">REST API Reference for GetStaticIp Operation</seealso>
public virtual IAsyncResult BeginGetStaticIp(GetStaticIpRequest request, AsyncCallback callback, object state)
{
var marshaller = GetStaticIpRequestMarshaller.Instance;
var unmarshaller = GetStaticIpResponseUnmarshaller.Instance;
return BeginInvoke<GetStaticIpRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetStaticIp operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetStaticIp.</param>
///
/// <returns>Returns a GetStaticIpResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIp">REST API Reference for GetStaticIp Operation</seealso>
public virtual GetStaticIpResponse EndGetStaticIp(IAsyncResult asyncResult)
{
return EndInvoke<GetStaticIpResponse>(asyncResult);
}
#endregion
#region GetStaticIps
/// <summary>
/// Returns information about all static IPs in the user's account.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetStaticIps service method.</param>
///
/// <returns>The response from the GetStaticIps service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIps">REST API Reference for GetStaticIps Operation</seealso>
public virtual GetStaticIpsResponse GetStaticIps(GetStaticIpsRequest request)
{
var marshaller = GetStaticIpsRequestMarshaller.Instance;
var unmarshaller = GetStaticIpsResponseUnmarshaller.Instance;
return Invoke<GetStaticIpsRequest,GetStaticIpsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the GetStaticIps operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetStaticIps operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetStaticIps
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIps">REST API Reference for GetStaticIps Operation</seealso>
public virtual IAsyncResult BeginGetStaticIps(GetStaticIpsRequest request, AsyncCallback callback, object state)
{
var marshaller = GetStaticIpsRequestMarshaller.Instance;
var unmarshaller = GetStaticIpsResponseUnmarshaller.Instance;
return BeginInvoke<GetStaticIpsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetStaticIps operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetStaticIps.</param>
///
/// <returns>Returns a GetStaticIpsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIps">REST API Reference for GetStaticIps Operation</seealso>
public virtual GetStaticIpsResponse EndGetStaticIps(IAsyncResult asyncResult)
{
return EndInvoke<GetStaticIpsResponse>(asyncResult);
}
#endregion
#region ImportKeyPair
/// <summary>
/// Imports a public SSH key from a specific key pair.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ImportKeyPair service method.</param>
///
/// <returns>The response from the ImportKeyPair service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ImportKeyPair">REST API Reference for ImportKeyPair Operation</seealso>
public virtual ImportKeyPairResponse ImportKeyPair(ImportKeyPairRequest request)
{
var marshaller = ImportKeyPairRequestMarshaller.Instance;
var unmarshaller = ImportKeyPairResponseUnmarshaller.Instance;
return Invoke<ImportKeyPairRequest,ImportKeyPairResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the ImportKeyPair operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ImportKeyPair operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndImportKeyPair
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ImportKeyPair">REST API Reference for ImportKeyPair Operation</seealso>
public virtual IAsyncResult BeginImportKeyPair(ImportKeyPairRequest request, AsyncCallback callback, object state)
{
var marshaller = ImportKeyPairRequestMarshaller.Instance;
var unmarshaller = ImportKeyPairResponseUnmarshaller.Instance;
return BeginInvoke<ImportKeyPairRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ImportKeyPair operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginImportKeyPair.</param>
///
/// <returns>Returns a ImportKeyPairResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ImportKeyPair">REST API Reference for ImportKeyPair Operation</seealso>
public virtual ImportKeyPairResponse EndImportKeyPair(IAsyncResult asyncResult)
{
return EndInvoke<ImportKeyPairResponse>(asyncResult);
}
#endregion
#region IsVpcPeered
/// <summary>
/// Returns a Boolean value indicating whether your Lightsail VPC is peered.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the IsVpcPeered service method.</param>
///
/// <returns>The response from the IsVpcPeered service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/IsVpcPeered">REST API Reference for IsVpcPeered Operation</seealso>
public virtual IsVpcPeeredResponse IsVpcPeered(IsVpcPeeredRequest request)
{
var marshaller = IsVpcPeeredRequestMarshaller.Instance;
var unmarshaller = IsVpcPeeredResponseUnmarshaller.Instance;
return Invoke<IsVpcPeeredRequest,IsVpcPeeredResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the IsVpcPeered operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the IsVpcPeered operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndIsVpcPeered
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/IsVpcPeered">REST API Reference for IsVpcPeered Operation</seealso>
public virtual IAsyncResult BeginIsVpcPeered(IsVpcPeeredRequest request, AsyncCallback callback, object state)
{
var marshaller = IsVpcPeeredRequestMarshaller.Instance;
var unmarshaller = IsVpcPeeredResponseUnmarshaller.Instance;
return BeginInvoke<IsVpcPeeredRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the IsVpcPeered operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginIsVpcPeered.</param>
///
/// <returns>Returns a IsVpcPeeredResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/IsVpcPeered">REST API Reference for IsVpcPeered Operation</seealso>
public virtual IsVpcPeeredResponse EndIsVpcPeered(IAsyncResult asyncResult)
{
return EndInvoke<IsVpcPeeredResponse>(asyncResult);
}
#endregion
#region OpenInstancePublicPorts
/// <summary>
/// Adds public ports to an Amazon Lightsail instance.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the OpenInstancePublicPorts service method.</param>
///
/// <returns>The response from the OpenInstancePublicPorts service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/OpenInstancePublicPorts">REST API Reference for OpenInstancePublicPorts Operation</seealso>
public virtual OpenInstancePublicPortsResponse OpenInstancePublicPorts(OpenInstancePublicPortsRequest request)
{
var marshaller = OpenInstancePublicPortsRequestMarshaller.Instance;
var unmarshaller = OpenInstancePublicPortsResponseUnmarshaller.Instance;
return Invoke<OpenInstancePublicPortsRequest,OpenInstancePublicPortsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the OpenInstancePublicPorts operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the OpenInstancePublicPorts operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndOpenInstancePublicPorts
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/OpenInstancePublicPorts">REST API Reference for OpenInstancePublicPorts Operation</seealso>
public virtual IAsyncResult BeginOpenInstancePublicPorts(OpenInstancePublicPortsRequest request, AsyncCallback callback, object state)
{
var marshaller = OpenInstancePublicPortsRequestMarshaller.Instance;
var unmarshaller = OpenInstancePublicPortsResponseUnmarshaller.Instance;
return BeginInvoke<OpenInstancePublicPortsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the OpenInstancePublicPorts operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginOpenInstancePublicPorts.</param>
///
/// <returns>Returns a OpenInstancePublicPortsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/OpenInstancePublicPorts">REST API Reference for OpenInstancePublicPorts Operation</seealso>
public virtual OpenInstancePublicPortsResponse EndOpenInstancePublicPorts(IAsyncResult asyncResult)
{
return EndInvoke<OpenInstancePublicPortsResponse>(asyncResult);
}
#endregion
#region PeerVpc
/// <summary>
/// Tries to peer the Lightsail VPC with the user's default VPC.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the PeerVpc service method.</param>
///
/// <returns>The response from the PeerVpc service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PeerVpc">REST API Reference for PeerVpc Operation</seealso>
public virtual PeerVpcResponse PeerVpc(PeerVpcRequest request)
{
var marshaller = PeerVpcRequestMarshaller.Instance;
var unmarshaller = PeerVpcResponseUnmarshaller.Instance;
return Invoke<PeerVpcRequest,PeerVpcResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the PeerVpc operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the PeerVpc operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndPeerVpc
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PeerVpc">REST API Reference for PeerVpc Operation</seealso>
public virtual IAsyncResult BeginPeerVpc(PeerVpcRequest request, AsyncCallback callback, object state)
{
var marshaller = PeerVpcRequestMarshaller.Instance;
var unmarshaller = PeerVpcResponseUnmarshaller.Instance;
return BeginInvoke<PeerVpcRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the PeerVpc operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginPeerVpc.</param>
///
/// <returns>Returns a PeerVpcResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PeerVpc">REST API Reference for PeerVpc Operation</seealso>
public virtual PeerVpcResponse EndPeerVpc(IAsyncResult asyncResult)
{
return EndInvoke<PeerVpcResponse>(asyncResult);
}
#endregion
#region PutInstancePublicPorts
/// <summary>
/// Sets the specified open ports for an Amazon Lightsail instance, and closes all ports
/// for every protocol not included in the current request.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the PutInstancePublicPorts service method.</param>
///
/// <returns>The response from the PutInstancePublicPorts service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PutInstancePublicPorts">REST API Reference for PutInstancePublicPorts Operation</seealso>
public virtual PutInstancePublicPortsResponse PutInstancePublicPorts(PutInstancePublicPortsRequest request)
{
var marshaller = PutInstancePublicPortsRequestMarshaller.Instance;
var unmarshaller = PutInstancePublicPortsResponseUnmarshaller.Instance;
return Invoke<PutInstancePublicPortsRequest,PutInstancePublicPortsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the PutInstancePublicPorts operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the PutInstancePublicPorts operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndPutInstancePublicPorts
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PutInstancePublicPorts">REST API Reference for PutInstancePublicPorts Operation</seealso>
public virtual IAsyncResult BeginPutInstancePublicPorts(PutInstancePublicPortsRequest request, AsyncCallback callback, object state)
{
var marshaller = PutInstancePublicPortsRequestMarshaller.Instance;
var unmarshaller = PutInstancePublicPortsResponseUnmarshaller.Instance;
return BeginInvoke<PutInstancePublicPortsRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the PutInstancePublicPorts operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginPutInstancePublicPorts.</param>
///
/// <returns>Returns a PutInstancePublicPortsResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PutInstancePublicPorts">REST API Reference for PutInstancePublicPorts Operation</seealso>
public virtual PutInstancePublicPortsResponse EndPutInstancePublicPorts(IAsyncResult asyncResult)
{
return EndInvoke<PutInstancePublicPortsResponse>(asyncResult);
}
#endregion
#region RebootInstance
/// <summary>
/// Restarts a specific instance. When your Amazon Lightsail instance is finished rebooting,
/// Lightsail assigns a new public IP address. To use the same IP address after restarting,
/// create a static IP address and attach it to the instance.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the RebootInstance service method.</param>
///
/// <returns>The response from the RebootInstance service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootInstance">REST API Reference for RebootInstance Operation</seealso>
public virtual RebootInstanceResponse RebootInstance(RebootInstanceRequest request)
{
var marshaller = RebootInstanceRequestMarshaller.Instance;
var unmarshaller = RebootInstanceResponseUnmarshaller.Instance;
return Invoke<RebootInstanceRequest,RebootInstanceResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the RebootInstance operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the RebootInstance operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndRebootInstance
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootInstance">REST API Reference for RebootInstance Operation</seealso>
public virtual IAsyncResult BeginRebootInstance(RebootInstanceRequest request, AsyncCallback callback, object state)
{
var marshaller = RebootInstanceRequestMarshaller.Instance;
var unmarshaller = RebootInstanceResponseUnmarshaller.Instance;
return BeginInvoke<RebootInstanceRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the RebootInstance operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginRebootInstance.</param>
///
/// <returns>Returns a RebootInstanceResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootInstance">REST API Reference for RebootInstance Operation</seealso>
public virtual RebootInstanceResponse EndRebootInstance(IAsyncResult asyncResult)
{
return EndInvoke<RebootInstanceResponse>(asyncResult);
}
#endregion
#region RebootRelationalDatabase
/// <summary>
/// Restarts a specific database in Amazon Lightsail.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the RebootRelationalDatabase service method.</param>
///
/// <returns>The response from the RebootRelationalDatabase service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootRelationalDatabase">REST API Reference for RebootRelationalDatabase Operation</seealso>
public virtual RebootRelationalDatabaseResponse RebootRelationalDatabase(RebootRelationalDatabaseRequest request)
{
var marshaller = RebootRelationalDatabaseRequestMarshaller.Instance;
var unmarshaller = RebootRelationalDatabaseResponseUnmarshaller.Instance;
return Invoke<RebootRelationalDatabaseRequest,RebootRelationalDatabaseResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the RebootRelationalDatabase operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the RebootRelationalDatabase operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndRebootRelationalDatabase
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootRelationalDatabase">REST API Reference for RebootRelationalDatabase Operation</seealso>
public virtual IAsyncResult BeginRebootRelationalDatabase(RebootRelationalDatabaseRequest request, AsyncCallback callback, object state)
{
var marshaller = RebootRelationalDatabaseRequestMarshaller.Instance;
var unmarshaller = RebootRelationalDatabaseResponseUnmarshaller.Instance;
return BeginInvoke<RebootRelationalDatabaseRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the RebootRelationalDatabase operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginRebootRelationalDatabase.</param>
///
/// <returns>Returns a RebootRelationalDatabaseResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootRelationalDatabase">REST API Reference for RebootRelationalDatabase Operation</seealso>
public virtual RebootRelationalDatabaseResponse EndRebootRelationalDatabase(IAsyncResult asyncResult)
{
return EndInvoke<RebootRelationalDatabaseResponse>(asyncResult);
}
#endregion
#region ReleaseStaticIp
/// <summary>
/// Deletes a specific static IP from your account.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ReleaseStaticIp service method.</param>
///
/// <returns>The response from the ReleaseStaticIp service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ReleaseStaticIp">REST API Reference for ReleaseStaticIp Operation</seealso>
public virtual ReleaseStaticIpResponse ReleaseStaticIp(ReleaseStaticIpRequest request)
{
var marshaller = ReleaseStaticIpRequestMarshaller.Instance;
var unmarshaller = ReleaseStaticIpResponseUnmarshaller.Instance;
return Invoke<ReleaseStaticIpRequest,ReleaseStaticIpResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the ReleaseStaticIp operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ReleaseStaticIp operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndReleaseStaticIp
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ReleaseStaticIp">REST API Reference for ReleaseStaticIp Operation</seealso>
public virtual IAsyncResult BeginReleaseStaticIp(ReleaseStaticIpRequest request, AsyncCallback callback, object state)
{
var marshaller = ReleaseStaticIpRequestMarshaller.Instance;
var unmarshaller = ReleaseStaticIpResponseUnmarshaller.Instance;
return BeginInvoke<ReleaseStaticIpRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ReleaseStaticIp operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginReleaseStaticIp.</param>
///
/// <returns>Returns a ReleaseStaticIpResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ReleaseStaticIp">REST API Reference for ReleaseStaticIp Operation</seealso>
public virtual ReleaseStaticIpResponse EndReleaseStaticIp(IAsyncResult asyncResult)
{
return EndInvoke<ReleaseStaticIpResponse>(asyncResult);
}
#endregion
#region StartInstance
/// <summary>
/// Starts a specific Amazon Lightsail instance from a stopped state. To restart an instance,
/// use the reboot instance operation.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the StartInstance service method.</param>
///
/// <returns>The response from the StartInstance service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartInstance">REST API Reference for StartInstance Operation</seealso>
public virtual StartInstanceResponse StartInstance(StartInstanceRequest request)
{
var marshaller = StartInstanceRequestMarshaller.Instance;
var unmarshaller = StartInstanceResponseUnmarshaller.Instance;
return Invoke<StartInstanceRequest,StartInstanceResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the StartInstance operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the StartInstance operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStartInstance
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartInstance">REST API Reference for StartInstance Operation</seealso>
public virtual IAsyncResult BeginStartInstance(StartInstanceRequest request, AsyncCallback callback, object state)
{
var marshaller = StartInstanceRequestMarshaller.Instance;
var unmarshaller = StartInstanceResponseUnmarshaller.Instance;
return BeginInvoke<StartInstanceRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the StartInstance operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginStartInstance.</param>
///
/// <returns>Returns a StartInstanceResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartInstance">REST API Reference for StartInstance Operation</seealso>
public virtual StartInstanceResponse EndStartInstance(IAsyncResult asyncResult)
{
return EndInvoke<StartInstanceResponse>(asyncResult);
}
#endregion
#region StartRelationalDatabase
/// <summary>
/// Starts a specific database from a stopped state in Amazon Lightsail. To restart a
/// database, use the <code>reboot relational database</code> operation.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the StartRelationalDatabase service method.</param>
///
/// <returns>The response from the StartRelationalDatabase service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartRelationalDatabase">REST API Reference for StartRelationalDatabase Operation</seealso>
public virtual StartRelationalDatabaseResponse StartRelationalDatabase(StartRelationalDatabaseRequest request)
{
var marshaller = StartRelationalDatabaseRequestMarshaller.Instance;
var unmarshaller = StartRelationalDatabaseResponseUnmarshaller.Instance;
return Invoke<StartRelationalDatabaseRequest,StartRelationalDatabaseResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the StartRelationalDatabase operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the StartRelationalDatabase operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStartRelationalDatabase
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartRelationalDatabase">REST API Reference for StartRelationalDatabase Operation</seealso>
public virtual IAsyncResult BeginStartRelationalDatabase(StartRelationalDatabaseRequest request, AsyncCallback callback, object state)
{
var marshaller = StartRelationalDatabaseRequestMarshaller.Instance;
var unmarshaller = StartRelationalDatabaseResponseUnmarshaller.Instance;
return BeginInvoke<StartRelationalDatabaseRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the StartRelationalDatabase operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginStartRelationalDatabase.</param>
///
/// <returns>Returns a StartRelationalDatabaseResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartRelationalDatabase">REST API Reference for StartRelationalDatabase Operation</seealso>
public virtual StartRelationalDatabaseResponse EndStartRelationalDatabase(IAsyncResult asyncResult)
{
return EndInvoke<StartRelationalDatabaseResponse>(asyncResult);
}
#endregion
#region StopInstance
/// <summary>
/// Stops a specific Amazon Lightsail instance that is currently running.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the StopInstance service method.</param>
///
/// <returns>The response from the StopInstance service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopInstance">REST API Reference for StopInstance Operation</seealso>
public virtual StopInstanceResponse StopInstance(StopInstanceRequest request)
{
var marshaller = StopInstanceRequestMarshaller.Instance;
var unmarshaller = StopInstanceResponseUnmarshaller.Instance;
return Invoke<StopInstanceRequest,StopInstanceResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the StopInstance operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the StopInstance operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStopInstance
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopInstance">REST API Reference for StopInstance Operation</seealso>
public virtual IAsyncResult BeginStopInstance(StopInstanceRequest request, AsyncCallback callback, object state)
{
var marshaller = StopInstanceRequestMarshaller.Instance;
var unmarshaller = StopInstanceResponseUnmarshaller.Instance;
return BeginInvoke<StopInstanceRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the StopInstance operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginStopInstance.</param>
///
/// <returns>Returns a StopInstanceResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopInstance">REST API Reference for StopInstance Operation</seealso>
public virtual StopInstanceResponse EndStopInstance(IAsyncResult asyncResult)
{
return EndInvoke<StopInstanceResponse>(asyncResult);
}
#endregion
#region StopRelationalDatabase
/// <summary>
/// Stops a specific database that is currently running in Amazon Lightsail.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the StopRelationalDatabase service method.</param>
///
/// <returns>The response from the StopRelationalDatabase service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopRelationalDatabase">REST API Reference for StopRelationalDatabase Operation</seealso>
public virtual StopRelationalDatabaseResponse StopRelationalDatabase(StopRelationalDatabaseRequest request)
{
var marshaller = StopRelationalDatabaseRequestMarshaller.Instance;
var unmarshaller = StopRelationalDatabaseResponseUnmarshaller.Instance;
return Invoke<StopRelationalDatabaseRequest,StopRelationalDatabaseResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the StopRelationalDatabase operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the StopRelationalDatabase operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStopRelationalDatabase
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopRelationalDatabase">REST API Reference for StopRelationalDatabase Operation</seealso>
public virtual IAsyncResult BeginStopRelationalDatabase(StopRelationalDatabaseRequest request, AsyncCallback callback, object state)
{
var marshaller = StopRelationalDatabaseRequestMarshaller.Instance;
var unmarshaller = StopRelationalDatabaseResponseUnmarshaller.Instance;
return BeginInvoke<StopRelationalDatabaseRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the StopRelationalDatabase operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginStopRelationalDatabase.</param>
///
/// <returns>Returns a StopRelationalDatabaseResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopRelationalDatabase">REST API Reference for StopRelationalDatabase Operation</seealso>
public virtual StopRelationalDatabaseResponse EndStopRelationalDatabase(IAsyncResult asyncResult)
{
return EndInvoke<StopRelationalDatabaseResponse>(asyncResult);
}
#endregion
#region UnpeerVpc
/// <summary>
/// Attempts to unpeer the Lightsail VPC from the user's default VPC.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UnpeerVpc service method.</param>
///
/// <returns>The response from the UnpeerVpc service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UnpeerVpc">REST API Reference for UnpeerVpc Operation</seealso>
public virtual UnpeerVpcResponse UnpeerVpc(UnpeerVpcRequest request)
{
var marshaller = UnpeerVpcRequestMarshaller.Instance;
var unmarshaller = UnpeerVpcResponseUnmarshaller.Instance;
return Invoke<UnpeerVpcRequest,UnpeerVpcResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the UnpeerVpc operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UnpeerVpc operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUnpeerVpc
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UnpeerVpc">REST API Reference for UnpeerVpc Operation</seealso>
public virtual IAsyncResult BeginUnpeerVpc(UnpeerVpcRequest request, AsyncCallback callback, object state)
{
var marshaller = UnpeerVpcRequestMarshaller.Instance;
var unmarshaller = UnpeerVpcResponseUnmarshaller.Instance;
return BeginInvoke<UnpeerVpcRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UnpeerVpc operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUnpeerVpc.</param>
///
/// <returns>Returns a UnpeerVpcResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UnpeerVpc">REST API Reference for UnpeerVpc Operation</seealso>
public virtual UnpeerVpcResponse EndUnpeerVpc(IAsyncResult asyncResult)
{
return EndInvoke<UnpeerVpcResponse>(asyncResult);
}
#endregion
#region UpdateDomainEntry
/// <summary>
/// Updates a domain recordset after it is created.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateDomainEntry service method.</param>
///
/// <returns>The response from the UpdateDomainEntry service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateDomainEntry">REST API Reference for UpdateDomainEntry Operation</seealso>
public virtual UpdateDomainEntryResponse UpdateDomainEntry(UpdateDomainEntryRequest request)
{
var marshaller = UpdateDomainEntryRequestMarshaller.Instance;
var unmarshaller = UpdateDomainEntryResponseUnmarshaller.Instance;
return Invoke<UpdateDomainEntryRequest,UpdateDomainEntryResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the UpdateDomainEntry operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateDomainEntry operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateDomainEntry
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateDomainEntry">REST API Reference for UpdateDomainEntry Operation</seealso>
public virtual IAsyncResult BeginUpdateDomainEntry(UpdateDomainEntryRequest request, AsyncCallback callback, object state)
{
var marshaller = UpdateDomainEntryRequestMarshaller.Instance;
var unmarshaller = UpdateDomainEntryResponseUnmarshaller.Instance;
return BeginInvoke<UpdateDomainEntryRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UpdateDomainEntry operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateDomainEntry.</param>
///
/// <returns>Returns a UpdateDomainEntryResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateDomainEntry">REST API Reference for UpdateDomainEntry Operation</seealso>
public virtual UpdateDomainEntryResponse EndUpdateDomainEntry(IAsyncResult asyncResult)
{
return EndInvoke<UpdateDomainEntryResponse>(asyncResult);
}
#endregion
#region UpdateLoadBalancerAttribute
/// <summary>
/// Updates the specified attribute for a load balancer. You can only update one attribute
/// at a time.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateLoadBalancerAttribute service method.</param>
///
/// <returns>The response from the UpdateLoadBalancerAttribute service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateLoadBalancerAttribute">REST API Reference for UpdateLoadBalancerAttribute Operation</seealso>
public virtual UpdateLoadBalancerAttributeResponse UpdateLoadBalancerAttribute(UpdateLoadBalancerAttributeRequest request)
{
var marshaller = UpdateLoadBalancerAttributeRequestMarshaller.Instance;
var unmarshaller = UpdateLoadBalancerAttributeResponseUnmarshaller.Instance;
return Invoke<UpdateLoadBalancerAttributeRequest,UpdateLoadBalancerAttributeResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the UpdateLoadBalancerAttribute operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateLoadBalancerAttribute operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateLoadBalancerAttribute
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateLoadBalancerAttribute">REST API Reference for UpdateLoadBalancerAttribute Operation</seealso>
public virtual IAsyncResult BeginUpdateLoadBalancerAttribute(UpdateLoadBalancerAttributeRequest request, AsyncCallback callback, object state)
{
var marshaller = UpdateLoadBalancerAttributeRequestMarshaller.Instance;
var unmarshaller = UpdateLoadBalancerAttributeResponseUnmarshaller.Instance;
return BeginInvoke<UpdateLoadBalancerAttributeRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UpdateLoadBalancerAttribute operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateLoadBalancerAttribute.</param>
///
/// <returns>Returns a UpdateLoadBalancerAttributeResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateLoadBalancerAttribute">REST API Reference for UpdateLoadBalancerAttribute Operation</seealso>
public virtual UpdateLoadBalancerAttributeResponse EndUpdateLoadBalancerAttribute(IAsyncResult asyncResult)
{
return EndInvoke<UpdateLoadBalancerAttributeResponse>(asyncResult);
}
#endregion
#region UpdateRelationalDatabase
/// <summary>
/// Allows the update of one or more attributes of a database in Amazon Lightsail.
///
///
/// <para>
/// Updates are applied immediately, or in cases where the updates could result in an
/// outage, are applied during the database's predefined maintenance window.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateRelationalDatabase service method.</param>
///
/// <returns>The response from the UpdateRelationalDatabase service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateRelationalDatabase">REST API Reference for UpdateRelationalDatabase Operation</seealso>
public virtual UpdateRelationalDatabaseResponse UpdateRelationalDatabase(UpdateRelationalDatabaseRequest request)
{
var marshaller = UpdateRelationalDatabaseRequestMarshaller.Instance;
var unmarshaller = UpdateRelationalDatabaseResponseUnmarshaller.Instance;
return Invoke<UpdateRelationalDatabaseRequest,UpdateRelationalDatabaseResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the UpdateRelationalDatabase operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateRelationalDatabase operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateRelationalDatabase
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateRelationalDatabase">REST API Reference for UpdateRelationalDatabase Operation</seealso>
public virtual IAsyncResult BeginUpdateRelationalDatabase(UpdateRelationalDatabaseRequest request, AsyncCallback callback, object state)
{
var marshaller = UpdateRelationalDatabaseRequestMarshaller.Instance;
var unmarshaller = UpdateRelationalDatabaseResponseUnmarshaller.Instance;
return BeginInvoke<UpdateRelationalDatabaseRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UpdateRelationalDatabase operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateRelationalDatabase.</param>
///
/// <returns>Returns a UpdateRelationalDatabaseResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateRelationalDatabase">REST API Reference for UpdateRelationalDatabase Operation</seealso>
public virtual UpdateRelationalDatabaseResponse EndUpdateRelationalDatabase(IAsyncResult asyncResult)
{
return EndInvoke<UpdateRelationalDatabaseResponse>(asyncResult);
}
#endregion
#region UpdateRelationalDatabaseParameters
/// <summary>
/// Allows the update of one or more parameters of a database in Amazon Lightsail.
///
///
/// <para>
/// Parameter updates don't cause outages; therefore, their application is not subject
/// to the preferred maintenance window. However, there are two ways in which paramater
/// updates are applied: <code>dynamic</code> or <code>pending-reboot</code>. Parameters
/// marked with a <code>dynamic</code> apply type are applied immediately. Parameters
/// marked with a <code>pending-reboot</code> apply type are applied only after the database
/// is rebooted using the <code>reboot relational database</code> operation.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateRelationalDatabaseParameters service method.</param>
///
/// <returns>The response from the UpdateRelationalDatabaseParameters service method, as returned by Lightsail.</returns>
/// <exception cref="Amazon.Lightsail.Model.AccessDeniedException">
/// Lightsail throws this exception when the user cannot be authenticated or uses invalid
/// credentials to access a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.AccountSetupInProgressException">
/// Lightsail throws this exception when an account is still in the setup in progress
/// state.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.InvalidInputException">
/// Lightsail throws this exception when user input does not conform to the validation
/// rules of an input field.
///
/// <note>
/// <para>
/// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. Please
/// set your AWS Region configuration to us-east-1 to create, view, or edit these resources.
/// </para>
/// </note>
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.NotFoundException">
/// Lightsail throws this exception when it cannot find a resource.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.OperationFailureException">
/// Lightsail throws this exception when an operation fails to execute.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.ServiceException">
/// A general service exception.
/// </exception>
/// <exception cref="Amazon.Lightsail.Model.UnauthenticatedException">
/// Lightsail throws this exception when the user has not been authenticated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateRelationalDatabaseParameters">REST API Reference for UpdateRelationalDatabaseParameters Operation</seealso>
public virtual UpdateRelationalDatabaseParametersResponse UpdateRelationalDatabaseParameters(UpdateRelationalDatabaseParametersRequest request)
{
var marshaller = UpdateRelationalDatabaseParametersRequestMarshaller.Instance;
var unmarshaller = UpdateRelationalDatabaseParametersResponseUnmarshaller.Instance;
return Invoke<UpdateRelationalDatabaseParametersRequest,UpdateRelationalDatabaseParametersResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the UpdateRelationalDatabaseParameters operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateRelationalDatabaseParameters operation on AmazonLightsailClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateRelationalDatabaseParameters
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateRelationalDatabaseParameters">REST API Reference for UpdateRelationalDatabaseParameters Operation</seealso>
public virtual IAsyncResult BeginUpdateRelationalDatabaseParameters(UpdateRelationalDatabaseParametersRequest request, AsyncCallback callback, object state)
{
var marshaller = UpdateRelationalDatabaseParametersRequestMarshaller.Instance;
var unmarshaller = UpdateRelationalDatabaseParametersResponseUnmarshaller.Instance;
return BeginInvoke<UpdateRelationalDatabaseParametersRequest>(request, marshaller, unmarshaller,
callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UpdateRelationalDatabaseParameters operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateRelationalDatabaseParameters.</param>
///
/// <returns>Returns a UpdateRelationalDatabaseParametersResult from Lightsail.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateRelationalDatabaseParameters">REST API Reference for UpdateRelationalDatabaseParameters Operation</seealso>
public virtual UpdateRelationalDatabaseParametersResponse EndUpdateRelationalDatabaseParameters(IAsyncResult asyncResult)
{
return EndInvoke<UpdateRelationalDatabaseParametersResponse>(asyncResult);
}
#endregion
}
} | 57.611266 | 222 | 0.672998 | [
"Apache-2.0"
] | InsiteVR/aws-sdk-net | sdk/src/Services/Lightsail/Generated/_bcl35/AmazonLightsailClient.cs | 475,581 | C# |
using Newtonsoft.Json;
using CCXT.NET.Shared.Coin.Trade;
using CCXT.NET.Shared.Coin.Types;
namespace CCXT.NET.Bitfinex.Trade
{
/// <summary>
///
/// </summary>
public class BMyPositionItem : CCXT.NET.Shared.Coin.Trade.MyPositionItem, IMyPositionItem
{
/// <summary>
///
/// </summary>
[JsonProperty(PropertyName = "id")]
public override string positionId
{
get;
set;
}
/// <summary>
/// Asset pair.
/// </summary>
[JsonProperty(PropertyName = "symbol")]
public override string symbol
{
get;
set;
}
/// <summary>
///
/// </summary>
[JsonProperty(PropertyName = "origin_timestamp")]
public override long timestamp
{
get;
set;
}
/// <summary>
/// Unix timestamp of trade.
/// </summary>
[JsonProperty(PropertyName = "timestamp")]
private decimal timeValue
{
set
{
timestamp = (long)value * 1000;
}
}
/// <summary>
/// Position volume (base currency unless viqc set in oflags).
/// </summary>
[JsonProperty(PropertyName = "amount")]
public override decimal quantity
{
get;
set;
}
/// <summary>
///
/// </summary>
[JsonProperty(PropertyName = "base")]
public override decimal price
{
get;
set;
}
/// <summary>
///
/// </summary>
[JsonProperty(PropertyName = "status")]
private string status
{
set
{
orderStatus = OrderStatusConverter.FromString(value);
}
}
/// <summary>
///
/// </summary>
public decimal swap
{
get;
set;
}
/// <summary>
/// partially realized
/// </summary>
public decimal pl
{
get;
set;
}
}
} | 21.153846 | 93 | 0.435 | [
"MIT"
] | ccxt-net/ccxt.net | src/exchanges/gbr/bitfinex/trade/position.cs | 2,202 | C# |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using RhinoMocksToMoq;
namespace RhinoMocksToMoqConsole
{
class Program
{
static void Main(string[] args)
{
var isBatch = args[0] == "-batch";
if (!(args.Length == 1 && File.Exists(args[0]) || args.Length == 3 && args[1] == "-out" && File.Exists(args[0]) || args.Length == 2 && isBatch && File.Exists(args[1])))
{
Console.WriteLine("Usage: RhinoMocksToMoqConsole <filepath> [-out file]");
Console.WriteLine("Usage: RhinoMocksToMoqConsole -batch filepath-containing-list-of-files]");
Environment.Exit(1);
}
var outFilename = !isBatch ? args [2] : null;
var writeToConsole = args.Length == 1;
var paths = args[0] == "-batch" ? File.ReadAllLines(args[1]).Where(x => !string.IsNullOrWhiteSpace(x) && x [0] != '#').ToList() : new List<string> { args[0]};
paths.ForEach(filename =>
{
var sourceCode = File.ReadAllText(filename);
var newSourceCode = ClassConverter.Convert(sourceCode);
if (writeToConsole)
Console.WriteLine(newSourceCode);
else
{
Console.WriteLine(filename);
var resultFilename = outFilename ?? filename;
File.WriteAllText(resultFilename, newSourceCode);
}
});
}
}
}
| 36.857143 | 182 | 0.536176 | [
"MIT"
] | prescottadam/RhinoMocksToMoq | RhinoMocksToMoqConsole/Program.cs | 1,550 | C# |
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <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>
//------------------------------------------------------------------------------
[assembly: global::Android.Runtime.ResourceDesignerAttribute("Dining.Resource", IsApplication=true)]
namespace Dining
{
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
public partial class Resource
{
static Resource()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
public static void UpdateIdValues()
{
}
public partial class Attribute
{
static Attribute()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Attribute()
{
}
}
public partial class Drawable
{
// aapt resource value: 0x7f020000
public const int Icon = 2130837504;
static Drawable()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Drawable()
{
}
}
public partial class Id
{
// aapt resource value: 0x7f050002
public const int ratingBar = 2131034114;
// aapt resource value: 0x7f050000
public const int recyclerView = 2131034112;
// aapt resource value: 0x7f050001
public const int restaurantName = 2131034113;
static Id()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Id()
{
}
}
public partial class Layout
{
// aapt resource value: 0x7f030000
public const int Main = 2130903040;
// aapt resource value: 0x7f030001
public const int Restaurant = 2130903041;
static Layout()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Layout()
{
}
}
public partial class String
{
// aapt resource value: 0x7f040001
public const int ApplicationName = 2130968577;
// aapt resource value: 0x7f040000
public const int Hello = 2130968576;
static String()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private String()
{
}
}
}
}
#pragma warning restore 1591
| 19.721311 | 100 | 0.614713 | [
"MIT"
] | patrickCode/Mobile | Xamarin/Android/TestOrderApp/Dining/Resources/Resource.Designer.cs | 2,406 | C# |
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace MyBlog.Models.AccountViewModels
{
public class LoginViewModel
{
[Required]
[Display(Name = "E-mail")]
public string Email { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "密码")]
public string Password { get; set; }
[Display(Name = "记住我?")]
public bool RememberMe { get; set; }
}
}
| 22.583333 | 44 | 0.629151 | [
"MIT"
] | huww98/MyBlog | src/MyBlog/Models/AccountViewModels/LoginViewModel.cs | 552 | C# |
using Volo.Abp.Modularity;
namespace CName.PName.SName
{
[DependsOn(
typeof(SNameApplicationModule),
typeof(SNameDomainTestModule))]
public class SNameApplicationTestModule : AbpModule
{
}
}
| 17.384615 | 55 | 0.690265 | [
"MIT"
] | NanoFabricFX/abp-vnext-templates | aspnet-core/test/CName.PName.SName.Application.Tests/SNameApplicationTestModule.cs | 228 | C# |
#pragma warning disable CS0108, CS0649
using System;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
namespace Encoder.ILAdapter
{
public class Stack_1_ObjectAdapter : CrossBindingAdaptor
{
static CrossBindingFunctionInfo<System.Collections.IEnumerator> mGetEnumerator_0 = new CrossBindingFunctionInfo<System.Collections.IEnumerator>("GetEnumerator");
static CrossBindingMethodInfo<System.Array, System.Int32> mCopyTo_1 = new CrossBindingMethodInfo<System.Array, System.Int32>("CopyTo");
static CrossBindingFunctionInfo<System.Object> mget_SyncRoot_2 = new CrossBindingFunctionInfo<System.Object>("get_SyncRoot");
static CrossBindingFunctionInfo<System.Boolean> mget_IsSynchronized_3 = new CrossBindingFunctionInfo<System.Boolean>("get_IsSynchronized");
public override Type BaseCLRType
{
get
{
return typeof(System.Collections.Generic.Stack<System.Object>);
}
}
public override Type AdaptorType
{
get
{
return typeof(Adapter);
}
}
public override object CreateCLRInstance(ILRuntime.Runtime.Enviorment.AppDomain appdomain, ILTypeInstance instance)
{
return new Adapter(appdomain, instance);
}
public class Adapter : System.Collections.Generic.Stack<System.Object>, CrossBindingAdaptorType
{
ILTypeInstance instance;
ILRuntime.Runtime.Enviorment.AppDomain appdomain;
public Adapter()
{
}
public Adapter(ILRuntime.Runtime.Enviorment.AppDomain appdomain, ILTypeInstance instance)
{
this.appdomain = appdomain;
this.instance = instance;
}
public ILTypeInstance ILInstance { get { return instance; } }
public System.Collections.IEnumerator GetEnumerator()
{
return mGetEnumerator_0.Invoke(this.instance);
}
public void CopyTo(System.Array array, System.Int32 index)
{
mCopyTo_1.Invoke(this.instance, array, index);
}
public System.Object SyncRoot
{
get
{
return mget_SyncRoot_2.Invoke(this.instance);
}
}
public System.Boolean IsSynchronized
{
get
{
return mget_IsSynchronized_3.Invoke(this.instance);
}
}
public override string ToString()
{
IMethod m = appdomain.ObjectType.GetMethod("ToString", 0);
m = instance.Type.GetVirtualMethod(m);
if (m == null || m is ILMethod)
{
return instance.ToString();
}
else
return instance.Type.FullName;
}
}
}
}
#pragma warning restore CS0108, CS0649
| 31.642857 | 169 | 0.585295 | [
"Apache-2.0"
] | ZhangHuan0407/BMPFont | Unity/BMPFont/Assets/ILRuntime/Adapter/Stack`1_ObjectAdapter.cs | 3,101 | C# |
// WARNING
//
// This file has been generated automatically by Visual Studio from the outlets and
// actions declared in your storyboard file.
// Manual changes to this file will not be maintained.
//
using Foundation;
using System;
using System.CodeDom.Compiler;
using UIKit;
namespace Calendars
{
[Register ("EventsController")]
partial class EventsController
{
void ReleaseDesignerOutlets ()
{
}
}
} | 22.047619 | 84 | 0.669546 | [
"MIT"
] | Art-Lav/ios-samples | Calendars/Calendars/EventsController.designer.cs | 463 | C# |
using Discord;
using Discord.Commands;
using Discord.WebSocket;
using System.Threading.Tasks;
namespace TyniBot
{
public interface IChannelHandler
{
Task<IResult> MessageReceived(CommandContext context);
Task ReactionAdded(ReactionContext context, SocketReaction reactionAdded);
Task ReactionRemoved(ReactionContext context, SocketReaction reactionRemoved);
Task ReactionsCleared(ReactionContext context);
}
} | 30.333333 | 86 | 0.767033 | [
"MIT"
] | mikeliddle/MyLiddleBot | Common/ChannelHandlers/IChannelHandler.cs | 457 | 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("VXEN.Services")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VXEN.Services")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("63f2e2a7-8c5e-4072-910b-072f9070bb34")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 37.810811 | 84 | 0.744103 | [
"MIT"
] | iswix-llc/vxen | Application/VXEN.Services/Properties/AssemblyInfo.cs | 1,402 | C# |
/*
* Copyright 2018 JDCLOUD.COM
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:#www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* 云鼎短信服务-应用通用设置相关接口
* 云鼎短信服务-应用通用设置相关接口
*
* OpenAPI spec version: v1
* Contact:
*
* NOTE: This class is auto generated by the jdcloud code generator program.
*/
using System;
using System.Collections.Generic;
using System.Text;
using JDCloudSDK.Core.Service;
using JDCloudSDK.Ydsms.Model;
namespace JDCloudSDK.Ydsms.Apis
{
/// <summary>
/// 查询应用通用设置列表
/// </summary>
public class ListSmsAppGeneralSettingsUsingGETResult : JdcloudResult
{
///<summary>
/// AppGeneralSettings
///</summary>
public List<GeneralSettings> AppGeneralSettings{ get; set; }
}
} | 25.893617 | 76 | 0.706656 | [
"Apache-2.0"
] | jdcloud-api/jdcloud-sdk-net | sdk/src/Service/Ydsms/Apis/ListSmsAppGeneralSettingsUsingGETResult.cs | 1,301 | 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\IEntityRequest.cs.tt
namespace Microsoft.Graph
{
using System;
using System.IO;
using System.Net.Http;
using System.Threading;
using System.Linq.Expressions;
/// <summary>
/// The interface IEducationOrganizationRequest.
/// </summary>
public partial interface IEducationOrganizationRequest : IBaseRequest
{
/// <summary>
/// Creates the specified EducationOrganization using PUT.
/// </summary>
/// <param name="educationOrganizationToCreate">The EducationOrganization to create.</param>
/// <returns>The created EducationOrganization.</returns>
System.Threading.Tasks.Task<EducationOrganization> CreateAsync(EducationOrganization educationOrganizationToCreate); /// <summary>
/// Creates the specified EducationOrganization using PUT.
/// </summary>
/// <param name="educationOrganizationToCreate">The EducationOrganization to create.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The created EducationOrganization.</returns>
System.Threading.Tasks.Task<EducationOrganization> CreateAsync(EducationOrganization educationOrganizationToCreate, CancellationToken cancellationToken);
/// <summary>
/// Deletes the specified EducationOrganization.
/// </summary>
/// <returns>The task to await.</returns>
System.Threading.Tasks.Task DeleteAsync();
/// <summary>
/// Deletes the specified EducationOrganization.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The task to await.</returns>
System.Threading.Tasks.Task DeleteAsync(CancellationToken cancellationToken);
/// <summary>
/// Gets the specified EducationOrganization.
/// </summary>
/// <returns>The EducationOrganization.</returns>
System.Threading.Tasks.Task<EducationOrganization> GetAsync();
/// <summary>
/// Gets the specified EducationOrganization.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The EducationOrganization.</returns>
System.Threading.Tasks.Task<EducationOrganization> GetAsync(CancellationToken cancellationToken);
/// <summary>
/// Updates the specified EducationOrganization using PATCH.
/// </summary>
/// <param name="educationOrganizationToUpdate">The EducationOrganization to update.</param>
/// <returns>The updated EducationOrganization.</returns>
System.Threading.Tasks.Task<EducationOrganization> UpdateAsync(EducationOrganization educationOrganizationToUpdate);
/// <summary>
/// Updates the specified EducationOrganization using PATCH.
/// </summary>
/// <param name="educationOrganizationToUpdate">The EducationOrganization to update.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The updated EducationOrganization.</returns>
System.Threading.Tasks.Task<EducationOrganization> UpdateAsync(EducationOrganization educationOrganizationToUpdate, 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>
IEducationOrganizationRequest Expand(string value);
/// <summary>
/// Adds the specified expand value to the request.
/// </summary>
/// <param name="expandExpression">The expression from which to calculate the expand value.</param>
/// <returns>The request object to send.</returns>
IEducationOrganizationRequest Expand(Expression<Func<EducationOrganization, object>> expandExpression);
/// <summary>
/// Adds the specified select value to the request.
/// </summary>
/// <param name="value">The select value.</param>
/// <returns>The request object to send.</returns>
IEducationOrganizationRequest Select(string value);
/// <summary>
/// Adds the specified select value to the request.
/// </summary>
/// <param name="selectExpression">The expression from which to calculate the select value.</param>
/// <returns>The request object to send.</returns>
IEducationOrganizationRequest Select(Expression<Func<EducationOrganization, object>> selectExpression);
}
}
| 48.747664 | 161 | 0.656442 | [
"MIT"
] | peombwa/msgraph-sdk-dotnet | src/Microsoft.Graph/Requests/Generated/IEducationOrganizationRequest.cs | 5,216 | C# |
using System;
using System.Collections.Generic;
//using System.Linq;
using MathNet.Numerics.Interpolation;
using Torec.Channels;
#if USE_DRAWING
using Torec.Drawing;
using Color = System.Drawing.Color;
#endif
using TDouble = System.Double;
namespace Torec
{
/*
* https://www.codeproject.com/Articles/560163/Csharp-Cubic-Spline-Interpolation
* https://numerics.mathdotnet.com/api/MathNet.Numerics.Interpolation/CubicSpline.htm
* http://www.mosismath.com/NaturalSplines/NaturalSplines.html
* https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.animation.timeline?view=netcore-3.1
*/
using TTime = TDouble;
public class Timeline
{
protected class InterpolationChannel : Channel
{
protected Timeline _timeline;
protected struct KeyFrame {
public TTime time;
public TDouble value;
}
protected List<KeyFrame> _keyFrames = new List<KeyFrame>(); // sorted by time
#region Interpolation
protected IInterpolation _interpolation = null;
protected void UpdateInterpolation() {
int count = _keyFrames.Count;
var xs = new double[count];
var ys = new double[count];
for (int i = 0; i < count; ++i) {
xs[i] = (double)_keyFrames[i].time;
ys[i] = (double)_keyFrames[i].value;
}
if (count <= 1) {
_interpolation = StepInterpolation.Interpolate(xs, ys);
} else if (count <= 2) {
_interpolation = LinearSpline.Interpolate(xs, ys);
} else if (count <= 3) {
_interpolation = MathNet.Numerics.Interpolate.Polynomial(xs, ys);
} else if (count <= 4) {
_interpolation = CubicSpline.InterpolateNatural(xs, ys);
} else {
_interpolation = CubicSpline.InterpolateAkima(xs, ys);
}
}
public TDouble Interpolate(TTime time) {
if (_interpolation == null) return default(TDouble);
double value = _interpolation.Interpolate((double)time);
return value;
}
#endregion Interpolation
internal InterpolationChannel(ChannelInfo info, Timeline owner)
: base(info) {
_timeline = owner;
}
internal void AddKeyFrame(TTime time, TDouble value) {
var k = new KeyFrame { time = time, value = value };
_keyFrames.Add(k);
UpdateInterpolation();
}
internal void AddKeyFrames(TTime[] times, TDouble[] values, int count = int.MaxValue) {
count = Math.Min(count, times.Length);
count = Math.Min(count, values.Length);
for (int i = 0; i < count; ++i) {
var k = new KeyFrame { time = times[i], value = values[i] };
_keyFrames.Add(k);
}
UpdateInterpolation();
}
// Channel
public override TDouble GetValue() {
TDouble value = Interpolate(_timeline._currentTime);
return value;
}
#if USE_DRAWING
public void Draw(TTime[] timeRange, Image image, int segmentCount, Color color)
{
// Draw keyframes points
for (int j = 0; j < _keyFrames.Count; ++j) {
TTime t = _keyFrames[j].time;
TDouble v = _keyFrames[j].value;
Point pos = new Point((float)t, (float)v);
image.Circle(pos, 0.02f)
.Add()
.FillStroke(color, Color.Empty);
}
// Draw line
var points = new Point[segmentCount + 1];
for (int j = 0; j <= segmentCount; ++j) {
TTime t = timeRange[0] + (timeRange[1] - timeRange[0]) * j / segmentCount;
TDouble v = this.Interpolate(t);
points[j] = new Point((float)t, (float)v);
}
image.Line(points)
.Add()
.FillStroke(Color.Empty, color, strokeWidth: 0.01f);
}
#endif
}
protected Dictionary<int, InterpolationChannel> _channels = new Dictionary<int, InterpolationChannel>(); // id -> channel
protected TTime _currentTime = 0.0;
public Channel MakeChannel(ChannelInfo info) {
var channel = new InterpolationChannel(info, this);
int id = channel.GetId();
_channels[id] = channel;
return channel;
}
//protected TTime[] GetTimeRange() {
// return new TTime[] { 0.0, 1.0 }; //!!!
//}
public void SetCurrentTime(TTime time) {
_currentTime = time;
}
public bool AddKeyFrame(Channel channel, TTime time, TDouble value) {
int id = channel.GetId();
InterpolationChannel c;
if (_channels.TryGetValue(id, out c)) {
c.AddKeyFrame(time, value);
return true;
}
return false; // channel not found
}
public bool AddKeyFrames(Channel channel, TTime[] times, TDouble[] values, int count = int.MaxValue) {
int id = channel.GetId();
InterpolationChannel c;
if (_channels.TryGetValue(id, out c)) {
c.AddKeyFrames(times, values, count);
return true;
}
return false; // channel not found
}
#if USE_DRAWING
public Image Draw(Viewport viewport)
{
Point[] bounds = viewport.GetUserBounds();
TTime[] timeRange = new TTime[] { bounds[0].X, bounds[1].X };
Image image = new Image(viewport); // recreate image
// fill blank
image.Rectangle(viewport.GetUserBounds())
.Add()
.FillStroke(Color.LightYellow, Color.Empty);
// draw grid
for (int i = -1; i <= 1; ++i) {
var p0 = new Point(bounds[0].X, i);
var p1 = new Point(bounds[1].X, i);
image.Line(new[] { p0, p1 })
.Add()
.FillStroke(Color.Empty, Color.LightGray, strokeWidth: 0.01f);
}
// draw current time
{
var p0 = new Point((float)_currentTime, bounds[0].Y);
var p1 = new Point((float)_currentTime, bounds[1].Y);
image.Line(new[] { p0, p1 })
.Add()
.FillStroke(Color.Empty, Color.Gray, strokeWidth: 0.01f);
}
// draw channels
int segmentCount = 50;
foreach (var i in _channels) {
InterpolationChannel c = i.Value;
Color color = ColorUtils.GetRareColor(c.GetId(), 0.5, 0.5);
c.Draw(timeRange, image, segmentCount, color);
}
return image;
}
#endif
}
#if RUN_TEST
static class Program
{
static void Test1()
{
var x = new double[] { 1.0, 2.5, 3.3, 4.0, 5.0 };
var y = new double[] { 10.0, 20.0, 15.0, 12.0, 8.0 };
var spline = MathNet.Numerics.Interpolation.CubicSpline.InterpolateAkimaSorted(x, y);
double y1 = spline.Interpolate(1.2); // 12.79
double y2 = spline.Interpolate(4.2); // 11.17
}
static int Main()
{
Test1();
return 0;
}
}
#endif
}
| 35.743363 | 130 | 0.492201 | [
"MIT"
] | bntre/cs-rationals | src/Torec.Timeline/Timeline.cs | 8,078 | C# |
using Common.Extensions;
using LBH.AdultSocialCare.Api.V1.Boundary.CarePackages.Response;
using LBH.AdultSocialCare.Api.V1.Factories;
using LBH.AdultSocialCare.Api.V1.Gateways.CarePackages.Interfaces;
using LBH.AdultSocialCare.Api.V1.Gateways.Enums;
using LBH.AdultSocialCare.Api.V1.UseCase.CarePackages.Interfaces;
using System;
using System.Linq;
using System.Threading.Tasks;
using LBH.AdultSocialCare.Data.Constants.Enums;
namespace LBH.AdultSocialCare.Api.V1.UseCase.CarePackages.Concrete
{
public class GetCarePackageHistoryUseCase : IGetCarePackageHistoryUseCase
{
private readonly ICarePackageGateway _carePackageGateway;
private readonly ICarePackageHistoryGateway _carePackageHistoryGateway;
public GetCarePackageHistoryUseCase(ICarePackageGateway carePackageGateway, ICarePackageHistoryGateway carePackageHistoryGateway)
{
_carePackageGateway = carePackageGateway;
_carePackageHistoryGateway = carePackageHistoryGateway;
}
public async Task<CarePackageHistoryViewResponse> ExecuteAsync(Guid packageId)
{
var package = await _carePackageGateway.GetPackageAsync(packageId, PackageFields.Approver | PackageFields.Broker | PackageFields.Resources, false).EnsureExistsAsync($"Package with id {packageId} not found");
var packageHistory = await _carePackageHistoryGateway.ListAsync(packageId);
var historyResponse = new CarePackageHistoryViewResponse
{
CarePackageId = package.Id,
PackageType = package.PackageType.GetDisplayName(),
BrokeredBy = package.Broker?.Name,
AssignedOn = package.DateAssigned,
ApprovedBy = package.Approver?.Name,
ApprovedOn = package.DateApproved,
SocialWorkerCarePlanFileId = package.Resources?.Where(r => r.Type == PackageResourceType.CarePlanFile).OrderByDescending(x => x.DateCreated).FirstOrDefault()?.FileId,
SocialWorkerCarePlanFileName = package.Resources?.Where(r => r.Type == PackageResourceType.CarePlanFile).OrderByDescending(x => x.DateCreated).FirstOrDefault()?.Name,
History = packageHistory.OrderByDescending(h => h.Id).ToResponse()
};
return historyResponse;
}
}
}
| 48.666667 | 219 | 0.726884 | [
"MIT"
] | LBHackney-IT/lbh-adult-social-care-api | LBH.AdultSocialCare.Api/V1/UseCase/CarePackages/Concrete/GetCarePackageHistoryUseCase.cs | 2,336 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AmmoInteractable : MonoBehaviour {
private int cantidadInventario;
public GameObject lblCantidadInventario;
private bool isSelected;
public GameObject MQTTProtocol;
private bool isPressed = false;
// Use this for initialization
void Start () {
isSelected = false;
}
// Update is called once per frame
void Update () {
if (isSelected)
{
if (Input.GetKeyDown(KeyCode.Mouse1) || MQTTProtocol.GetComponent<M2MQTTTerminals>().msg=="Reload")
{
//print(lblCantidadInventario.GetComponent<UnityEngine.UI.Text>().text);
cantidadInventario = int.Parse(lblCantidadInventario.GetComponent<UnityEngine.UI.Text>().text);
print("Original: " + cantidadInventario);
//if (cantidadInventario < 90)
//{
cantidadInventario += 60;
print("Nuerva: " + cantidadInventario);
lblCantidadInventario.GetComponent<UnityEngine.UI.Text>().text = cantidadInventario.ToString();
Destroy(transform.root.gameObject);
//}
}
}
}
public void SelectUnSelectAmmoBox()
{
isSelected = !isSelected;
print(isSelected);
}
}
| 30.6 | 115 | 0.607843 | [
"MIT"
] | gutierrezArmando/ProyectoDDI | Assets/AmmoInteractable.cs | 1,379 | C# |
using BedrockService.Client.Management;
using BedrockService.Shared.Classes;
using BedrockService.Shared.Interfaces;
using BedrockService.Shared.PackParser;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Text;
using System.Windows.Forms;
namespace BedrockService.Client.Forms {
public partial class ManagePacksForms : Form {
private readonly byte ServerIndex = 0x00;
private readonly IBedrockLogger Logger;
private readonly IProcessInfo ProcessInfo;
private readonly DirectoryInfo PackExtractDir;
public ManagePacksForms(byte serverIndex, IBedrockLogger logger, IProcessInfo processInfo) {
Logger = logger;
PackExtractDir = new DirectoryInfo($@"{processInfo.GetDirectory()}\Temp");
ProcessInfo = processInfo;
ServerIndex = serverIndex;
InitializeComponent();
}
public void PopulateServerPacks(List<MinecraftPackContainer> packList) {
foreach (MinecraftPackContainer container in packList)
serverListBox.Items.Add(container);
FormManager.TCPClient.RecievedPacks = null;
}
private void ListBox_SelectedIndexChanged(object sender, EventArgs e) {
ListBox thisBox = (ListBox)sender;
if (thisBox == serverListBox)
parsedPacksListBox.SelectedIndex = -1;
if (thisBox == parsedPacksListBox)
serverListBox.SelectedIndex = -1;
if (thisBox.SelectedIndex != -1) {
MinecraftPackContainer selectedPack = (MinecraftPackContainer)thisBox.SelectedItem;
if (selectedPack.IconBytes != null)
using (MemoryStream ms = new MemoryStream(selectedPack.IconBytes)) {
selectedPackIcon.Image = Image.FromStream(ms);
}
if (selectedPack.JsonManifest != null)
textBox1.Text = $"{selectedPack.JsonManifest.header.name}\r\n{selectedPack.JsonManifest.header.description}\r\n{selectedPack.JsonManifest.header.uuid}\r\n{selectedPack.JsonManifest.header.version[0]}";
else
textBox1.Text = new DirectoryInfo(selectedPack.PackContentLocation).Name;
}
}
private void removePackBtn_Click(object sender, EventArgs e) {
if (serverListBox.SelectedIndex != -1) {
List<MinecraftPackContainer> temp = new List<MinecraftPackContainer>();
object[] items = new object[serverListBox.SelectedItems.Count];
serverListBox.SelectedItems.CopyTo(items, 0);
foreach (object item in items) {
temp.Add((MinecraftPackContainer)item);
serverListBox.Items.Remove(item);
}
JsonSerializerSettings settings = new() { TypeNameHandling = TypeNameHandling.All };
FormManager.TCPClient.SendData(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(temp, Formatting.Indented, settings)), ServerIndex, NetworkMessageTypes.RemovePack);
}
DialogResult = DialogResult.OK;
}
private void removeAllPacksBtn_Click(object sender, EventArgs e) {
List<MinecraftPackContainer> temp = new List<MinecraftPackContainer>();
foreach (object item in serverListBox.Items)
temp.Add((MinecraftPackContainer)item);
JsonSerializerSettings settings = new() { TypeNameHandling = TypeNameHandling.All };
FormManager.TCPClient.SendData(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(temp, Formatting.Indented, settings)), ServerIndex, NetworkMessageTypes.RemovePack);
DialogResult = DialogResult.OK;
}
private void sendPacksBtn_Click(object sender, EventArgs e) {
if (parsedPacksListBox.SelectedIndex != -1) {
object[] items = new object[parsedPacksListBox.SelectedItems.Count];
parsedPacksListBox.SelectedItems.CopyTo(items, 0);
SendPacks(items);
}
}
private void sendAllBtn_Click(object sender, EventArgs e) {
if (parsedPacksListBox.Items.Count < 1) { return; }
object[] items = new object[parsedPacksListBox.Items.Count];
parsedPacksListBox.Items.CopyTo(items, 0);
SendPacks(items);
}
private void openFileBtn_Click(object sender, EventArgs e) {
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
openFileDialog.Filter = "MC pack file (.MCWORLD, .MCPACK, .MCADDON, .Zip)|*.mcworld;*.mcpack;*.mcaddon;*.zip";
openFileDialog.Title = "Select pack file(s)";
openFileDialog.Multiselect = true;
if (openFileDialog.ShowDialog() == DialogResult.OK) {
MinecraftPackParser parser = new MinecraftPackParser(openFileDialog.FileNames, PackExtractDir.FullName, ProcessInfo);
parsedPacksListBox.Items.Clear();
foreach (MinecraftPackContainer container in parser.FoundPacks)
parsedPacksListBox.Items.Add(container);
}
}
private void SendPacks(object[] packList) {
foreach (MinecraftPackContainer container in packList) {
Directory.CreateDirectory($@"{PackExtractDir.FullName}\ZipTemp");
DirectoryInfo directoryInfo = new DirectoryInfo(container.PackContentLocation);
directoryInfo.MoveTo($@"{PackExtractDir.FullName}\ZipTemp\{directoryInfo.Name}");
container.PackContentLocation = $@"{PackExtractDir.FullName}\ZipTemp\{directoryInfo.Name}";
}
ZipFile.CreateFromDirectory($@"{PackExtractDir.FullName}\ZipTemp", $@"{PackExtractDir.FullName}\SendZip.zip");
FormManager.TCPClient.SendData(File.ReadAllBytes($@"{PackExtractDir.FullName}\SendZip.zip"), ServerIndex, NetworkMessageTypes.PackFile);
DialogResult = DialogResult.OK;
}
}
}
| 52.453782 | 221 | 0.654918 | [
"Apache-2.0"
] | crowbarmaster/BedrockManagementService | BedrockService/Client/Forms/ManagePacksForms.cs | 6,244 | C# |
// -----------------------------------------------------------------------
// <copyright file="Program.cs" company="Asynkron AB">
// Copyright (C) 2015-2020 Asynkron AB All rights reserved
// </copyright>
// -----------------------------------------------------------------------
using System;
using System.Threading.Tasks;
using Messages;
using Microsoft.Extensions.Logging;
using Proto;
using Proto.Remote;
using Proto.Remote.GrpcCore;
using Proto.Remote.GrpcNet;
using ProtosReflection = Messages.ProtosReflection;
namespace Node2
{
public class EchoActor : IActor
{
private PID _sender;
public Task ReceiveAsync(IContext context)
{
switch (context.Message)
{
case StartRemote sr:
Console.WriteLine($"Starting for {sr.Sender.ToShortString()}");
_sender = sr.Sender;
context.Respond(new Start());
return Task.CompletedTask;
case Ping _:
context.Send(_sender, new Pong());
return Task.CompletedTask;
default:
return Task.CompletedTask;
}
}
}
internal class Program
{
private static async Task Main(string[] args)
{
Log.SetLoggerFactory(LoggerFactory.Create(c => c
.SetMinimumLevel(LogLevel.Information)
.AddConsole()
)
);
#if NETCORE
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
#endif
Console.WriteLine("Enter 0 to use GrpcCore provider");
Console.WriteLine("Enter 1 to use GrpcNet provider");
if (!int.TryParse(Console.ReadLine(), out var provider))
provider = 0;
var actorSystemConfig = new ActorSystemConfig()
.WithDeadLetterThrottleCount(10)
.WithDeadLetterThrottleInterval(TimeSpan.FromSeconds(2));
var system = new ActorSystem(actorSystemConfig);
var context = new RootContext(system);
IRemote remote;
if (provider == 0)
{
var remoteConfig = GrpcCoreRemoteConfig
.BindToLocalhost(12000)
.WithProtoMessages(ProtosReflection.Descriptor)
.WithRemoteKind("echo", Props.FromProducer(() => new EchoActor()));
remote = new GrpcCoreRemote(system, remoteConfig);
}
else
{
var remoteConfig = GrpcNetRemoteConfig
.BindToLocalhost(12000)
.WithProtoMessages(ProtosReflection.Descriptor)
.WithRemoteKind("echo", Props.FromProducer(() => new EchoActor()));
remote = new GrpcNetRemote(system, remoteConfig);
}
await remote.StartAsync();
context.SpawnNamed(Props.FromProducer(() => new EchoActor()), "remote");
Console.ReadLine();
await remote.ShutdownAsync();
}
}
} | 35.761364 | 101 | 0.534795 | [
"Apache-2.0"
] | dhavalgajera/protoactor-dotnet | benchmarks/RemoteBenchmark/Node2/Program.cs | 3,149 | C# |
using System;
using System.Collections.Generic;
using System.Globalization;
using SerdesNet;
using UAlbion.Config;
namespace UAlbion.Formats.Assets.Save
{
public class TickerDictionary : Dictionary<TickerId, byte>
{
const int Min = 100;
const int Max = 255;
public static TickerDictionary Serdes(int _, TickerDictionary d, ISerializer s)
{
if (s == null) throw new ArgumentNullException(nameof(s));
d ??= new TickerDictionary();
if (s.IsReading())
d.Clear();
// TODO: Proper extensible modding support
for (int i = Min; i <= Max; i++)
{
var assetId = new TickerId(AssetType.Ticker, i);
d[assetId] = d.TryGetValue(assetId, out var existing)
? s.UInt8(i.ToString(CultureInfo.InvariantCulture), existing)
: s.UInt8(i.ToString(CultureInfo.InvariantCulture), 0);
}
return d;
}
}
}
| 30.818182 | 87 | 0.571288 | [
"MIT"
] | Metibor/ualbion | src/Formats/Assets/Save/TickerDictionary.cs | 1,019 | C# |
using Entity;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace DataAccess.Mappings
{
public class VoteMappings : IEntityTypeConfiguration<Vote>
{
public void Configure(EntityTypeBuilder<Vote> builder)
{
builder.ToTable("Votes");
builder.HasKey("Id");
builder.Property(x => x.CandidateId).HasColumnType("int");
builder.Property(x => x.DatetimeVote).HasColumnType("datetime");
builder.Property(x => x.Legend).HasColumnType("int");
}
}
}
| 30.842105 | 76 | 0.656997 | [
"MIT"
] | ismaelash/Electronic-Ballot-Box-Backend | DataAccess/Mappings/VoteMappings.cs | 588 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CalcLang.Interpreter;
using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;
using System.Threading;
namespace Base
{
/*
* Some Methods to try to clone part of the .Net Framework.
* This should just be prove of concept
*/
public static class WinNative
{
private static class NativeMethods
{
#region Dll imports
[DllImport("kernel32.dll", SetLastError = true, EntryPoint = "SetFilePointer")]
public static extern unsafe int SetFilePointer(SafeFileHandle handle, int lo, int* hi, int origin);
[DllImport("kernel32.dll", SetLastError = true, EntryPoint = "SetThreadErrorMode")]
public static extern bool SetErrorMode(int newMode, out int oldMode);
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)]
public static extern SafeFileHandle CreateFile(String lpFileName,
int dwDesiredAccess, System.IO.FileShare dwShareMode,
SECURITY_ATTRIBUTES securityAttrs, System.IO.FileMode dwCreationDisposition,
int dwFlagsAndAttributes, IntPtr hTemplateFile);
[DllImport("kernel32.dll")]
public static extern int GetFileType(SafeFileHandle handle);
[DllImport("kernel32.dll", SetLastError = true)]
public static extern IntPtr GetStdHandle(int nStdHandle);
[DllImport("kernel32.dll", SetLastError = true)]
public static extern unsafe int WriteFile(SafeFileHandle handle, byte* bytes, int numBytesToWrite, out int bytesWritten, NativeOverlapped* mustBeZero);
[DllImport("kernel32.dll", SetLastError = true)]
public static extern unsafe int ReadFile(SafeFileHandle handle, byte* bytes, int numBytesToRead, out int numBytesRead, NativeOverlapped* mustBeZero);
[DllImport("kernel32.dll", SetLastError = true)]
public static extern uint GetConsoleOutputCP();
[DllImport("kernel32.dll", SetLastError = true)]
public static extern uint GetConsoleCP();
#endregion
}
[CalcCallableMethod("Win32Native_SetErrorMode", 1)]
public static object SetErrorMode(ScriptThread thread, object instance, object[] parameters)
{
object ret = null;
int newMode = Convert.ToInt32(parameters[0]);
int oldMode;
NativeMethods.SetErrorMode(newMode, out oldMode);
ret = (Decimal)oldMode;
return ret;
}
[CalcCallableMethod("Win32Native_GetLastWin32Error", 0)]
public static object GetLastWin32Error(ScriptThread thread, object instance, object[] parameters) => Marshal.GetLastWin32Error();
[CalcCallableMethod("Win32Native_CreateFile", 7, paramNames: "fileName,dwDesiredAccess,dwShareMode,securityAttrs,dwCreationDisposition,dwFlagsAndAttributes,hTemplateFile")]
public static object CreateFile(ScriptThread thread, object instance, object[] parameters)
{
//Create a native fileHandle and return an array with the pointer under Handle
//Like in GetStdHandle()
string fileName = (string)parameters[0];
int dwDesiredAccess = unchecked((int)Convert.ToUInt32(parameters[1]));
System.IO.FileShare dwShareMode = (System.IO.FileShare)Convert.ToInt32(parameters[2]);
SECURITY_ATTRIBUTES securityAttrs = null;
System.IO.FileMode dwCreationDisposition = (System.IO.FileMode)Convert.ToInt32(parameters[4]);
int dwFlagsAndAttributes = Convert.ToInt32(parameters[5]);
IntPtr hTemplateFile = IntPtr.Zero;
SafeFileHandle handle =
NativeMethods.CreateFile(fileName, dwDesiredAccess, dwShareMode,
securityAttrs, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
DataTable ret = new DataTable();
ret.SetString(thread, "Handle", handle.DangerousGetHandle());
ret.SetString(thread, "NativeHandle", handle);
ret.SetString(thread, "IsInvalid", handle.IsInvalid);
return ret;
}
[CalcCallableMethod("Win32Native_GetFileType", 1)]
public static object GetFileType(ScriptThread thread, object instance, object[] parameters)
{
object ret = null;
IntPtr preHandle = (IntPtr)parameters[0];
SafeFileHandle handle = new SafeFileHandle(preHandle, false);
ret = (decimal)NativeMethods.GetFileType(handle);
return ret;
}
[CalcCallableMethod("Win32Native_DisposeNativeHandle", 1, paramNames: "nativeHandle")]
public static object DisposeNativeHandle(ScriptThread thread, object instance, object[] parameters)
{
DataTable handleHolder = (DataTable)parameters[0];
SafeFileHandle handle = (SafeFileHandle)handleHolder.GetString(thread, "NativeHandle");
handle.Dispose();
return null;
}
[CalcCallableMethod("Win32Native_SetFilePointer", 4)]
public static unsafe object SetFilePointer(ScriptThread thread, object instance, object[] parameters)
{
IntPtr preHandle = (IntPtr)parameters[0];
SafeFileHandle handle = new SafeFileHandle(preHandle, false);
int lo = Convert.ToInt32(parameters[1]);
int hi = Convert.ToInt32(parameters[2]);
int origin = Convert.ToInt32(parameters[3]);
object ret = null;
lo = NativeMethods.SetFilePointer(handle, lo, &hi, origin);
if (lo == -1)
hi = 0;
ret = (decimal)((((ulong)((uint)hi)) << 32) | ((uint)lo));
return ret;
}
[CalcCallableMethod("Win32Native_GetStdHandle", 1)]
public static object GetStdHandle(ScriptThread thread, object instance, object[] parameters)
{
int nStdHandle = Convert.ToInt32(parameters[0]);
return NativeMethods.GetStdHandle(nStdHandle);
}
[CalcCallableMethod("Win32Native_WriteFile", 4)]
public unsafe static object WriteFile(ScriptThread thread, object instance, object[] parameters)
{
IntPtr preHandle = (IntPtr)parameters[0];
SafeFileHandle handle = new SafeFileHandle(preHandle, false);
var bytesDT = ((DataTable)parameters[1]).GetIntIndexedDict();
int offset = Convert.ToInt32(parameters[2]);
int numBytesToWrite = Convert.ToInt32(parameters[3]);
int numBytesWritten = 0;
byte[] bytes = new byte[bytesDT.Count];
for (int i = 0; i < bytes.Length; i++)
{
bytes[i] = Convert.ToByte(bytesDT[i]);
}
fixed (byte* p = bytes)
{
NativeMethods.WriteFile(handle, p + offset, numBytesToWrite, out numBytesWritten, (NativeOverlapped*)IntPtr.Zero);
}
return numBytesWritten;
}
[CalcCallableMethod("Win32Native_ReadFile", 4)]
public unsafe static object ReadFile(ScriptThread thread, object instance, object[] parameters)
{
IntPtr preHandle = (IntPtr)parameters[0];
SafeFileHandle handle = new SafeFileHandle(preHandle, false);
var bytesDT = (DataTable)parameters[1];
int offset = Convert.ToInt32(parameters[2]);
int numBytesToRead = Convert.ToInt32(parameters[3]);
int numBytesRead = 0;
byte[] bytes = new byte[numBytesToRead];
fixed (byte* p = bytes)
{
NativeMethods.ReadFile(handle, p + offset, numBytesToRead, out numBytesRead, (NativeOverlapped*)IntPtr.Zero);
}
for (int i = 0; i < numBytesRead; i++)
bytesDT.SetInt(thread, i, bytes[i]);
return numBytesRead;
}
[CalcCallableMethod("Win32Native_WaitForAvailableConsoleInput", 1)]
public static object WaitForAvailableConsoleInput(ScriptThread thread, object instance, object[] parameters)
{
IntPtr preHandle = (IntPtr)parameters[0];
SafeFileHandle handle = new SafeFileHandle(preHandle, false);
//while (!Console.KeyAvailable) { }
return null;
}
[CalcCallableMethod("Win32Native_GetConsoleOutputCP", 0)]
public static object GetConsoleOutputCP(ScriptThread thread, object instance, object[] parameters) => (decimal)NativeMethods.GetConsoleOutputCP();
[CalcCallableMethod("Win32Native_GetConsoleCP", 0)]
public static object GetConsoleCP(ScriptThread thread, object instance, object[] parameters) => (decimal)NativeMethods.GetConsoleCP();
[CalcCallableMethod("Win32Native_GetEncodingBytes", 4)]
public static object GetEncodingBytes(ScriptThread thread, object instance, object[] parameters)
{
int cp = Convert.ToInt32(parameters[0]);
int start = Convert.ToInt32(parameters[2]);
int count = Convert.ToInt32(parameters[3]);
var charsDT = ((DataTable)parameters[1]).GetIntIndexedDict();
char[] chars = new char[charsDT.Count];
for (int i = 0; i < chars.Length; i++)
{
chars[i] = Convert.ToString(charsDT[i])[0];
}
var encoding = Encoding.GetEncoding(cp);
byte[] resultBytes = encoding.GetBytes(chars, start, count);
var bytesDT = new DataTable(resultBytes.Length, 0);
for (int i = 0; i < resultBytes.Length; i++)
bytesDT.SetInt(thread, i, (decimal)resultBytes[i]);
return bytesDT;
}
[CalcCallableMethod("Win32Native_GetEncodingMaxCharCount", 2)]
public static object GetEncodingMaxCharCount(ScriptThread thread, object instance, object[] parameters)
{
int cp = Convert.ToInt32(parameters[0]);
int bufferSize = Convert.ToInt32(parameters[1]);
var encoding = Encoding.GetEncoding(cp);
int ret = encoding.GetMaxCharCount(bufferSize);
return (decimal)ret;
}
[CalcCallableMethod("Win32Native_GetEncodingPreamble", 1)]
public static object GetEncodingPreamble(ScriptThread thread, object instance, object[] parameters)
{
int cp = Convert.ToInt32(parameters[0]);
var enc = Encoding.GetEncoding(cp);
byte[] preamble = enc.GetPreamble();
DataTable ret = new DataTable(preamble.Length, 0);
for (int i = 0; i < preamble.Length; i++)
ret.SetInt(thread, i, (decimal)preamble[i]);
return ret;
}
[CalcCallableMethod("Win32Native_GetEncodingChars", 6)]
public static object GetEncodingChars(ScriptThread thread, object instance, object[] parameters)
{
int cp = Convert.ToInt32(parameters[0]);
var bytesDT = ((DataTable)parameters[1]).GetIntIndexedDict();
var byteIndex = Convert.ToInt32(parameters[2]);
var byteCount = Convert.ToInt32(parameters[3]);
var charsDT = (DataTable)parameters[4];
var charIndex = Convert.ToInt32(parameters[5]);
var enc = Encoding.GetEncoding(cp);
byte[] bytes = new byte[bytesDT.Count];
for (int i = 0; i < bytes.Length; i++)
bytes[i] = Convert.ToByte(bytesDT[i]);
char[] charBuff = new char[bytes.Length];
int chars = enc.GetDecoder().GetChars(bytes, byteIndex, byteCount, charBuff, 0);
for (int i = 0; i < chars; i++)
{
charsDT.SetInt(thread, i + charIndex, charBuff[i].ToString());
}
return chars;
}
[StructLayout(LayoutKind.Sequential)]
private class SECURITY_ATTRIBUTES
{
internal int nLength = 0;
internal unsafe byte* pSecurityDiscriptor = null;
internal int bInheritHandle = 0;
}
}
}
| 40.59736 | 180 | 0.624421 | [
"MIT"
] | hstde/Calc2 | Base/Win32Native/WinNative.cs | 12,303 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Practices.Unity;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using PracticeTime.Web.DataAccess.Models;
using PracticeTime.Web.DataAccess.Repositories;
using PracticeTime.Web.Lib.BadgeRules;
namespace PracticeTime.Web.Lib.Test.BadgeRules
{
[TestClass]
public class RepertoireRuleTest
{
private Mock<ISessionRepository> sessionRepository = new Mock<ISessionRepository>();
private Mock<IBadgeAwardRepository> badgeAwardRepository = new Mock<IBadgeAwardRepository>();
[TestInitialize]
public void Initalize()
{
sessionRepository.Setup(x => x.GetAllForUser(It.IsAny<string>())).Returns(() => { return new List<Session>(); });
badgeAwardRepository.Setup(x => x.Add(It.IsAny<BadgeAward>())).Returns(() =>
{
return new BadgeAward() {C_BadgeId = RepertoireRule.KeyId};
}).Verifiable();
PracticeTimeLibResolver.Instance.Container.RegisterInstance(typeof(ISessionRepository), sessionRepository.Object);
PracticeTimeLibResolver.Instance.Container.RegisterInstance(typeof(IBadgeAwardRepository), badgeAwardRepository.Object);
}
[TestMethod]
public void ConstrutorTest()
{
RepertoireRule rule = new RepertoireRule(sessionRepository.Object,badgeAwardRepository.Object);
Assert.IsNotNull(rule);
IRepertoireRule iRule = PracticeTimeLibResolver.Instance.Container.Resolve<IRepertoireRule>();
Assert.IsNotNull(iRule);
}
[TestMethod]
public void RuleDoesntApplyTest()
{
sessionRepository.Setup(x => x.GetAllForUser(It.IsAny<string>())).Returns(() => { return new List<Session>()
{
new Session(){Title = "1"},
new Session(){Title = "2"},
new Session(){Title = "3"},
new Session(){Title = "4"},
new Session(){Title = "5"},
new Session(){Title = "6"},
new Session(){Title = "7"},
new Session(){Title = "8"},
new Session(){Title = "9"},
};
});
PracticeTimeLibResolver.Instance.Container.RegisterInstance(typeof (ISessionRepository),
sessionRepository.Object);
IRepertoireRule rule = PracticeTimeLibResolver.Instance.Container.Resolve<IRepertoireRule>();
ResponseModel model = new ResponseModel();
rule.Rule(new Session(), model);
Assert.IsFalse(model.HasNewBadges);
}
[TestMethod]
public void RuleAppliesTest()
{
sessionRepository.Setup(x => x.GetAllForUser(It.IsAny<string>())).Returns(() =>
{
return new List<Session>()
{
new Session(){Title = "1"},
new Session(){Title = "2"},
new Session(){Title = "3"},
new Session(){Title = "4"},
new Session(){Title = "5"},
new Session(){Title = "6"},
new Session(){Title = "7"},
new Session(){Title = "8"},
new Session(){Title = "9"},
new Session(){Title = "10"},
};
});
PracticeTimeLibResolver.Instance.Container.RegisterInstance(typeof(ISessionRepository),
sessionRepository.Object);
IRepertoireRule rule = PracticeTimeLibResolver.Instance.Container.Resolve<IRepertoireRule>();
ResponseModel model = new ResponseModel();
rule.Rule(new Session(), model);
Assert.IsTrue(model.HasNewBadges);
Assert.IsTrue(model.NewBadges.Count == 1);
Assert.AreEqual(RepertoireRule.KeyId, model.NewBadges.First().C_BadgeId);
Assert.AreEqual(0, model.Badges.Count);
}
[TestMethod]
public void RuleHasBadgeTest()
{
sessionRepository.Setup(x => x.GetAllForUser(It.IsAny<string>())).Returns(() =>
{
return new List<Session>()
{
new Session(){Title = "1"},
new Session(){Title = "2"},
new Session(){Title = "3"},
new Session(){Title = "4"},
new Session(){Title = "5"},
new Session(){Title = "6"},
new Session(){Title = "7"},
new Session(){Title = "8"},
new Session(){Title = "9"},
new Session(){Title = "10"},
};
});
badgeAwardRepository.Setup(x => x.GetAllForUser(It.IsAny<string>())).Returns(() =>
{
return new List<BadgeAward>()
{
new BadgeAward() {C_BadgeId = RepertoireRule.KeyId }
};
}).Verifiable();
PracticeTimeLibResolver.Instance.Container.RegisterInstance(typeof(ISessionRepository),
sessionRepository.Object);
IRepertoireRule rule = PracticeTimeLibResolver.Instance.Container.Resolve<IRepertoireRule>();
ResponseModel model = new ResponseModel(){Badges = badgeAwardRepository.Object.GetAllForUser("")};
rule.Rule(new Session(), model);
Assert.IsFalse(model.HasNewBadges);
Assert.IsTrue(model.NewBadges.Count == 0);
Assert.AreEqual(1, model.Badges.Count);
sessionRepository.Verify(x => x.GetAllForUser(It.IsAny<string>()),Times.Never);
}
}
}
| 41.121429 | 132 | 0.562098 | [
"Apache-2.0"
] | wbsimms/PracticeTime | src/Web/PracticeTime.Web.Lib.Test/BadgeRules/RepertoireRuleTest.cs | 5,759 | C# |
//
// DateSearchQuery.cs
//
// Author: Jeffrey Stedfast <jestedfa@microsoft.com>
//
// Copyright (c) 2013-2019 Xamarin Inc. (www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
using System;
namespace MailKit.Search {
/// <summary>
/// A date-based search query.
/// </summary>
/// <remarks>
/// A date-based search query.
/// </remarks>
public class DateSearchQuery : SearchQuery
{
/// <summary>
/// Initializes a new instance of the <see cref="T:MailKit.Search.DateSearchQuery"/> class.
/// </summary>
/// <remarks>
/// Creates a new date-based search query.
/// </remarks>
/// <param name="term">The search term.</param>
/// <param name="date">The date.</param>
public DateSearchQuery (SearchTerm term, DateTime date) : base (term)
{
Date = date;
}
/// <summary>
/// Gets the date value of the search query.
/// </summary>
/// <remarks>
/// Gets the date value of the search query.
/// </remarks>
/// <value>The date.</value>
public DateTime Date {
get; private set;
}
}
}
| 32.984127 | 93 | 0.698749 | [
"MIT"
] | AlexxxTremer/MailKit | MailKit/Search/DateSearchQuery.cs | 2,080 | C# |
////////////////////////////////////////////////////////////////////////////////
//NUnit tests for "EF Core Provider for LCPI OLE DB"
// IBProvider and Contributors. 09.05.2021.
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using NUnit.Framework;
using xdb=lcpi.data.oledb;
namespace EFCore_LcpiOleDb_Tests.General.Work.DBMS.Firebird.V03_0_0.D1.Query.Operators.SET_001.Equal.Complete.NullableDECIMAL_6_1.Int64{
////////////////////////////////////////////////////////////////////////////////
using T_DATA1 =System.Nullable<System.Decimal>;
using T_DATA2 =System.Int64;
using T_DATA1_U=System.Decimal;
using T_DATA2_U=System.Int64;
////////////////////////////////////////////////////////////////////////////////
//class TestSet_001__fields__01__VV
public static class TestSet_001__fields__01__VV
{
private const string c_NameOf__TABLE ="TEST_MODIFY_ROW2";
private const string c_NameOf__COL_DATA1 ="COL_DEC_6_1";
private const string c_NameOf__COL_DATA2 ="COL2_BIGINT";
private sealed class MyContext:TestBaseDbContext
{
[Table(c_NameOf__TABLE)]
public sealed class TEST_RECORD
{
[Key]
[Column("TEST_ID")]
public System.Int64? TEST_ID { get; set; }
[Column(c_NameOf__COL_DATA1, TypeName="DECIMAL(6,1)")]
public T_DATA1 COL_DATA1 { get; set; }
[Column(c_NameOf__COL_DATA2)]
public T_DATA2 COL_DATA2 { get; set; }
};//class TEST_RECORD
//----------------------------------------------------------------------
public DbSet<TEST_RECORD> testTable { get; set; }
//----------------------------------------------------------------------
public MyContext(xdb.OleDbTransaction tr)
:base(tr)
{
}//MyContext
};//class MyContext
//-----------------------------------------------------------------------
[Test]
public static void Test_001()
{
using(var cn=LocalCnHelper.CreateCn())
{
cn.Open();
using(var tr=cn.BeginTransaction())
{
//insert new record in external transaction
using(var db=new MyContext(tr))
{
const T_DATA1_U c_value1=4;
const T_DATA2_U c_value2=4;
System.Int64? testID=Helper__InsertRow(db,c_value1,c_value2);
var recs=db.testTable.Where(r => (r.COL_DATA1 /*OP{*/ == /*}OP*/ r.COL_DATA2) && r.TEST_ID==testID);
int nRecs=0;
foreach(var r in recs)
{
Assert.AreEqual
(0,
nRecs);
++nRecs;
Assert.IsTrue
(r.TEST_ID.HasValue);
Assert.AreEqual
(testID,
r.TEST_ID.Value);
Assert.AreEqual
(c_value1,
r.COL_DATA1);
Assert.AreEqual
(c_value2,
r.COL_DATA2);
}//foreach r
db.CheckTextOfLastExecutedCommand
(new TestSqlTemplate()
.T("SELECT ").N("t","TEST_ID").T(", ").N("t",c_NameOf__COL_DATA1).T(", ").N("t",c_NameOf__COL_DATA2).EOL()
.T("FROM ").N(c_NameOf__TABLE).T(" AS ").N("t").EOL()
.T("WHERE (").N("t",c_NameOf__COL_DATA1).T(" = ").N("t",c_NameOf__COL_DATA2).T(") AND (").N("t","TEST_ID").T(" = ").P_ID("__testID_0").T(")"));
Assert.AreEqual
(1,
nRecs);
}//using db
tr.Rollback();
}//using tr
}//using cn
}//Test_001
//Helper methods --------------------------------------------------------
private static System.Int64 Helper__InsertRow(MyContext db,
T_DATA1 valueForColData1,
T_DATA2 valueForColData2)
{
var newRecord=new MyContext.TEST_RECORD();
newRecord.COL_DATA1 =valueForColData1;
newRecord.COL_DATA2 =valueForColData2;
db.testTable.Add(newRecord);
db.SaveChanges();
db.CheckTextOfLastExecutedCommand
(new TestSqlTemplate()
.T("INSERT INTO ").N(c_NameOf__TABLE).T(" (").N(c_NameOf__COL_DATA1).T(", ").N(c_NameOf__COL_DATA2).T(")").EOL()
.T("VALUES (").P("p0").T(", ").P("p1").T(")").EOL()
.T("RETURNING ").N("TEST_ID").EOL()
.T("INTO ").P("p2").T(";"));
Assert.IsTrue
(newRecord.TEST_ID.HasValue);
Console.WriteLine("TEST_ID: {0}",newRecord.TEST_ID.Value);
return newRecord.TEST_ID.Value;
}//Helper__InsertRow
};//class TestSet_001__fields__01__VV
////////////////////////////////////////////////////////////////////////////////
}//namespace EFCore_LcpiOleDb_Tests.General.Work.DBMS.Firebird.V03_0_0.D1.Query.Operators.SET_001.Equal.Complete.NullableDECIMAL_6_1.Int64
| 30.006623 | 151 | 0.566542 | [
"MIT"
] | ibprovider/Lcpi.EFCore.LcpiOleDb | Tests/General/Source/Work/DBMS/Firebird/V03_0_0/D1/Query/Operators/SET_001/Equal/Complete/NullableDECIMAL_6_1/Int64/TestSet_001__fields__01__VV.cs | 4,533 | C# |
using System;
using System.Collections.Generic;
using System.IO;
#if PORTABLE
using BrightstarDB.Portable.Compatibility;
#endif
namespace BrightstarDB.Storage.Statistics
{
internal class PersistentStatisticsLog : IStoreStatisticsLog
{
private readonly IPersistenceManager _persistenceManager;
private readonly string _storeLocation;
public PersistentStatisticsLog(IPersistenceManager persistenceManager, string storeLocation)
{
_persistenceManager = persistenceManager;
_storeLocation = storeLocation;
}
private string GetStatisticsLogFile()
{
return Path.Combine(_storeLocation, "stats.bs");
}
private string GetStatisticsHeaderFile()
{
return Path.Combine(_storeLocation, "statsheaders.bs");
}
public IEnumerable<StoreStatistics> GetStatistics()
{
if (!_persistenceManager.FileExists(GetStatisticsHeaderFile())) yield break;
using (var headerStream = _persistenceManager.GetInputStream(GetStatisticsHeaderFile()))
{
using (var headerReader = new BinaryReader(headerStream))
{
using (
var recordStream =
_persistenceManager.GetInputStream(GetStatisticsLogFile()))
{
long offset = headerStream.Length - StoreStatisticsHeaderRecord.RecordSize;
while (offset >= 0)
{
headerReader.BaseStream.Seek(offset, SeekOrigin.Begin);
var header = StoreStatisticsHeaderRecord.Load(headerReader);
recordStream.Seek(header.StartOffset, SeekOrigin.Begin);
var recordReader = new StreamReader(recordStream);
var record = StoreStatisticsRecord.Load(recordReader);
yield return
new StoreStatistics(header.CommitNumber, header.Timestamp, record.TotalTripleCount,
record.PredicateTripleCounts);
offset -= StoreStatisticsHeaderRecord.RecordSize;
}
}
}
}
}
public void AppendStatistics(StoreStatistics statistics)
{
using (
var headerWriter =
new BinaryWriter(_persistenceManager.GetOutputStream(GetStatisticsHeaderFile(), FileMode.Append)))
{
using (
var recordWriter =
new StreamWriter(_persistenceManager.GetOutputStream(GetStatisticsLogFile(),
FileMode.Append)))
{
var recordStart = recordWriter.BaseStream.Position;
var record = new StoreStatisticsRecord(statistics.CommitNumber, statistics.TripleCount,
statistics.PredicateTripleCounts);
var header = new StoreStatisticsHeaderRecord(statistics.CommitNumber, statistics.CommitTime,
recordStart);
record.Save(recordWriter);
header.Save(headerWriter);
recordWriter.Flush();
headerWriter.Flush();
recordWriter.Close();
headerWriter.Close();
}
}
}
}
} | 43.151163 | 118 | 0.531932 | [
"MIT"
] | rajcybage/BrightstarDB | src/core/BrightstarDB/Storage/Statistics/PersistentStatisticsLog.cs | 3,713 | C# |
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using UnityEngine;
class SongParser
{
public static bool ParseSongFile(string path, Encoding enc = null)
{
Note lastNote = null; //Holds last parsed note. Get's reset on player change
bool endFound = false; // True if end tag was found
int player = 1;
char[] trimChars = { ' ', ':' };
char[] splitChars = { ' ' };
Dictionary<ESongHeader, System.Object> headers = new Dictionary<ESongHeader, System.Object>();
List<List<Sentence>> voicesSentences = new List<List<Sentence>>
{
new List<Sentence>(),
new List<Sentence>(),
new List<Sentence>()
};
try
{
using (StreamReader reader = TxtReader.GetFileStreamReader(path, enc))
{
bool finishedHeaders = false;
string directory = new FileInfo(path).Directory.FullName;
while (!reader.EndOfStream)
{
string line = reader.ReadLine();
if (line == "" || line[0].Equals(" ")
|| (finishedHeaders && line[0].Equals('#')))
{
Debug.Log(String.Format("Invalid linestart found in {0} :: \"{1}\". Aborting.", path, line);
return false;
}
if (!finishedHeaders && line[0].Equals('#'))
{
int pos = line.IndexOf(":", StringComparison.Ordinal);
string identifier = line.Substring(1, pos - 1).Trim().ToUpper();
if (identifier.Contains(" ") || identifier.Length < 2)
{
HandleParsingError("invalid file...", EParsingErrorSeverity.Critical);
continue;
}
string tag = line.Substring(pos + 1).Trim();
if (tag.Equals(string.Empty))
{
// invalid tag.
HandleParsingError("Invalid empty tag found", EParsingErrorSeverity.Minor);
continue;
}
if (identifier.Equals("ENCODING"))
{
if (tag.Equals("UTF8"))
{
tag = "UTF-8";
}
Encoding newEncoding = Encoding.GetEncoding(tag);
if (!newEncoding.Equals(reader.CurrentEncoding))
{
reader.Dispose();
return ParseSongFile(path, newEncoding);
}
}
identifier = ParseHeaderField(headers, directory, identifier, tag);
}
else
{
if (!finishedHeaders)
{
finishedHeaders = true;
}
ParseLyricsTxtLine(ref lastNote, ref endFound, ref player, trimChars, splitChars, ref line);
}
}
if (reader.EndOfStream && !finishedHeaders)
{
HandleParsingError("Lyrics/Notes missing", EParsingErrorSeverity.Critical);
}
CheckMinimalRequiredHeaders(headers);
}
}
catch (Exception e)
{
Debug.Log("Error reading song file" + e.Message);
return false;
}
Song song = new Song(headers, voicesSentences, path);
SongsManager.AddSongs(song);
return true;
}
private static void CheckMinimalRequiredHeaders(Dictionary<ESongHeader, object> headers)
{
if (headers[ESongHeader.Title] == null)
{
HandleParsingError("Title tag missing", EParsingErrorSeverity.Critical);
}
if (headers[ESongHeader.Artist] == null)
{
HandleParsingError("Artist tag missing", EParsingErrorSeverity.Critical);
}
if (headers[ESongHeader.Mp3] == null)
{
HandleParsingError("MP3 tag missing", EParsingErrorSeverity.Critical);
}
if (headers[ESongHeader.Bpm] == null)
{
HandleParsingError("BPM tag missing", EParsingErrorSeverity.Critical);
}
}
private static void ParseLyricsTxtLine(ref Note lastNote, ref bool endFound, ref int player, char[] trimChars, char[] splitChars, ref string line)
{
char tag = line[0];
line = (line.Length >= 2 && line[1] == ' ') ? line.Substring(2) : line.Substring(1);
int startBeat, length;
switch (tag)
{
case 'E':
endFound = true;
break;
case 'P':
line = line.Trim(trimChars);
if (!int.TryParse(line, out player))
{
HandleParsingError("Wrong or missing number after \"P\"", EParsingErrorSeverity.Critical);
}
lastNote = null;
break;
case ':':
case '*':
case 'F':
string[] noteData = line.Split(splitChars, 4);
if (noteData.Length < 4)
{
if (noteData.Length == 3)
{
HandleParsingError("Ignored note without text", EParsingErrorSeverity.Minor);
break;
}
HandleParsingError("Invalid note found", EParsingErrorSeverity.Critical);
}
int pitch;
if (!int.TryParse(noteData[0], out startBeat)
|| !int.TryParse(noteData[1], out length)
|| !int.TryParse(noteData[2], out pitch))
{
HandleParsingError("Invalid note found (non-numeric values)", EParsingErrorSeverity.Critical);
break;
}
string text = TxtReader.NormalizeWhiteSpaceForLoop(noteData[3]);
if (text == "")
{
HandleParsingError("Ignored note without text", EParsingErrorSeverity.Minor);
break;
}
ENoteType noteType;
if (tag.Equals('*'))
{
noteType = ENoteType.Golden;
}
else if (tag.Equals('F'))
{
noteType = ENoteType.Freestyle;
}
else
{
noteType = ENoteType.Normal;
}
lastNote = new Note(pitch, startBeat, length, text, noteType);
break;
case '-':
string[] lineBreakData = line.Split(splitChars);
if (lineBreakData.Length < 1)
{
HandleParsingError("Invalid line break found (No beat)", EParsingErrorSeverity.Critical);
}
if (!int.TryParse(lineBreakData[0], out startBeat))
{
HandleParsingError("Invalid line break found (Non-numeric value)", EParsingErrorSeverity.Critical);
}
if (lastNote != null && startBeat <= lastNote.m_startBeat + lastNote.m_length - 1)
{
HandleParsingError("Line break is before previous note end. Adjusted.", EParsingErrorSeverity.Minor);
startBeat = lastNote.m_startBeat + lastNote.m_length;
}
if (startBeat < 1)
{
HandleParsingError("Ignored line break because position is < 1", EParsingErrorSeverity.Minor);
}
break;
default:
HandleParsingError("Unexpected or missing character (" + tag + ")", EParsingErrorSeverity.Critical);
break;
}
}
private static string ParseHeaderField(Dictionary<ESongHeader, object> headers, string directory, string identifier, string fieldValue)
{
switch (identifier)
{
case "ENCODING":
// handled outside the switch. Nothing to do here
break;
case "TITLE":
headers[ESongHeader.Title] = fieldValue.Trim();
break;
case "ARTIST":
headers[ESongHeader.Artist] = fieldValue.Trim();
break;
case "CREATOR":
case "AUTHOR":
case "AUTOR":
headers[ESongHeader.Creator] = fieldValue.Trim();
break;
case "MP3":
if (File.Exists(Path.Combine(directory, fieldValue.Trim())))
{
headers[ESongHeader.Mp3] = fieldValue.Trim();
}
else
{
HandleParsingError("Can't find audio file: " + Path.Combine(directory, fieldValue), EParsingErrorSeverity.Critical);
}
break;
case "BPM":
float result;
if (TryParse(fieldValue, out result))
{
headers[ESongHeader.Bpm] = result;
}
else
{
HandleParsingError("Invalid BPM value", EParsingErrorSeverity.Critical);
}
break;
case "EDITION":
if (fieldValue.Length > 1)
{
headers[ESongHeader.Edition] = fieldValue.Trim();
}
else
{
HandleParsingError("Invalid edition", EParsingErrorSeverity.Minor);
}
break;
case "GENRE":
if (fieldValue.Length > 1)
{
headers[ESongHeader.Genre] = fieldValue.Trim();
}
else
{
HandleParsingError("Invalid genre", EParsingErrorSeverity.Minor);
}
break;
case "ALBUM":
headers[ESongHeader.Edition] = fieldValue.Trim();
break;
case "YEAR":
int num;
if (fieldValue.Length == 4 && int.TryParse(fieldValue, out num) && num > 0)
{
headers[ESongHeader.Year] = num;
}
else
{
HandleParsingError("Invalid year", EParsingErrorSeverity.Minor);
}
break;
case "LANGUAGE":
if (fieldValue.Length > 1)
{
headers[ESongHeader.Language] = fieldValue.Trim();
}
else
{
HandleParsingError("Invalid language", EParsingErrorSeverity.Minor);
}
break;
case "GAP":
float resultGap;
if (TryParse(fieldValue, out resultGap))
{
headers[ESongHeader.Gap] = resultGap / 1000f;
}
else
{
HandleParsingError("Invalid gap", EParsingErrorSeverity.Minor);
}
break;
case "COVER":
if (File.Exists(Path.Combine(directory, fieldValue)))
{
headers[ESongHeader.Cover] = fieldValue;
}
else
{
HandleParsingError("Can't find cover file: " + Path.Combine(directory, fieldValue), EParsingErrorSeverity.Minor);
}
break;
case "BACKGROUND":
if (File.Exists(Path.Combine(directory, fieldValue)))
{
headers[ESongHeader.Background] = fieldValue;
}
else
{
HandleParsingError("Can't find background file: " + Path.Combine(directory, fieldValue), EParsingErrorSeverity.Minor);
}
break;
case "VIDEO":
if (File.Exists(Path.Combine(directory, fieldValue)))
{
headers[ESongHeader.Video] = fieldValue;
}
else
{
HandleParsingError("Can't find video file: " + Path.Combine(directory, fieldValue), EParsingErrorSeverity.Minor);
}
break;
case "VIDEOGAP":
float resultVideoGap;
if (TryParse(fieldValue, out resultVideoGap))
{
headers[ESongHeader.Videogap] = resultVideoGap;
}
else
{
HandleParsingError("Invalid videogap", EParsingErrorSeverity.Minor);
}
break;
case "START":
float resultStart;
if (TryParse(fieldValue, out resultStart))
{
headers[ESongHeader.Start] = resultStart;
}
else
{
HandleParsingError("Invalid start", EParsingErrorSeverity.Critical);
}
break;
case "END":
float resultFinish;
if (TryParse(fieldValue, out resultFinish))
{
headers[ESongHeader.End] = resultFinish / 1000f;
}
else
{
HandleParsingError("Invalid end", EParsingErrorSeverity.Critical);
}
break;
default:
if (identifier.StartsWith("DUETSINGER"))
{
identifier = identifier.Substring(10);
if (!identifier.StartsWith("P"))
{
identifier = "P" + identifier;
}
}
if (!identifier.StartsWith("P"))
{
HandleParsingError("Unknown tag: #" + identifier, EParsingErrorSeverity.Minor);
}
break;
}
return identifier;
}
private static bool TryParse<T>(string input, out T result, bool ignoreCase = false)
where T : struct
{
result = default(T);
try
{
result = (T)Enum.Parse(typeof(T), input, ignoreCase);
return true;
}
catch (Exception e)
{
Debug.Log(e);
}
return false;
}
private static bool TryParse(string input, out float result)
{
string inputAsWeWant = input.Replace(',', '.');
return Single.TryParse(inputAsWeWant, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, NumberFormatInfo.InvariantInfo, out result);
}
private static void HandleParsingError(string errorMessage, EParsingErrorSeverity errorSeverity)
{
switch (errorSeverity)
{
case EParsingErrorSeverity.Critical:
throw new SongParserException("Critical parsing error in file.\nInner error message: " + errorMessage);
default:
Debug.Log(errorMessage);
break;
}
}
enum EParsingErrorSeverity
{
Minor,
Critical
}
}
public class SongParserException : Exception
{
public SongParserException(string message)
: base(message)
{
}
public SongParserException(string message, Exception innerException)
: base(message, innerException)
{
}
}
| 35.49453 | 154 | 0.463473 | [
"MIT"
] | frankkienl/Play | UltraStar Play/Assets/src/model/song/SongParser.cs | 16,223 | C# |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.SignalR.Internal;
using Moq;
using Xunit;
namespace Microsoft.AspNetCore.SignalR.Tests
{
public class ClientHubProxyTests
{
public class FakeHub : Hub
{
}
[Fact]
public async Task UserProxy_SendAsync_ArrayArgumentNotExpanded()
{
object[] resultArgs = null;
var o = new Mock<HubLifetimeManager<FakeHub>>();
o.Setup(
m =>
m.SendUserAsync(
It.IsAny<string>(),
It.IsAny<string>(),
It.IsAny<object[]>(),
It.IsAny<CancellationToken>()
)
)
.Callback<string, string, object[], CancellationToken>(
(userId, methodName, args, _) =>
{
resultArgs = args;
}
)
.Returns(Task.CompletedTask);
var proxy = new UserProxy<FakeHub>(o.Object, string.Empty);
var data = Encoding.UTF8.GetBytes("Hello world");
await proxy.SendAsync("Method", data);
Assert.NotNull(resultArgs);
var arg = (byte[])Assert.Single(resultArgs);
Assert.Same(data, arg);
}
[Fact]
public async Task MultipleUserProxy_SendAsync_ArrayArgumentNotExpanded()
{
object[] resultArgs = null;
var o = new Mock<HubLifetimeManager<FakeHub>>();
o.Setup(
m =>
m.SendUsersAsync(
It.IsAny<IReadOnlyList<string>>(),
It.IsAny<string>(),
It.IsAny<object[]>(),
It.IsAny<CancellationToken>()
)
)
.Callback<IReadOnlyList<string>, string, object[], CancellationToken>(
(userIds, methodName, args, _) =>
{
resultArgs = args;
}
)
.Returns(Task.CompletedTask);
var proxy = new MultipleUserProxy<FakeHub>(o.Object, new List<string>());
var data = Encoding.UTF8.GetBytes("Hello world");
await proxy.SendAsync("Method", data);
Assert.NotNull(resultArgs);
var arg = (byte[])Assert.Single(resultArgs);
Assert.Same(data, arg);
}
[Fact]
public async Task GroupProxy_SendAsync_ArrayArgumentNotExpanded()
{
object[] resultArgs = null;
var o = new Mock<HubLifetimeManager<FakeHub>>();
o.Setup(
m =>
m.SendGroupAsync(
It.IsAny<string>(),
It.IsAny<string>(),
It.IsAny<object[]>(),
It.IsAny<CancellationToken>()
)
)
.Callback<string, string, object[], CancellationToken>(
(groupName, methodName, args, _) =>
{
resultArgs = args;
}
)
.Returns(Task.CompletedTask);
var proxy = new GroupProxy<FakeHub>(o.Object, string.Empty);
var data = Encoding.UTF8.GetBytes("Hello world");
await proxy.SendAsync("Method", data);
Assert.NotNull(resultArgs);
var arg = (byte[])Assert.Single(resultArgs);
Assert.Same(data, arg);
}
[Fact]
public async Task MultipleGroupProxy_SendAsync_ArrayArgumentNotExpanded()
{
object[] resultArgs = null;
var o = new Mock<HubLifetimeManager<FakeHub>>();
o.Setup(
m =>
m.SendGroupsAsync(
It.IsAny<IReadOnlyList<string>>(),
It.IsAny<string>(),
It.IsAny<object[]>(),
It.IsAny<CancellationToken>()
)
)
.Callback<IReadOnlyList<string>, string, object[], CancellationToken>(
(groupNames, methodName, args, _) =>
{
resultArgs = args;
}
)
.Returns(Task.CompletedTask);
var proxy = new MultipleGroupProxy<FakeHub>(o.Object, new List<string>());
var data = Encoding.UTF8.GetBytes("Hello world");
await proxy.SendAsync("Method", data);
Assert.NotNull(resultArgs);
var arg = (byte[])Assert.Single(resultArgs);
Assert.Same(data, arg);
}
[Fact]
public async Task GroupExceptProxy_SendAsync_ArrayArgumentNotExpanded()
{
object[] resultArgs = null;
var o = new Mock<HubLifetimeManager<FakeHub>>();
o.Setup(
m =>
m.SendGroupExceptAsync(
It.IsAny<string>(),
It.IsAny<string>(),
It.IsAny<object[]>(),
It.IsAny<IReadOnlyList<string>>(),
It.IsAny<CancellationToken>()
)
)
.Callback<string, string, object[], IReadOnlyList<string>, CancellationToken>(
(groupName, methodName, args, excludedConnectionIds, _) =>
{
resultArgs = args;
}
)
.Returns(Task.CompletedTask);
var proxy = new GroupExceptProxy<FakeHub>(o.Object, string.Empty, new List<string>());
var data = Encoding.UTF8.GetBytes("Hello world");
await proxy.SendAsync("Method", data);
Assert.NotNull(resultArgs);
var arg = (byte[])Assert.Single(resultArgs);
Assert.Same(data, arg);
}
[Fact]
public async Task AllClientProxy_SendAsync_ArrayArgumentNotExpanded()
{
object[] resultArgs = null;
var o = new Mock<HubLifetimeManager<FakeHub>>();
o.Setup(
m =>
m.SendAllAsync(
It.IsAny<string>(),
It.IsAny<object[]>(),
It.IsAny<CancellationToken>()
)
)
.Callback<string, object[], CancellationToken>(
(methodName, args, _) =>
{
resultArgs = args;
}
)
.Returns(Task.CompletedTask);
var proxy = new AllClientProxy<FakeHub>(o.Object);
var data = Encoding.UTF8.GetBytes("Hello world");
await proxy.SendAsync("Method", data);
Assert.NotNull(resultArgs);
var arg = (byte[])Assert.Single(resultArgs);
Assert.Same(data, arg);
}
[Fact]
public async Task AllClientsExceptProxy_SendAsync_ArrayArgumentNotExpanded()
{
object[] resultArgs = null;
var o = new Mock<HubLifetimeManager<FakeHub>>();
o.Setup(
m =>
m.SendAllExceptAsync(
It.IsAny<string>(),
It.IsAny<object[]>(),
It.IsAny<IReadOnlyList<string>>(),
It.IsAny<CancellationToken>()
)
)
.Callback<string, object[], IReadOnlyList<string>, CancellationToken>(
(methodName, args, excludedConnectionIds, _) =>
{
resultArgs = args;
}
)
.Returns(Task.CompletedTask);
var proxy = new AllClientsExceptProxy<FakeHub>(o.Object, new List<string>());
var data = Encoding.UTF8.GetBytes("Hello world");
await proxy.SendAsync("Method", data);
Assert.NotNull(resultArgs);
var arg = (byte[])Assert.Single(resultArgs);
Assert.Same(data, arg);
}
[Fact]
public async Task SingleClientProxy_SendAsync_ArrayArgumentNotExpanded()
{
object[] resultArgs = null;
var o = new Mock<HubLifetimeManager<FakeHub>>();
o.Setup(
m =>
m.SendConnectionAsync(
It.IsAny<string>(),
It.IsAny<string>(),
It.IsAny<object[]>(),
It.IsAny<CancellationToken>()
)
)
.Callback<string, string, object[], CancellationToken>(
(connectionId, methodName, args, _) =>
{
resultArgs = args;
}
)
.Returns(Task.CompletedTask);
var proxy = new SingleClientProxy<FakeHub>(o.Object, string.Empty);
var data = Encoding.UTF8.GetBytes("Hello world");
await proxy.SendAsync("Method", data);
Assert.NotNull(resultArgs);
var arg = (byte[])Assert.Single(resultArgs);
Assert.Same(data, arg);
}
[Fact]
public async Task MultipleClientProxy_SendAsync_ArrayArgumentNotExpanded()
{
object[] resultArgs = null;
var o = new Mock<HubLifetimeManager<FakeHub>>();
o.Setup(
m =>
m.SendConnectionsAsync(
It.IsAny<IReadOnlyList<string>>(),
It.IsAny<string>(),
It.IsAny<object[]>(),
It.IsAny<CancellationToken>()
)
)
.Callback<IReadOnlyList<string>, string, object[], CancellationToken>(
(connectionIds, methodName, args, _) =>
{
resultArgs = args;
}
)
.Returns(Task.CompletedTask);
var proxy = new MultipleClientProxy<FakeHub>(o.Object, new List<string>());
var data = Encoding.UTF8.GetBytes("Hello world");
await proxy.SendAsync("Method", data);
Assert.NotNull(resultArgs);
var arg = (byte[])Assert.Single(resultArgs);
Assert.Same(data, arg);
}
}
}
| 34.17737 | 111 | 0.456246 | [
"Apache-2.0"
] | belav/aspnetcore | src/SignalR/server/SignalR/test/ClientProxyTests.cs | 11,176 | C# |
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
using System.Xml;
using static Chessar.UnitTests.Utils;
using static Microsoft.VisualStudio.TestTools.UnitTesting.Assert;
namespace Chessar.UnitTests
{
partial class XmlWriterTests
{
[TestMethod]
public void XmlWriter_Create() => XmlWriterCreate(false);
[TestMethod]
public void XmlWriter_Create_UNC() => XmlWriterCreate(true);
[TestMethod]
public void XmlWriter_CreateWithSettings() => XmlWriterCreate(false, XmlWSettings);
[TestMethod]
public void XmlWriter_CreateWithSettings_UNC() => XmlWriterCreate(true, XmlWSettings);
[TestMethod]
public void XmlWriter_CreateWithLongPrefix() => XmlWriterCreate(false, withPrefix: true);
[TestMethod]
public void XmlWriter_CreateWithLongPrefix_UNC() => XmlWriterCreate(true, withPrefix: true);
private static void XmlWriterCreate(in bool asNetwork, XmlWriterSettings settings = null, in bool withPrefix = false)
{
var (path, pathWithPrefix) = CreateLongTempFile(true, in asNetwork);
var xmlFile = withPrefix ? pathWithPrefix : path;
using (var xw = settings != null ? XmlWriter.Create(xmlFile) : XmlWriter.Create(xmlFile, settings))
{
xw.WriteStartDocument();
xw.WriteStartElement("Root");
xw.WriteElementString("Element", "Value");
xw.WriteEndElement();
xw.WriteEndDocument();
}
IsTrue(File.Exists(pathWithPrefix));
}
}
}
| 33.895833 | 125 | 0.655194 | [
"MIT"
] | chessar/LongPaths | UnitTests/XmlWriter/Create.cs | 1,629 | C# |
using System.Linq;
using JetBrains.Annotations;
using Sprite;
namespace System.Security.Claims
{
public static class ClaimsIdentityExtensions
{
[CanBeNull]
#nullable enable
public static Claim? GetCurrentUser([NotNull] this ClaimsPrincipal principal)
{
Check.NotNull(principal, nameof(principal));
if (!IsAuthenticated(principal))
{
return null;
}
var id = principal.Claims?.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier);
if (id == null || id.Value.IsNullOrWhiteSpace())
{
return null;
}
return id;
}
// public static T? GetCurrentUserId<T>([NotNull] this ClaimsPrincipal principal)
// {
// Check.NotNull(principal, nameof(principal));
// if (IsAuthenticated(principal))
// {
// return new T?();
// }
//
// var id = principal.Claims?.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier);
// if (id == null || id.Value.IsNullOrWhiteSpace())
// {
// return new T?();
// }
//
// var changeValue = (T)Convert.ChangeType(id, typeof(T));
// return changeValue;
// }
public static bool IsAuthenticated([NotNull] this ClaimsPrincipal principal)
{
Check.NotNull(principal, nameof(principal));
return principal.Identity?.IsAuthenticated ?? false;
}
}
} | 30.673077 | 99 | 0.529154 | [
"Apache-2.0"
] | beango-project/beango-framework | framework/src/Sprite.Core/System/Security/Claims/ClaimsIdentityExtensions.cs | 1,597 | C# |
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Project1.Library.Interfaces;
using Project1.Library.Models;
using Project1.WebApp.Models;
using System;
using System.Linq;
namespace Project1.WebApp.Controllers {
public class CustomerController : Controller {
private readonly IStoreRepository _repository;
private readonly ILogger<CustomerController> _logger;
public CustomerController(IStoreRepository repository, ILogger<CustomerController> logger) {
_repository = repository;
_logger = logger;
}
// GET: CustomerController
public ActionResult Index([FromQuery]string searchFirstName = "", [FromQuery]string searchLastName = "") {
if (!TempData.ContainsKey("IsAdmin")) {
_logger.LogInformation($"User Access denied to Customer/Index page at {DateTime.Now}");
return StatusCode(401);
}
var customers = _repository.GetCustomersByName(searchFirstName, searchLastName);
var viewModels = customers.Select(c => new CustomerViewModel {
Id = c.Id,
FirstName = c.FirstName,
LastName = c.LastName,
Email = c.Email
});
ViewData["FirstName"] = searchFirstName;
ViewData["LastName"] = searchLastName;
_logger.LogInformation($"Visited Customer/Index with search params {nameof(searchFirstName)}={searchFirstName}, {nameof(searchLastName)}={searchLastName} at {DateTime.Now}");
return View(viewModels);
}
// GET: CustomerController/Details/5
public ActionResult Details(int id) {
if (!TempData.ContainsKey("IsAdmin") && id != (int)TempData.Peek("CurrentCustomer")) {
_logger.LogInformation($"User Access denied to Customer/Details page at {DateTime.Now}");
return StatusCode(401);
}
var customer = _repository.GetCustomerById(id);
var viewModel = new CustomerViewModel {
Id = customer.Id,
FirstName = customer.FirstName,
LastName = customer.LastName,
Email = customer.Email
};
_logger.LogInformation($"Visited Customer/Details with params {nameof(id)}={id} at {DateTime.Now}");
return View(viewModel);
}
// GET: CustomerController/Create
public ActionResult Register() {
_logger.LogInformation($"Visited Customer/Register at {DateTime.Now}");
return View();
}
// POST: CustomerController/Create
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Register(CustomerViewModel viewModel) {
if (!ModelState.IsValid) {
_logger.LogWarning($"Encountered error registering new customer, returning to registration page at {DateTime.Now}");
return View(viewModel);
}
try {
var customer = new Customer(viewModel.FirstName, viewModel.LastName, viewModel.Email);
_repository.AddCustomer(customer);
_repository.Save();
var dbCustomer = _repository.GetCustomerByEmail(customer.Email);
if (!TempData.ContainsKey("CurrentCustomer")) {
TempData["CurrentCustomer"] = dbCustomer.Id;
TempData["CustomerName"] = dbCustomer.FirstName;
_logger.LogInformation($"Registered and logged in new customer [{dbCustomer.Id}] at {DateTime.Now}");
return RedirectToAction(nameof(Index), "Home");
}
_logger.LogInformation($"Registered new customer [{dbCustomer.Id}] at {DateTime.Now}");
return RedirectToAction(nameof(Index));
} catch {
ModelState.AddModelError("", "Error registering new customer.");
_logger.LogWarning($"Encountered error registering new customer, returning to registration page at {DateTime.Now}");
return View(viewModel);
}
}
// GET: CustomerController/Edit/5
public ActionResult Edit(int id) {
if (!TempData.ContainsKey("IsAdmin") && id != (int)TempData.Peek("CurrentCustomer")) {
_logger.LogInformation($"User Access denied to Customer/Edit page at {DateTime.Now}");
return StatusCode(401);
}
var customer = _repository.GetCustomerById(id);
var viewModel = new CustomerViewModel {
Id = customer.Id,
FirstName = customer.FirstName,
LastName = customer.LastName,
Email = customer.Email
};
ViewData["Editable"] = true;
if (customer is Admin) {
ViewData["Editable"] = false;
}
_logger.LogInformation($"Visited Customer/Edit with params {nameof(id)}={id} at {DateTime.Now}");
return View(viewModel);
}
// POST: CustomerController/Edit/5
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Edit(int id, CustomerViewModel viewModel) {
if (!ModelState.IsValid) {
_logger.LogWarning($"Encountered error editing customer, returning to edit page at {DateTime.Now}");
return View(viewModel);
}
try {
var customer = _repository.GetCustomerById(id);
_repository.UpdateCustomer(customer, viewModel.FirstName, viewModel.LastName, viewModel.Email);
_repository.Save();
_logger.LogInformation($"Edited details of customer [{id}] at {DateTime.Now}");
return RedirectToAction(nameof(Index));
} catch {
ModelState.AddModelError("", "Unable to update customer details");
_logger.LogWarning($"Encountered error editing customer, returning to edit page at {DateTime.Now}");
return View(viewModel);
}
}
// GET: CustomerController/Delete/5
public ActionResult Delete(int id) {
if (!TempData.ContainsKey("IsAdmin")) {
return StatusCode(401);
}
var customer = _repository.GetCustomerById(id);
var viewModel = new CustomerViewModel {
Id = customer.Id,
FirstName = customer.FirstName,
LastName = customer.LastName,
Email = customer.Email
};
ViewData["Editable"] = true;
if (customer is Admin) {
ViewData["Editable"] = false;
}
_logger.LogInformation($"Visited Customer/Delete with params {nameof(id)}={id} at {DateTime.Now}");
return View(viewModel);
}
// POST: CustomerController/Delete/5
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Delete(int id, CustomerViewModel viewModel) {
if (!ModelState.IsValid) {
_logger.LogWarning($"Encountered error deleting customer, returning to delete page at {DateTime.Now}");
return View(viewModel);
}
try {
var customer = _repository.GetCustomerById(id);
_repository.RemoveCustomer(customer); // Not implemented in repository
_repository.Save();
_logger.LogInformation($"Deleted user [{id}] at {DateTime.Now}");
return RedirectToAction(nameof(Index));
} catch {
_logger.LogWarning($"Encountered error deleting customer, returning to delete page at {DateTime.Now}");
return View(viewModel);
}
}
}
}
| 42.467742 | 186 | 0.583238 | [
"MIT"
] | 2011-nov02-net/matthewg-project1 | Project1/Project1.WebApp/Controllers/CustomerController.cs | 7,901 | C# |
// <copyright file="ConnectionStatusUpdater.cs" company="Mozilla">
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, you can obtain one at http://mozilla.org/MPL/2.0/.
// </copyright>
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
namespace FirefoxPrivateNetwork.UIUpdaters
{
/// <summary>
/// Monitors connection health by querying statistics the VPN tunnel service and changes UI accordingly.
/// </summary>
internal class ConnectionStatusUpdater
{
private readonly ViewModels.MainWindowViewModel viewModel;
private Thread updater = null;
private CancellationTokenSource updaterCancellationTokenSource;
/// <summary>
/// Initializes a new instance of the <see cref="ConnectionStatusUpdater"/> class.
/// </summary>
/// <param name="vm">View model for the main window.</param>
public ConnectionStatusUpdater(ViewModels.MainWindowViewModel vm)
{
viewModel = vm;
}
/// <summary>
/// Starts the connection health monitor thread.
/// </summary>
public void StartThread()
{
if (updater != null && updater.IsAlive)
{
return;
}
updaterCancellationTokenSource = new CancellationTokenSource();
updater = new Thread(() => PollConnectionStatus(updaterCancellationTokenSource.Token))
{
IsBackground = true,
};
updater.Start();
}
/// <summary>
/// Stops the connection health monitor thread.
/// </summary>
public void StopThread()
{
updaterCancellationTokenSource.Cancel();
}
private void PollConnectionStatus(CancellationToken cancellationToken)
{
while (!cancellationToken.IsCancellationRequested)
{
// Get connection status
var connectionStatus = Manager.Tunnel.ConnectionStatus();
// Update connection bytes sent/received
UpdateRxTxUI(connectionStatus.RxBytes, connectionStatus.TxBytes);
// Update connection handshake
UpdateLastHandshakeUI(connectionStatus.LastHandshakeTimeSec);
// Update connection stability
UpdateConnectionStabilityUI(connectionStatus.ConnectionStability);
// Update connection state
UpdateConnectionStateUI(connectionStatus.Status);
// Update tray
UpdateTrayUI(connectionStatus.Status, connectionStatus.ConnectionStability);
// Update connection timer
UpdateConnectionTimer();
cancellationToken.WaitHandle.WaitOne(TimeSpan.FromSeconds(1));
}
}
private void UpdateConnectionStateUI(Models.ConnectionState newStatus)
{
var previousStatus = viewModel.Status;
if (previousStatus != newStatus)
{
viewModel.Status = newStatus;
// Also make sure to not pop up a "disconnected" notification if the initial connection fails
if (
(newStatus == Models.ConnectionState.Protected || newStatus == Models.ConnectionState.Unprotected) &&
!(previousStatus == Models.ConnectionState.Connecting && newStatus == Models.ConnectionState.Unprotected)
)
{
if (newStatus == Models.ConnectionState.Protected)
{
Manager.TrayIcon.ShowNotification(Manager.TranslationService.GetString("windows-notification-vpn-on-title"), Manager.TranslationService.GetString("windows-notification-vpn-on-content"), NotificationArea.ToastIconType.Connected);
}
}
if (newStatus == Models.ConnectionState.Unprotected)
{
viewModel.TunnelStatus = Models.ConnectionState.Unprotected;
Manager.TrayIcon.ShowNotification(Manager.TranslationService.GetString("windows-notification-vpn-off-title"), Manager.TranslationService.GetString("windows-notification-vpn-off-content"), NotificationArea.ToastIconType.Disconnected);
// Force poll account details to ensure that the user's current device hasn't been removed
Manager.AccountInfoUpdater.ForcePollAccountInfo();
}
else if (newStatus == Models.ConnectionState.Protected)
{
viewModel.TunnelStatus = Models.ConnectionState.Protected;
}
}
UpdateConnectionStateIntegratedUI(newStatus);
}
private void UpdateConnectionStateIntegratedUI(Models.ConnectionState newStatus)
{
if (newStatus == Models.ConnectionState.Connecting || newStatus == Models.ConnectionState.Disconnecting || Manager.MainWindowViewModel.IsServerSwitching)
{
Manager.MainWindowViewModel.IsConnectionTransitioning = true;
}
else if (newStatus == Models.ConnectionState.Unprotected || newStatus == Models.ConnectionState.Protected)
{
Manager.MainWindowViewModel.IsConnectionTransitioning = false;
}
if (Manager.MainWindowViewModel.IsServerSwitching && (newStatus == Models.ConnectionState.Protected || newStatus == Models.ConnectionState.Unprotected))
{
// Virtual delay for server switching UI display time
Task.Delay(TimeSpan.FromSeconds(1.5)).Wait();
Manager.MainWindowViewModel.IsServerSwitching = false;
// Show server switch Windows notification
if (newStatus == Models.ConnectionState.Protected)
{
Manager.TrayIcon.ShowNotification(Manager.TranslationService.GetString("windows-notification-vpn-switch-title", UI.Resources.Localization.TranslationService.Args("currentServer", Manager.MainWindowViewModel.SwitchingServerFrom, new[] { "switchServer", Manager.MainWindowViewModel.SwitchingServerTo })), Manager.TranslationService.GetString("windows-notification-vpn-switch-content"), NotificationArea.ToastIconType.Switched);
}
}
}
private void UpdateTrayUI(Models.ConnectionState status, Models.ConnectionStability stability)
{
if (status != Models.ConnectionState.Protected)
{
Manager.TrayIcon.SetDisconnected();
return;
}
if (stability == Models.ConnectionStability.NoSignal)
{
Manager.TrayIcon.SetUnstable();
return;
}
else if (stability == Models.ConnectionStability.Unstable)
{
Manager.TrayIcon.SetIdle();
return;
}
Manager.TrayIcon.SetConnected();
}
private void UpdateConnectionStabilityUI(Models.ConnectionStability newStability)
{
viewModel.Stability = newStability;
}
private void UpdateRxTxUI(string newRxBytes, string newTxBytes)
{
if (!string.IsNullOrEmpty(newRxBytes) && !string.IsNullOrEmpty(newTxBytes))
{
viewModel.RxTx = string.Format("{0}/{1}", ConvertBytesToUserFriendlyString(newRxBytes), ConvertBytesToUserFriendlyString(newTxBytes));
}
else
{
viewModel.RxTx = string.Empty;
}
}
private void UpdateLastHandshakeUI(string newLastHandshakeTimeSec)
{
if (!string.IsNullOrEmpty(newLastHandshakeTimeSec))
{
viewModel.LastHandshakeState = string.Format("Last handshake time: {0}", FromUnixTimeString(newLastHandshakeTimeSec).ToLocalTime());
}
else
{
viewModel.LastHandshakeState = string.Empty;
}
}
private void UpdateConnectionTimer()
{
var connectionTime = Manager.Tunnel.GetConnectionTime();
var time = DateTime.Now - connectionTime;
var days = string.Empty;
if (connectionTime == DateTime.MinValue)
{
viewModel.ConnectionTime = "00:00:00";
return;
}
if (time.TotalDays >= 1)
{
var extraS = time.TotalDays >= 2 ? "s" : string.Empty;
days = string.Format(string.Concat("{0} day", extraS, " "), Math.Floor(time.TotalDays).ToString());
}
viewModel.ConnectionTime = string.Format("{0}{1:00}:{2:00}:{3:00}", days, time.Hours, time.Minutes, time.Seconds);
}
private DateTime FromUnixTimeString(string unixTimeString)
{
var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
return epoch.AddSeconds(int.Parse(unixTimeString));
}
private string ConvertBytesToUserFriendlyString(string bytes)
{
string[] units = new string[] { "B", "KiB", "MiB", "GiB", "TiB" };
string measurementUnit = units[0];
decimal.TryParse(bytes, out decimal value);
for (var i = 0; i < units.Length; i++)
{
measurementUnit = units[i];
if (value < 1024)
{
break;
}
value /= 1024;
}
return string.Format("{0:0.##}{1}", value, measurementUnit);
}
}
}
| 39.450199 | 445 | 0.594425 | [
"MPL-2.0"
] | tonymurphy-rgb/guardian-vpn-windows | ui/src/UIUpdaters/ConnectionStatusUpdater.cs | 9,904 | C# |
using MongoDB.Driver;
using SquishFaceAPI.Helper;
using SquishFaceAPI.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace SquishFaceAPI.Common
{
public static class MongoDBStorage<T> where T : IMongoDbModel
{
private static MongoClient mongoClient;
private static IMongoDatabase mongoDatabase;
private static readonly object syncLock = new object();
#region async
public static async Task CreateItemAsync(string collection, T item)
{
var mongoCollection = mongoDatabase.GetCollection<T>(collection);
await mongoCollection.InsertOneAsync(item);
}
public static async Task UpdateItemAsync(string collection, Expression<Func<T, bool>> predicate, T item)
{
var mongoCollection = mongoDatabase.GetCollection<T>(collection);
await mongoCollection.ReplaceOneAsync(predicate, item);
}
public static async Task<IEnumerable<T>> GetAllItemsAsync(string collection)
{
var mongoCollection = mongoDatabase.GetCollection<T>(collection);
var result = await mongoCollection.AsQueryable().ToListAsync();
return result;
}
public static async Task<IEnumerable<T>> GetItemsAsync(string collection, Expression<Func<T, bool>> predicate)
{
var mongoCollection = mongoDatabase.GetCollection<T>(collection);
var result = (await mongoCollection.FindAsync(predicate)).ToList();
return result;
}
public static async Task<T> GetItemAsync(string collection, Expression<Func<T, bool>> predicate)
{
var mongoCollection = mongoDatabase.GetCollection<T>(collection);
var result = (await mongoCollection.FindAsync(predicate)).FirstOrDefault();
return result;
}
public static async Task<bool> DeleteAsync(string collection, Expression<Func<T, bool>> predicate)
{
var mongoCollection = mongoDatabase.GetCollection<T>(collection);
var result = (await mongoCollection.DeleteOneAsync(predicate));
return result.IsAcknowledged;
}
#endregion
#region sync
public static void CreateItem(string collection, T item)
{
CreateItemAsync(collection, item).Wait();
}
public static void UpdateItem(string collection, Expression<Func<T, bool>> predicate, T item)
{
UpdateItemAsync(collection, predicate, item).Wait();
}
public static IEnumerable<T> GetAllItems(string collection)
{
return GetAllItemsAsync(collection).Result;
}
public static IEnumerable<T> GetItems(string collection, Expression<Func<T, bool>> predicate)
{
return GetItemsAsync(collection, predicate).Result;
}
public static T GetItem(string collection, Expression<Func<T, bool>> predicate)
{
return GetItemAsync(collection, predicate).Result;
}
#endregion
public static void Initialize()
{
if (mongoClient == null)
{
lock (syncLock)
{
if (mongoClient == null)
{
mongoClient = GetClient();
}
}
}
if (mongoDatabase == null)
{
lock (syncLock)
{
if (mongoDatabase == null)
{
mongoDatabase = mongoClient?.GetDatabase(MongoHelper.Database);
}
}
}
}
private static MongoClient GetClient()
{
MongoInternalIdentity internalIdentity =
new MongoInternalIdentity(MongoHelper.Database, MongoHelper.UserName);
PasswordEvidence passwordEvidence = new PasswordEvidence(MongoHelper.Password);
MongoCredential mongoCredential =
new MongoCredential(MongoHelper.AuthType,
internalIdentity, passwordEvidence);
List<MongoCredential> credentials =
new List<MongoCredential>() { mongoCredential };
MongoClientSettings settings = new MongoClientSettings
{
Credentials = credentials
};
String mongoHost = MongoHelper.Server;
MongoServerAddress address = new MongoServerAddress(MongoHelper.Server);
settings.Server = address;
return new MongoClient(settings);
}
}
}
| 35.311111 | 118 | 0.59786 | [
"MIT"
] | praveenpallekaate/squishface | API/Common/MongoDBStorage.cs | 4,769 | C# |
using System.Net.Http;
using Ungerboeck.Api.Sdk;
using Ungerboeck.Api.Models;
using Ungerboeck.Api.Models.Subjects;
using Ungerboeck.Api.Models.Search;
using System.Collections.Generic;
namespace Examples.Operations
{
public class EventJobCategories : Base
{
public EventJobCategories(ApiClient apiClient) : base(apiClient)
{
}
/// <summary>
/// A basic retrieve example
/// </summary>
public EventJobCategoriesModel Get(string orgCode, string code)
{
return apiClient.Endpoints.EventJobCategories.Get( orgCode, code);
}
/// <summary>
/// A search example. Check out the 'Search using the API' knowledge base article for more info.
/// </summary>
public SearchResponse<EventJobCategoriesModel> Search(string orgCode, string searchValue)
{
return apiClient.Endpoints.EventJobCategories.Search(orgCode, $"{nameof(EventJobCategoriesModel.Description)} eq '{searchValue}'");
}
}
}
| 28.323529 | 137 | 0.715472 | [
"Apache-2.0"
] | UngerboeckAPI/97 | Examples/Operations/EventJobCategories.cs | 965 | C# |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SIL.PcPatrFLEx
{
public partial class AdvancedForm : Form
{
public int MaxAmbigs { get; set; }
public int TimeLimit { get; set; }
public bool RunIndividually { get; set; }
public bool OkPressed { get; set; }
public AdvancedForm()
{
InitializeComponent();
}
public void initialize(int max, int time, bool runIndividually)
{
MaxAmbigs = max;
TimeLimit = time;
tbMaxAmbiguities.Text = max.ToString();
tbTimeLimit.Text = time.ToString();
cbRunIndividually.Checked = runIndividually;
OkPressed = false;
}
private void tbMaxAmbiguities_KeyPress(object sender, KeyPressEventArgs e)
{
if (Char.IsDigit(e.KeyChar) || e.KeyChar == '\b')
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}
private void tbTimeLimit_KeyPress(object sender, KeyPressEventArgs e)
{
if (Char.IsDigit(e.KeyChar) || e.KeyChar == '\b')
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}
private void cbRunIndividually_CheckedChanged(object sender, EventArgs e)
{
RunIndividually = cbRunIndividually.Checked;
}
private void btnOK_Click(object sender, EventArgs e)
{
MaxAmbigs = Convert.ToInt32(tbMaxAmbiguities.Text);
TimeLimit = Convert.ToInt32(tbTimeLimit.Text);
OkPressed = true;
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
OkPressed = false;
this.Close();
}
private void tbMaxAmbiguities_TextChanged(object sender, EventArgs e)
{
}
}
}
| 25.988095 | 82 | 0.544663 | [
"MIT"
] | sillsdev/pcpatrflex | PcPatrFLExDll/AdvancedForm.cs | 2,185 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using FluentAssertions;
using Microsoft.R.Support.Test.Utility;
using Microsoft.UnitTests.Core.XUnit;
using Xunit;
namespace Microsoft.R.Support.Test.Functions {
[ExcludeFromCodeCoverage]
[Collection(CollectionNames.NonParallel)]
public class FunctionIndexTest : IAsyncLifetime {
public Task InitializeAsync() {
return FunctionIndexUtility.InitializeAsync();
}
public Task DisposeAsync() {
return FunctionIndexUtility.DisposeAsync();
}
[Test]
[Category.R.Signatures]
public async Task FunctionInfoTest1() {
var functionInfo = await FunctionIndexUtility.GetFunctionInfoAsync("abs");
functionInfo.Should().NotBeNull();
functionInfo.Name.Should().Be("abs");
functionInfo.Description.Should().NotBeEmpty();
functionInfo.Signatures.Should().ContainSingle()
.Which.Arguments.Should().ContainSingle();
List<int> locusPoints = new List<int>();
functionInfo.Signatures[0].GetSignatureString(locusPoints).Should().Be("abs(x)");
locusPoints.Should().Equal(4, 5);
}
[Test]
[Category.R.Signatures]
public async Task FunctionInfoTest2() {
var functionInfo = await FunctionIndexUtility.GetFunctionInfoAsync("eval");
functionInfo.Should().NotBeNull();
functionInfo.Name.Should().Be("eval");
functionInfo.Description.Should().NotBeEmpty();
functionInfo.Signatures.Should().ContainSingle()
.Which.Arguments.Should().HaveCount(4);
List<int> locusPoints = new List<int>();
string signature = functionInfo.Signatures[0].GetSignatureString(locusPoints);
signature.Should().Be("eval(expr, envir = parent.frame(), enclos = if(is.list(envir) || is.pairlist(envir)) parent.frame() else baseenv(), n)");
locusPoints.Should().Equal(5, 11, 35, 116, 117);
}
}
}
| 39.155172 | 156 | 0.652136 | [
"MIT"
] | AlexanderSher/RTVS-Old | src/R/Support/Test/Functions/FunctionIndexTest.cs | 2,273 | C# |
/*
* LUSID API
*
* # Introduction This page documents the [LUSID APIs](https://www.lusid.com/api/swagger), which allows authorised clients to query and update their data within the LUSID platform. SDKs to interact with the LUSID APIs are available in the following languages : * [C#](https://github.com/finbourne/lusid-sdk-csharp) * [Java](https://github.com/finbourne/lusid-sdk-java) * [JavaScript](https://github.com/finbourne/lusid-sdk-js) * [Python](https://github.com/finbourne/lusid-sdk-python) # Data Model The LUSID API has a relatively lightweight but extremely powerful data model. One of the goals of LUSID was not to enforce on clients a single rigid data model but rather to provide a flexible foundation onto which clients can map their own data models. The core entities in LUSID provide a minimal structure and set of relationships, and the data model can be extended using Properties. The LUSID data model is exposed through the LUSID APIs. The APIs provide access to both business objects and the meta data used to configure the systems behaviours. The key business entities are: - * **Portfolios** A portfolio is a container for transactions and holdings (a **Transaction Portfolio**) or constituents (a **Reference Portfolio**). * **Derived Portfolios**. Derived Portfolios allow Portfolios to be created based on other Portfolios, by overriding or adding specific items. * **Holdings** A Holding is a quantity of an Instrument or a balance of cash within a Portfolio. Holdings can only be adjusted via Transactions. * **Transactions** A Transaction is an economic event that occurs in a Portfolio, causing its holdings to change. * **Corporate Actions** A corporate action is a market event which occurs to an Instrument and thus applies to all portfolios which holding the instrument. Examples are stock splits or mergers. * **Constituents** A constituent is a record in a Reference Portfolio containing an Instrument and an associated weight. * **Instruments** An instrument represents a currency, tradable instrument or OTC contract that is attached to a transaction and a holding. * **Properties** All major entities allow additional user defined properties to be associated with them. For example, a Portfolio manager may be associated with a portfolio. Meta data includes: - * **Transaction Types** Transactions are booked with a specific transaction type. The types are client defined and are used to map the Transaction to a series of movements which update the portfolio holdings. * **Properties Types** Types of user defined properties used within the system. ## Scope All data in LUSID is segregated at the client level. Entities in LUSID are identifiable by a unique code. Every entity lives within a logical data partition known as a Scope. Scope is an identity namespace allowing two entities with the same unique code to co-exist within individual address spaces. For example, prices for equities from different vendors may be uploaded into different scopes such as `client/vendor1` and `client/vendor2`. A portfolio may then be valued using either of the price sources by referencing the appropriate scope. LUSID Clients cannot access scopes of other clients. ## Instruments LUSID has its own built-in instrument master which you can use to master your own instrument universe. Every instrument must be created with one or more unique market identifiers, such as [FIGI](https://openfigi.com/). For any non-listed instruments (eg OTCs), you can upload an instrument against a custom ID of your choosing. In addition, LUSID will allocate each instrument a unique 'LUSID instrument identifier'. The LUSID instrument identifier is what is used when uploading transactions, holdings, prices, etc. The API exposes an `instrument/lookup` endpoint which can be used to lookup these LUSID identifiers using their market identifiers. Cash can be referenced using the ISO currency code prefixed with \"`CCY_`\" e.g. `CCY_GBP` ## Instrument Data Instrument data can be uploaded to the system using the [Instrument Properties](#tag/InstrumentProperties) endpoint. | Field|Type|Description | | - --|- --|- -- | | Key|propertykey|The key of the property. This takes the format {domain}/{scope}/{code} e.g. 'Instrument/system/Name' or 'Transaction/strategy/quantsignal'. | | Value|string|The value of the property. | | EffectiveFrom|datetimeoffset|The effective datetime from which the property is valid. | ## Transaction Portfolios Portfolios are the top-level entity containers within LUSID, containing transactions, corporate actions and holdings. The transactions build up the portfolio holdings on which valuations, analytics profit & loss and risk can be calculated. Properties can be associated with Portfolios to add in additional data. Portfolio properties can be changed over time, for example to allow a Portfolio Manager to be linked with a Portfolio. Additionally, portfolios can be securitised and held by other portfolios, allowing LUSID to perform \"drill-through\" into underlying fund holdings ### Derived Portfolios LUSID also allows for a portfolio to be composed of another portfolio via derived portfolios. A derived portfolio can contain its own transactions and also inherits any transactions from its parent portfolio. Any changes made to the parent portfolio are automatically reflected in derived portfolio. Derived portfolios in conjunction with scopes are a powerful construct. For example, to do pre-trade what-if analysis, a derived portfolio could be created a new namespace linked to the underlying live (parent) portfolio. Analysis can then be undertaken on the derived portfolio without affecting the live portfolio. ### Transactions A transaction represents an economic activity against a Portfolio. Transactions are processed according to a configuration. This will tell the LUSID engine how to interpret the transaction and correctly update the holdings. LUSID comes with a set of transaction types you can use out of the box, or you can configure your own set(s) of transactions. For more details see the [LUSID Getting Started Guide for transaction configuration.](https://support.lusid.com/configuring-transaction-types) | Field|Type|Description | | - --|- --|- -- | | TransactionId|string|The unique identifier for the transaction. | | Type|string|The type of the transaction e.g. 'Buy', 'Sell'. The transaction type should have been pre-configured via the System Configuration API endpoint. If it hasn't been pre-configured the transaction will still be updated or inserted however you will be unable to generate the resultant holdings for the portfolio that contains this transaction as LUSID does not know how to process it. | | InstrumentIdentifiers|map|A set of instrument identifiers to use to resolve the transaction to a unique instrument. | | TransactionDate|dateorcutlabel|The date of the transaction. | | SettlementDate|dateorcutlabel|The settlement date of the transaction. | | Units|decimal|The number of units transacted in the associated instrument. | | TransactionPrice|transactionprice|The price for each unit of the transacted instrument in the transaction currency. | | TotalConsideration|currencyandamount|The total value of the transaction in the settlement currency. | | ExchangeRate|decimal|The exchange rate between the transaction and settlement currency. For example if the transaction currency is in USD and the settlement currency is in GBP this this the USD/GBP rate. | | TransactionCurrency|currency|The transaction currency. | | Properties|map|Set of unique transaction properties and associated values to store with the transaction. Each property must be from the 'Transaction' domain. | | CounterpartyId|string|The identifier for the counterparty of the transaction. | | Source|string|The source of the transaction. This is used to look up the appropriate transaction group set in the transaction type configuration. | From these fields, the following values can be calculated * **Transaction value in Transaction currency**: TotalConsideration / ExchangeRate * **Transaction value in Portfolio currency**: Transaction value in Transaction currency * TradeToPortfolioRate #### Example Transactions ##### A Common Purchase Example Three example transactions are shown in the table below. They represent a purchase of USD denominated IBM shares within a Sterling denominated portfolio. * The first two transactions are for separate buy and fx trades * Buying 500 IBM shares for $71,480.00 * A spot foreign exchange conversion to fund the IBM purchase. (Buy $71,480.00 for £54,846.60) * The third transaction is an alternate version of the above trades. Buying 500 IBM shares and settling directly in Sterling. | Column | Buy Trade | Fx Trade | Buy Trade with foreign Settlement | | - -- -- | - -- -- | - -- -- | - -- -- | | TransactionId | FBN00001 | FBN00002 | FBN00003 | | Type | Buy | FxBuy | Buy | | InstrumentIdentifiers | { \"figi\", \"BBG000BLNNH6\" } | { \"CCY\", \"CCY_USD\" } | { \"figi\", \"BBG000BLNNH6\" } | | TransactionDate | 2018-08-02 | 2018-08-02 | 2018-08-02 | | SettlementDate | 2018-08-06 | 2018-08-06 | 2018-08-06 | | Units | 500 | 71480 | 500 | | TransactionPrice | 142.96 | 1 | 142.96 | | TradeCurrency | USD | USD | USD | | ExchangeRate | 1 | 0.7673 | 0.7673 | | TotalConsideration.Amount | 71480.00 | 54846.60 | 54846.60 | | TotalConsideration.Currency | USD | GBP | GBP | | Trade/default/TradeToPortfolioRate* | 0.7673 | 0.7673 | 0.7673 | [* This is a property field] ##### A Forward FX Example LUSID has a flexible transaction modelling system, meaning there are a number of different ways of modelling forward fx trades. The default LUSID transaction types are FwdFxBuy and FwdFxSell. Using these transaction types, LUSID will generate two holdings for each Forward FX trade, one for each currency in the trade. An example Forward Fx trade to sell GBP for USD in a JPY-denominated portfolio is shown below: | Column | Forward 'Sell' Trade | Notes | | - -- -- | - -- -- | - -- - | | TransactionId | FBN00004 | | | Type | FwdFxSell | | | InstrumentIdentifiers | { \"Instrument/default/Currency\", \"GBP\" } | | | TransactionDate | 2018-08-02 | | | SettlementDate | 2019-02-06 | Six month forward | | Units | 10000.00 | Units of GBP | | TransactionPrice | 1 | | | TradeCurrency | GBP | Currency being sold | | ExchangeRate | 1.3142 | Agreed rate between GBP and USD | | TotalConsideration.Amount | 13142.00 | Amount in the settlement currency, USD | | TotalConsideration.Currency | USD | Settlement currency | | Trade/default/TradeToPortfolioRate | 142.88 | Rate between trade currency, GBP and portfolio base currency, JPY | Please note that exactly the same economic behaviour could be modelled using the FwdFxBuy Transaction Type with the amounts and rates reversed. ### Holdings A holding represents a position in an instrument or cash on a given date. | Field|Type|Description | | - --|- --|- -- | | InstrumentUid|string|The unqiue Lusid Instrument Id (LUID) of the instrument that the holding is in. | | SubHoldingKeys|map|The sub-holding properties which identify the holding. Each property will be from the 'Transaction' domain. These are configured when a transaction portfolio is created. | | Properties|map|The properties which have been requested to be decorated onto the holding. These will be from the 'Instrument' or 'Holding' domain. | | HoldingType|string|The type of the holding e.g. Position, Balance, CashCommitment, Receivable, ForwardFX etc. | | Units|decimal|The total number of units of the holding. | | SettledUnits|decimal|The total number of settled units of the holding. | | Cost|currencyandamount|The total cost of the holding in the transaction currency. | | CostPortfolioCcy|currencyandamount|The total cost of the holding in the portfolio currency. | | Transaction|transaction|The transaction associated with an unsettled holding. | ## Corporate Actions Corporate actions are represented within LUSID in terms of a set of instrument-specific 'transitions'. These transitions are used to specify the participants of the corporate action, and the effect that the corporate action will have on holdings in those participants. ### Corporate Action | Field|Type|Description | | - --|- --|- -- | | CorporateActionCode|code|The unique identifier of this corporate action | | Description|string| | | AnnouncementDate|datetimeoffset|The announcement date of the corporate action | | ExDate|datetimeoffset|The ex date of the corporate action | | RecordDate|datetimeoffset|The record date of the corporate action | | PaymentDate|datetimeoffset|The payment date of the corporate action | | Transitions|corporateactiontransition[]|The transitions that result from this corporate action | ### Transition | Field|Type|Description | | - --|- --|- -- | | InputTransition|corporateactiontransitioncomponent|Indicating the basis of the corporate action - which security and how many units | | OutputTransitions|corporateactiontransitioncomponent[]|What will be generated relative to the input transition | ### Example Corporate Action Transitions #### A Dividend Action Transition In this example, for each share of IBM, 0.20 units (or 20 pence) of GBP are generated. | Column | Input Transition | Output Transition | | - -- -- | - -- -- | - -- -- | | Instrument Identifiers | { \"figi\" : \"BBG000BLNNH6\" } | { \"ccy\" : \"CCY_GBP\" } | | Units Factor | 1 | 0.20 | | Cost Factor | 1 | 0 | #### A Split Action Transition In this example, for each share of IBM, we end up with 2 units (2 shares) of IBM, with total value unchanged. | Column | Input Transition | Output Transition | | - -- -- | - -- -- | - -- -- | | Instrument Identifiers | { \"figi\" : \"BBG000BLNNH6\" } | { \"figi\" : \"BBG000BLNNH6\" } | | Units Factor | 1 | 2 | | Cost Factor | 1 | 1 | #### A Spinoff Action Transition In this example, for each share of IBM, we end up with 1 unit (1 share) of IBM and 3 units (3 shares) of Celestica, with 85% of the value remaining on the IBM share, and 5% in each Celestica share (15% total). | Column | Input Transition | Output Transition 1 | Output Transition 2 | | - -- -- | - -- -- | - -- -- | - -- -- | | Instrument Identifiers | { \"figi\" : \"BBG000BLNNH6\" } | { \"figi\" : \"BBG000BLNNH6\" } | { \"figi\" : \"BBG000HBGRF3\" } | | Units Factor | 1 | 1 | 3 | | Cost Factor | 1 | 0.85 | 0.15 | ## Reference Portfolios Reference portfolios are portfolios that contain constituents with weights. They are designed to represent entities such as indices and benchmarks. ### Constituents | Field|Type|Description | | - --|- --|- -- | | InstrumentIdentifiers|map|Unique instrument identifiers | | InstrumentUid|string|LUSID's internal unique instrument identifier, resolved from the instrument identifiers | | Currency|decimal| | | Weight|decimal| | | FloatingWeight|decimal| | ## Portfolio Groups Portfolio groups allow the construction of a hierarchy from portfolios and groups. Portfolio operations on the group are executed on an aggregated set of portfolios in the hierarchy. For example: * Global Portfolios _(group)_ * APAC _(group)_ * Hong Kong _(portfolio)_ * Japan _(portfolio)_ * Europe _(group)_ * France _(portfolio)_ * Germany _(portfolio)_ * UK _(portfolio)_ In this example **Global Portfolios** is a group that consists of an aggregate of **Hong Kong**, **Japan**, **France**, **Germany** and **UK** portfolios. ## Properties Properties are key-value pairs that can be applied to any entity within a domain (where a domain is `trade`, `portfolio`, `security` etc). Properties must be defined before use with a `PropertyDefinition` and can then subsequently be added to entities. ## Schema A detailed description of the entities used by the API and parameters for endpoints which take a JSON document can be retrieved via the `schema` endpoint. ## Meta data The following headers are returned on all responses from LUSID | Name | Purpose | | - -- | - -- | | lusid-meta-duration | Duration of the request | | lusid-meta-success | Whether or not LUSID considered the request to be successful | | lusid-meta-requestId | The unique identifier for the request | | lusid-schema-url | Url of the schema for the data being returned | | lusid-property-schema-url | Url of the schema for any properties | # Error Codes | Code|Name|Description | | - --|- --|- -- | | <a name=\"-10\">-10</a>|Server Configuration Error| | | <a name=\"-1\">-1</a>|Unknown error|An unexpected error was encountered on our side. | | <a name=\"102\">102</a>|Version Not Found| | | <a name=\"103\">103</a>|Api Rate Limit Violation| | | <a name=\"104\">104</a>|Instrument Not Found| | | <a name=\"105\">105</a>|Property Not Found| | | <a name=\"106\">106</a>|Portfolio Recursion Depth| | | <a name=\"108\">108</a>|Group Not Found| | | <a name=\"109\">109</a>|Portfolio Not Found| | | <a name=\"110\">110</a>|Property Schema Not Found| | | <a name=\"111\">111</a>|Portfolio Ancestry Not Found| | | <a name=\"112\">112</a>|Portfolio With Id Already Exists| | | <a name=\"113\">113</a>|Orphaned Portfolio| | | <a name=\"119\">119</a>|Missing Base Claims| | | <a name=\"121\">121</a>|Property Not Defined| | | <a name=\"122\">122</a>|Cannot Delete System Property| | | <a name=\"123\">123</a>|Cannot Modify Immutable Property Field| | | <a name=\"124\">124</a>|Property Already Exists| | | <a name=\"125\">125</a>|Invalid Property Life Time| | | <a name=\"126\">126</a>|Property Constraint Style Excludes Properties| | | <a name=\"127\">127</a>|Cannot Modify Default Data Type| | | <a name=\"128\">128</a>|Group Already Exists| | | <a name=\"129\">129</a>|No Such Data Type| | | <a name=\"130\">130</a>|Undefined Value For Data Type| | | <a name=\"131\">131</a>|Unsupported Value Type Defined On Data Type| | | <a name=\"132\">132</a>|Validation Error| | | <a name=\"133\">133</a>|Loop Detected In Group Hierarchy| | | <a name=\"134\">134</a>|Undefined Acceptable Values| | | <a name=\"135\">135</a>|Sub Group Already Exists| | | <a name=\"138\">138</a>|Price Source Not Found| | | <a name=\"139\">139</a>|Analytic Store Not Found| | | <a name=\"141\">141</a>|Analytic Store Already Exists| | | <a name=\"143\">143</a>|Client Instrument Already Exists| | | <a name=\"144\">144</a>|Duplicate In Parameter Set| | | <a name=\"147\">147</a>|Results Not Found| | | <a name=\"148\">148</a>|Order Field Not In Result Set| | | <a name=\"149\">149</a>|Operation Failed| | | <a name=\"150\">150</a>|Elastic Search Error| | | <a name=\"151\">151</a>|Invalid Parameter Value| | | <a name=\"153\">153</a>|Command Processing Failure| | | <a name=\"154\">154</a>|Entity State Construction Failure| | | <a name=\"155\">155</a>|Entity Timeline Does Not Exist| | | <a name=\"156\">156</a>|Concurrency Conflict Failure| | | <a name=\"157\">157</a>|Invalid Request| | | <a name=\"158\">158</a>|Event Publish Unknown| | | <a name=\"159\">159</a>|Event Query Failure| | | <a name=\"160\">160</a>|Blob Did Not Exist| | | <a name=\"162\">162</a>|Sub System Request Failure| | | <a name=\"163\">163</a>|Sub System Configuration Failure| | | <a name=\"165\">165</a>|Failed To Delete| | | <a name=\"166\">166</a>|Upsert Client Instrument Failure| | | <a name=\"167\">167</a>|Illegal As At Interval| | | <a name=\"168\">168</a>|Illegal Bitemporal Query| | | <a name=\"169\">169</a>|Invalid Alternate Id| | | <a name=\"170\">170</a>|Cannot Add Source Portfolio Property Explicitly| | | <a name=\"171\">171</a>|Entity Already Exists In Group| | | <a name=\"173\">173</a>|Entity With Id Already Exists| | | <a name=\"174\">174</a>|Derived Portfolio Details Do Not Exist| | | <a name=\"176\">176</a>|Portfolio With Name Already Exists| | | <a name=\"177\">177</a>|Invalid Transactions| | | <a name=\"178\">178</a>|Reference Portfolio Not Found| | | <a name=\"179\">179</a>|Duplicate Id| | | <a name=\"180\">180</a>|Command Retrieval Failure| | | <a name=\"181\">181</a>|Data Filter Application Failure| | | <a name=\"182\">182</a>|Search Failed| | | <a name=\"183\">183</a>|Movements Engine Configuration Key Failure| | | <a name=\"184\">184</a>|Fx Rate Source Not Found| | | <a name=\"185\">185</a>|Accrual Source Not Found| | | <a name=\"186\">186</a>|Access Denied| | | <a name=\"187\">187</a>|Invalid Identity Token| | | <a name=\"188\">188</a>|Invalid Request Headers| | | <a name=\"189\">189</a>|Price Not Found| | | <a name=\"190\">190</a>|Invalid Sub Holding Keys Provided| | | <a name=\"191\">191</a>|Duplicate Sub Holding Keys Provided| | | <a name=\"192\">192</a>|Cut Definition Not Found| | | <a name=\"193\">193</a>|Cut Definition Invalid| | | <a name=\"194\">194</a>|Time Variant Property Deletion Date Unspecified| | | <a name=\"195\">195</a>|Perpetual Property Deletion Date Specified| | | <a name=\"196\">196</a>|Time Variant Property Upsert Date Unspecified| | | <a name=\"197\">197</a>|Perpetual Property Upsert Date Specified| | | <a name=\"200\">200</a>|Invalid Unit For Data Type| | | <a name=\"201\">201</a>|Invalid Type For Data Type| | | <a name=\"202\">202</a>|Invalid Value For Data Type| | | <a name=\"203\">203</a>|Unit Not Defined For Data Type| | | <a name=\"204\">204</a>|Units Not Supported On Data Type| | | <a name=\"205\">205</a>|Cannot Specify Units On Data Type| | | <a name=\"206\">206</a>|Unit Schema Inconsistent With Data Type| | | <a name=\"207\">207</a>|Unit Definition Not Specified| | | <a name=\"208\">208</a>|Duplicate Unit Definitions Specified| | | <a name=\"209\">209</a>|Invalid Units Definition| | | <a name=\"210\">210</a>|Invalid Instrument Identifier Unit| | | <a name=\"211\">211</a>|Holdings Adjustment Does Not Exist| | | <a name=\"212\">212</a>|Could Not Build Excel Url| | | <a name=\"213\">213</a>|Could Not Get Excel Version| | | <a name=\"214\">214</a>|Instrument By Code Not Found| | | <a name=\"215\">215</a>|Entity Schema Does Not Exist| | | <a name=\"216\">216</a>|Feature Not Supported On Portfolio Type| | | <a name=\"217\">217</a>|Quote Not Found| | | <a name=\"218\">218</a>|Invalid Quote Identifier| | | <a name=\"219\">219</a>|Invalid Metric For Data Type| | | <a name=\"220\">220</a>|Invalid Instrument Definition| | | <a name=\"221\">221</a>|Instrument Upsert Failure| | | <a name=\"222\">222</a>|Reference Portfolio Request Not Supported| | | <a name=\"223\">223</a>|Transaction Portfolio Request Not Supported| | | <a name=\"224\">224</a>|Invalid Property Value Assignment| | | <a name=\"230\">230</a>|Transaction Type Not Found| | | <a name=\"231\">231</a>|Transaction Type Duplication| | | <a name=\"232\">232</a>|Portfolio Does Not Exist At Given Date| | | <a name=\"233\">233</a>|Query Parser Failure| | | <a name=\"234\">234</a>|Duplicate Constituent| | | <a name=\"235\">235</a>|Unresolved Instrument Constituent| | | <a name=\"236\">236</a>|Unresolved Instrument In Transition| | | <a name=\"237\">237</a>|Missing Side Definitions| | | <a name=\"299\">299</a>|Invalid Recipe| | | <a name=\"300\">300</a>|Missing Recipe| | | <a name=\"301\">301</a>|Dependencies| | | <a name=\"304\">304</a>|Portfolio Preprocess Failure| | | <a name=\"310\">310</a>|Valuation Engine Failure| | | <a name=\"311\">311</a>|Task Factory Failure| | | <a name=\"312\">312</a>|Task Evaluation Failure| | | <a name=\"313\">313</a>|Task Generation Failure| | | <a name=\"314\">314</a>|Engine Configuration Failure| | | <a name=\"315\">315</a>|Model Specification Failure| | | <a name=\"320\">320</a>|Market Data Key Failure| | | <a name=\"321\">321</a>|Market Resolver Failure| | | <a name=\"322\">322</a>|Market Data Failure| | | <a name=\"330\">330</a>|Curve Failure| | | <a name=\"331\">331</a>|Volatility Surface Failure| | | <a name=\"332\">332</a>|Volatility Cube Failure| | | <a name=\"350\">350</a>|Instrument Failure| | | <a name=\"351\">351</a>|Cash Flows Failure| | | <a name=\"352\">352</a>|Reference Data Failure| | | <a name=\"360\">360</a>|Aggregation Failure| | | <a name=\"361\">361</a>|Aggregation Measure Failure| | | <a name=\"370\">370</a>|Result Retrieval Failure| | | <a name=\"371\">371</a>|Result Processing Failure| | | <a name=\"372\">372</a>|Vendor Result Processing Failure| | | <a name=\"373\">373</a>|Vendor Result Mapping Failure| | | <a name=\"374\">374</a>|Vendor Library Unauthorised| | | <a name=\"375\">375</a>|Vendor Connectivity Error| | | <a name=\"376\">376</a>|Vendor Interface Error| | | <a name=\"377\">377</a>|Vendor Pricing Failure| | | <a name=\"378\">378</a>|Vendor Translation Failure| | | <a name=\"379\">379</a>|Vendor Key Mapping Failure| | | <a name=\"380\">380</a>|Vendor Reflection Failure| | | <a name=\"390\">390</a>|Attempt To Upsert Duplicate Quotes| | | <a name=\"391\">391</a>|Corporate Action Source Does Not Exist| | | <a name=\"392\">392</a>|Corporate Action Source Already Exists| | | <a name=\"393\">393</a>|Instrument Identifier Already In Use| | | <a name=\"394\">394</a>|Properties Not Found| | | <a name=\"395\">395</a>|Batch Operation Aborted| | | <a name=\"400\">400</a>|Invalid Iso4217 Currency Code| | | <a name=\"401\">401</a>|Cannot Assign Instrument Identifier To Currency| | | <a name=\"402\">402</a>|Cannot Assign Currency Identifier To Non Currency| | | <a name=\"403\">403</a>|Currency Instrument Cannot Be Deleted| | | <a name=\"404\">404</a>|Currency Instrument Cannot Have Economic Definition| | | <a name=\"405\">405</a>|Currency Instrument Cannot Have Lookthrough Portfolio| | | <a name=\"406\">406</a>|Cannot Create Currency Instrument With Multiple Identifiers| | | <a name=\"407\">407</a>|Specified Currency Is Undefined| | | <a name=\"410\">410</a>|Index Does Not Exist| | | <a name=\"411\">411</a>|Sort Field Does Not Exist| | | <a name=\"413\">413</a>|Negative Pagination Parameters| | | <a name=\"414\">414</a>|Invalid Search Syntax| | | <a name=\"415\">415</a>|Filter Execution Timeout| | | <a name=\"420\">420</a>|Side Definition Inconsistent| | | <a name=\"450\">450</a>|Invalid Quote Access Metadata Rule| | | <a name=\"451\">451</a>|Access Metadata Not Found| | | <a name=\"452\">452</a>|Invalid Access Metadata Identifier| | | <a name=\"460\">460</a>|Standard Resource Not Found| | | <a name=\"461\">461</a>|Standard Resource Conflict| | | <a name=\"462\">462</a>|Calendar Not Found| | | <a name=\"463\">463</a>|Date In A Calendar Not Found| | | <a name=\"464\">464</a>|Invalid Date Source Data| | | <a name=\"465\">465</a>|Invalid Timezone| | | <a name=\"601\">601</a>|Person Identifier Already In Use| | | <a name=\"602\">602</a>|Person Not Found| | | <a name=\"603\">603</a>|Cannot Set Identifier| | | <a name=\"617\">617</a>|Invalid Recipe Specification In Request| | | <a name=\"618\">618</a>|Inline Recipe Deserialisation Failure| | | <a name=\"619\">619</a>|Identifier Types Not Set For Entity| | | <a name=\"620\">620</a>|Cannot Delete All Client Defined Identifiers| | | <a name=\"650\">650</a>|The Order requested was not found.| | | <a name=\"654\">654</a>|The Allocation requested was not found.| | | <a name=\"655\">655</a>|Cannot build the fx forward target with the given holdings.| | | <a name=\"656\">656</a>|Group does not contain expected entities.| | | <a name=\"667\">667</a>|Relation definition already exists| | | <a name=\"673\">673</a>|Missing entitlements for entities in Group| | | <a name=\"674\">674</a>|Next Best Action not found| | | <a name=\"676\">676</a>|Relation definition not defined| | | <a name=\"677\">677</a>|Invalid entity identifier for relation| | | <a name=\"681\">681</a>|Sorting by specified field not supported|One or more of the provided fields to order by were either invalid or not supported. | | <a name=\"682\">682</a>|Too many fields to sort by|The number of fields to sort the data by exceeds the number allowed by the endpoint | | <a name=\"684\">684</a>|Sequence Not Found| | | <a name=\"685\">685</a>|Sequence Already Exists| | | <a name=\"686\">686</a>|Non-cycling sequence has been exhausted| | | <a name=\"687\">687</a>|Legal Entity Identifier Already In Use| | | <a name=\"688\">688</a>|Legal Entity Not Found| | | <a name=\"689\">689</a>|The supplied pagination token is invalid| | | <a name=\"690\">690</a>|Property Type Is Not Supported| | | <a name=\"691\">691</a>|Multiple Tax-lots For Currency Type Is Not Supported| |
*
* The version of the OpenAPI document: 0.11.2220
* Contact: info@finbourne.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using OpenAPIDateConverter = Lusid.Sdk.Client.OpenAPIDateConverter;
namespace Lusid.Sdk.Model
{
/// <summary>
/// Defines PerpetualEntityState
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum PerpetualEntityState
{
/// <summary>
/// Enum Active for value: Active
/// </summary>
[EnumMember(Value = "Active")]
Active = 1,
/// <summary>
/// Enum Inactive for value: Inactive
/// </summary>
[EnumMember(Value = "Inactive")]
Inactive = 2
}
}
| 614.6875 | 28,481 | 0.700661 | [
"MIT"
] | MikeMcGarry/lusid-sdk-csharp-preview | sdk/Lusid.Sdk/Model/PerpetualEntityState.cs | 29,505 | C# |
namespace More.ComponentModel
{
using System;
using System.Composition;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Threading.Tasks;
[ContractClassFor( typeof( ActivityManagerBase ) )]
abstract class ActivityManagerBaseContract : ActivityManagerBase
{
protected ActivityManagerBaseContract() : base( Enumerable.Empty<ExportFactory<IActivity, ActivityDescriptor>>() ) { }
public override Task<Uri> RegisterAsync( IActivity activity )
{
Contract.Requires<ArgumentNullException>( activity != null, nameof( activity ) );
return null;
}
}
} | 32.7 | 126 | 0.688073 | [
"MIT"
] | JTOne123/More | src/More.UI.Hosting/Composition.Hosting/ActivityManagerBaseContract.cs | 656 | C# |
using System;
using System.IO;
using System.Xml;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using ICSharpCode.SharpZipLib.Zip;
namespace Monodoc.Storage
{
public class ZipStorage : IDocStorage
{
string zipFileName;
int code;
ZipOutputStream zipOutput;
ZipFile zipFile;
// SharpZipLib use linear search to map name to index, correct that a bit
Dictionary<string, int> entries = new Dictionary<string, int> ();
public ZipStorage (string zipFileName)
{
this.zipFileName = zipFileName;
}
public bool SupportRevision {
get {
return false;
}
}
public IDocRevisionManager RevisionManager {
get {
return null;
}
}
public bool SupportChange {
get {
return true;
}
}
public string Store (string id, string text)
{
EnsureOutput ();
SetupEntry (zipOutput, ref id);
var writer = new StreamWriter (zipOutput);
writer.Write (text);
writer.Flush ();
return id;
}
public string Store (string id, byte[] data)
{
EnsureOutput ();
SetupEntry (zipOutput, ref id);
zipOutput.Write (data, 0, data.Length);
return id;
}
public string Store (string id, Stream stream)
{
EnsureOutput ();
SetupEntry (zipOutput, ref id);
stream.CopyTo (zipOutput);
return id;
}
void SetupEntry (ZipOutputStream zipOutput, ref string id)
{
if (string.IsNullOrEmpty (id))
id = GetNewCode ();
ZipEntry entry = new ZipEntry (id);
zipOutput.PutNextEntry (entry);
}
public Stream Retrieve (string id)
{
EnsureInput ();
int index;
ZipEntry entry;
if (!entries.TryGetValue (id, out index) || (entry = zipFile[index]) == null)
entry = zipFile.GetEntry (id);
if (entry != null)
return zipFile.GetInputStream (entry);
else
throw new ArgumentException ("id", string.Format ("'{0}' isn't a valid id for this storage", id));
}
public IEnumerable<string> GetAvailableIds ()
{
EnsureInput ();
return zipFile.Cast<ZipEntry> ().Select (ze => ze.Name);
}
void EnsureOutput ()
{
if (zipFile != null)
throw new InvalidOperationException ("This ZipStorage instance is already used in read-mode");
if (zipOutput != null)
return;
zipOutput = new ZipOutputStream (File.Create (zipFileName));
}
void EnsureInput ()
{
if (zipOutput != null)
throw new InvalidOperationException ("This ZipStorage instance is already used in write-mode");
if (zipFile != null)
return;
zipFile = new ZipFile (zipFileName);
entries = Enumerable.Range (0, zipFile.Size).ToDictionary (i => zipFile[i].Name, i => i);
}
public void Dispose ()
{
if (zipOutput != null)
zipOutput.Dispose ();
if (zipFile != null)
zipFile.Close ();
}
string GetNewCode ()
{
return String.Format ("{0}", code++);
}
}
}
| 21.386364 | 102 | 0.658519 | [
"Apache-2.0"
] | 121468615/mono | mcs/class/monodoc/Monodoc/storage/ZipStorage.cs | 2,823 | C# |
using System.Threading;
using System.Threading.Tasks;
using DevChatter.Bot.Core;
using DevChatter.Bot.Core.Util;
using Microsoft.Extensions.Hosting;
namespace DevChatter.Bot.Infra.Web
{
public class DevChatterBotBackgroundWorker : IHostedService
{
private readonly ILoggerAdapter<DevChatterBotBackgroundWorker> _logger;
private readonly BotMain _botMain;
public DevChatterBotBackgroundWorker(BotMain botMain, ILoggerAdapter<DevChatterBotBackgroundWorker> logger)
{
_logger = logger;
_botMain = botMain;
}
public Task StartAsync(CancellationToken cancellationToken)
{
_logger.LogInformation("DevChatterBotBackgroundWorker StartAsync");
return _botMain.Run();
}
public Task StopAsync(CancellationToken stoppingToken)
{
_logger.LogInformation("DevChatterBotBackgroundWorker StopAsync");
return _botMain.Stop();
}
}
}
| 29.147059 | 115 | 0.69223 | [
"MIT"
] | skyhoshi/devchatterbot | src/DevChatter.Bot.Infra.Web/DevChatterBotBackgroundWorker.cs | 991 | C# |
#region Usings
using System;
using System.Collections.Generic;
using FluentAssertions;
using Xunit;
#endregion
namespace Extend.Testing
{
public partial class TypeExTest
{
[Fact]
public void GetGenericTypeArgumentNullValueTest()
{
Type type = null;
// ReSharper disable once ReturnValueOfPureMethodIsNotUsed
// ReSharper disable once AssignNullToNotNullAttribute
Action test = () => type.GetGenericTypeArgument();
Assert.Throws<ArgumentNullException>( test );
}
[Fact]
public void GetGenericTypeArgumentTest()
{
var actual = typeof(String).GetGenericTypeArgument();
actual.Should()
.BeNull();
}
[Fact]
public void GetGenericTypeArgumentTest1()
{
var actual = typeof(List<String>).GetGenericTypeArgument();
actual.Should()
.Be( typeof(String) );
}
[Fact]
public void GetGenericTypeArgumentTest2()
{
var actual = typeof(Dictionary<Int32, String>).GetGenericTypeArgument();
actual.Should()
.Be( typeof(Int32) );
}
}
} | 26.44898 | 85 | 0.551698 | [
"MIT"
] | DaveSenn/Extend | .Src/Extend.Testing/System.Type/Type.GetGenericTypeArgument.Test.cs | 1,250 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OppAnimal
{
class Family
{
public string Name;
public int numberOfToes;
public int numberOfTeeth;
public bool whiskers;
public bool doesJeremyLikeIt;
public Family(string _name = null)
{
Name = _name;
Console.WriteLine("Creating: " + _name + " at " + DateTime.Now.ToString("yyyy-MM-dd"));
}
public void setAttributes(Family sentFamily)
{
numberOfToes = sentFamily.numberOfToes;
numberOfTeeth = sentFamily.numberOfTeeth;
}
public bool doesJeremyLikeThisFamily()
{
return doesJeremyLikeIt;
}
}
}
| 24.454545 | 99 | 0.60223 | [
"MIT"
] | Yancey2021/OopAnimal | OppAnimal/OppAnimal/Family.cs | 809 | C# |
using System.Collections.Generic;
using System.Linq;
namespace Our.Umbraco.Look.Extensions
{
internal static partial class IEnumerableExtensions
{
/// <summary>
/// Returns true if both are null, or both collections have the same elements regardless of sequence
/// https://stackoverflow.com/questions/3669970/compare-two-listt-objects-for-equality-ignoring-order
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <param name="first"></param>
/// <param name="second"></param>
/// <returns></returns>
internal static bool BothNullOrElementsEqual<TSource>(this IEnumerable<TSource> first, IEnumerable<TSource> second)
{
if (first == null && second == null) return true; // both are null, so neither has any elements
if (first == null || second == null) return false; // one collection exists, so elements must differ
if (first.Count() != second.Count()) return false;
var areEqual = true;
if (first.Any())
{
Stack<TSource> stack = new Stack<TSource>(first);
List<TSource> list = new List<TSource>(second);
do
{
var element = stack.Pop();
if (!list.Contains(element))
{
areEqual = false;
}
else
{
list.Remove(element);
}
}
while (areEqual && stack.Any());
}
return areEqual;
}
}
}
| 32.941176 | 123 | 0.51131 | [
"MIT"
] | Hendy/umbraco-look | src/Our.Umbraco.Look/Extensions/IEnumerableExtensions/BothNullOrElementsEqual.cs | 1,682 | C# |
using System;
namespace SharpVectors.Dom.Svg
{
public interface ISvgColorProfileRule
{
}
}
| 12.555556 | 42 | 0.646018 | [
"BSD-3-Clause"
] | Creative-Safety-Supply/SharpVectors-1 | Source/SharpVectorCore/Svg/DocumentStructure/ISvgColorProfileRule.cs | 115 | C# |
using System;
namespace PatchKit.Api.Models.Main
{
[Serializable]
public struct PatcherBannerImageDimensions
{
public int x;
public int y;
}
} | 15.583333 | 47 | 0.604278 | [
"MIT"
] | TheoooooM/Odysquette | Assets/PatchKit/UnityEditorExtension/Editor/Api/Models/Main/PatcherBannerImageDimensions.cs | 187 | C# |
using System;
namespace Sophon.Toolkit.IdentityCenter.DevApiSrv
{
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string Summary { get; set; }
}
}
| 20 | 69 | 0.628125 | [
"MIT"
] | zhaobingwang/Sophon | App/IdentityCenter/backend/src/Sophon.Toolkit.IdentityCenter.DevApiSrv/WeatherForecast.cs | 320 | 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/processthreadsapi.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved.
using System;
using System.Runtime.InteropServices;
namespace TerraFX.Interop
{
public static unsafe partial class Windows
{
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("DWORD")]
public static extern uint QueueUserAPC([NativeTypeName("PAPCFUNC")] delegate* unmanaged<nuint, void> pfnAPC, [NativeTypeName("HANDLE")] IntPtr hThread, [NativeTypeName("ULONG_PTR")] nuint dwData);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int QueueUserAPC2([NativeTypeName("PAPCFUNC")] delegate* unmanaged<nuint, void> ApcRoutine, [NativeTypeName("HANDLE")] IntPtr Thread, [NativeTypeName("ULONG_PTR")] nuint Data, QUEUE_USER_APC_FLAGS Flags);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetProcessTimes([NativeTypeName("HANDLE")] IntPtr hProcess, [NativeTypeName("LPFILETIME")] FILETIME* lpCreationTime, [NativeTypeName("LPFILETIME")] FILETIME* lpExitTime, [NativeTypeName("LPFILETIME")] FILETIME* lpKernelTime, [NativeTypeName("LPFILETIME")] FILETIME* lpUserTime);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("HANDLE")]
public static extern IntPtr GetCurrentProcess();
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("DWORD")]
public static extern uint GetCurrentProcessId();
[DllImport("kernel32", ExactSpelling = true)]
public static extern void ExitProcess([NativeTypeName("UINT")] uint uExitCode);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int TerminateProcess([NativeTypeName("HANDLE")] IntPtr hProcess, [NativeTypeName("UINT")] uint uExitCode);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetExitCodeProcess([NativeTypeName("HANDLE")] IntPtr hProcess, [NativeTypeName("LPDWORD")] uint* lpExitCode);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int SwitchToThread();
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("HANDLE")]
public static extern IntPtr CreateThread([NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES* lpThreadAttributes, [NativeTypeName("SIZE_T")] nuint dwStackSize, [NativeTypeName("LPTHREAD_START_ROUTINE")] delegate* unmanaged<void*, uint> lpStartAddress, [NativeTypeName("LPVOID")] void* lpParameter, [NativeTypeName("DWORD")] uint dwCreationFlags, [NativeTypeName("LPDWORD")] uint* lpThreadId);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("HANDLE")]
public static extern IntPtr CreateRemoteThread([NativeTypeName("HANDLE")] IntPtr hProcess, [NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES* lpThreadAttributes, [NativeTypeName("SIZE_T")] nuint dwStackSize, [NativeTypeName("LPTHREAD_START_ROUTINE")] delegate* unmanaged<void*, uint> lpStartAddress, [NativeTypeName("LPVOID")] void* lpParameter, [NativeTypeName("DWORD")] uint dwCreationFlags, [NativeTypeName("LPDWORD")] uint* lpThreadId);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("HANDLE")]
public static extern IntPtr GetCurrentThread();
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("DWORD")]
public static extern uint GetCurrentThreadId();
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("HANDLE")]
public static extern IntPtr OpenThread([NativeTypeName("DWORD")] uint dwDesiredAccess, [NativeTypeName("BOOL")] int bInheritHandle, [NativeTypeName("DWORD")] uint dwThreadId);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetThreadPriority([NativeTypeName("HANDLE")] IntPtr hThread, int nPriority);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetThreadPriorityBoost([NativeTypeName("HANDLE")] IntPtr hThread, [NativeTypeName("BOOL")] int bDisablePriorityBoost);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetThreadPriorityBoost([NativeTypeName("HANDLE")] IntPtr hThread, [NativeTypeName("PBOOL")] int* pDisablePriorityBoost);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
public static extern int GetThreadPriority([NativeTypeName("HANDLE")] IntPtr hThread);
[DllImport("kernel32", ExactSpelling = true)]
public static extern void ExitThread([NativeTypeName("DWORD")] uint dwExitCode);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int TerminateThread([NativeTypeName("HANDLE")] IntPtr hThread, [NativeTypeName("DWORD")] uint dwExitCode);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetExitCodeThread([NativeTypeName("HANDLE")] IntPtr hThread, [NativeTypeName("LPDWORD")] uint* lpExitCode);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("DWORD")]
public static extern uint SuspendThread([NativeTypeName("HANDLE")] IntPtr hThread);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("DWORD")]
public static extern uint ResumeThread([NativeTypeName("HANDLE")] IntPtr hThread);
[DllImport("kernelbase", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("DWORD")]
public static extern uint TlsAlloc();
[DllImport("kernelbase", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("LPVOID")]
public static extern void* TlsGetValue([NativeTypeName("DWORD")] uint dwTlsIndex);
[DllImport("kernelbase", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int TlsSetValue([NativeTypeName("DWORD")] uint dwTlsIndex, [NativeTypeName("LPVOID")] void* lpTlsValue);
[DllImport("kernelbase", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int TlsFree([NativeTypeName("DWORD")] uint dwTlsIndex);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int CreateProcessA([NativeTypeName("LPCSTR")] sbyte* lpApplicationName, [NativeTypeName("LPSTR")] sbyte* lpCommandLine, [NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES* lpProcessAttributes, [NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES* lpThreadAttributes, [NativeTypeName("BOOL")] int bInheritHandles, [NativeTypeName("DWORD")] uint dwCreationFlags, [NativeTypeName("LPVOID")] void* lpEnvironment, [NativeTypeName("LPCSTR")] sbyte* lpCurrentDirectory, [NativeTypeName("LPSTARTUPINFOA")] STARTUPINFOA* lpStartupInfo, [NativeTypeName("LPPROCESS_INFORMATION")] PROCESS_INFORMATION* lpProcessInformation);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int CreateProcessW([NativeTypeName("LPCWSTR")] ushort* lpApplicationName, [NativeTypeName("LPWSTR")] ushort* lpCommandLine, [NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES* lpProcessAttributes, [NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES* lpThreadAttributes, [NativeTypeName("BOOL")] int bInheritHandles, [NativeTypeName("DWORD")] uint dwCreationFlags, [NativeTypeName("LPVOID")] void* lpEnvironment, [NativeTypeName("LPCWSTR")] ushort* lpCurrentDirectory, [NativeTypeName("LPSTARTUPINFOW")] STARTUPINFOW* lpStartupInfo, [NativeTypeName("LPPROCESS_INFORMATION")] PROCESS_INFORMATION* lpProcessInformation);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetProcessShutdownParameters([NativeTypeName("DWORD")] uint dwLevel, [NativeTypeName("DWORD")] uint dwFlags);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("DWORD")]
public static extern uint GetProcessVersion([NativeTypeName("DWORD")] uint ProcessId);
[DllImport("kernel32", ExactSpelling = true)]
public static extern void GetStartupInfoW([NativeTypeName("LPSTARTUPINFOW")] STARTUPINFOW* lpStartupInfo);
[DllImport("advapi32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int CreateProcessAsUserW([NativeTypeName("HANDLE")] IntPtr hToken, [NativeTypeName("LPCWSTR")] ushort* lpApplicationName, [NativeTypeName("LPWSTR")] ushort* lpCommandLine, [NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES* lpProcessAttributes, [NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES* lpThreadAttributes, [NativeTypeName("BOOL")] int bInheritHandles, [NativeTypeName("DWORD")] uint dwCreationFlags, [NativeTypeName("LPVOID")] void* lpEnvironment, [NativeTypeName("LPCWSTR")] ushort* lpCurrentDirectory, [NativeTypeName("LPSTARTUPINFOW")] STARTUPINFOW* lpStartupInfo, [NativeTypeName("LPPROCESS_INFORMATION")] PROCESS_INFORMATION* lpProcessInformation);
[DllImport("advapi32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetThreadToken([NativeTypeName("PHANDLE")] IntPtr* Thread, [NativeTypeName("HANDLE")] IntPtr Token);
[DllImport("advapi32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int OpenProcessToken([NativeTypeName("HANDLE")] IntPtr ProcessHandle, [NativeTypeName("DWORD")] uint DesiredAccess, [NativeTypeName("PHANDLE")] IntPtr* TokenHandle);
[DllImport("advapi32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int OpenThreadToken([NativeTypeName("HANDLE")] IntPtr ThreadHandle, [NativeTypeName("DWORD")] uint DesiredAccess, [NativeTypeName("BOOL")] int OpenAsSelf, [NativeTypeName("PHANDLE")] IntPtr* TokenHandle);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetPriorityClass([NativeTypeName("HANDLE")] IntPtr hProcess, [NativeTypeName("DWORD")] uint dwPriorityClass);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("DWORD")]
public static extern uint GetPriorityClass([NativeTypeName("HANDLE")] IntPtr hProcess);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetThreadStackGuarantee([NativeTypeName("PULONG")] uint* StackSizeInBytes);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int ProcessIdToSessionId([NativeTypeName("DWORD")] uint dwProcessId, [NativeTypeName("DWORD *")] uint* pSessionId);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("DWORD")]
public static extern uint GetProcessId([NativeTypeName("HANDLE")] IntPtr Process);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("DWORD")]
public static extern uint GetThreadId([NativeTypeName("HANDLE")] IntPtr Thread);
[DllImport("kernel32", ExactSpelling = true)]
public static extern void FlushProcessWriteBuffers();
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("DWORD")]
public static extern uint GetProcessIdOfThread([NativeTypeName("HANDLE")] IntPtr Thread);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int InitializeProcThreadAttributeList([NativeTypeName("LPPROC_THREAD_ATTRIBUTE_LIST")] IntPtr lpAttributeList, [NativeTypeName("DWORD")] uint dwAttributeCount, [NativeTypeName("DWORD")] uint dwFlags, [NativeTypeName("PSIZE_T")] nuint* lpSize);
[DllImport("kernel32", ExactSpelling = true)]
public static extern void DeleteProcThreadAttributeList([NativeTypeName("LPPROC_THREAD_ATTRIBUTE_LIST")] IntPtr lpAttributeList);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int UpdateProcThreadAttribute([NativeTypeName("LPPROC_THREAD_ATTRIBUTE_LIST")] IntPtr lpAttributeList, [NativeTypeName("DWORD")] uint dwFlags, [NativeTypeName("DWORD_PTR")] nuint Attribute, [NativeTypeName("PVOID")] void* lpValue, [NativeTypeName("SIZE_T")] nuint cbSize, [NativeTypeName("PVOID")] void* lpPreviousValue, [NativeTypeName("PSIZE_T")] nuint* lpReturnSize);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetProcessDynamicEHContinuationTargets([NativeTypeName("HANDLE")] IntPtr Process, [NativeTypeName("USHORT")] ushort NumberOfTargets, [NativeTypeName("PPROCESS_DYNAMIC_EH_CONTINUATION_TARGET")] PROCESS_DYNAMIC_EH_CONTINUATION_TARGET* Targets);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetProcessDynamicEnforcedCetCompatibleRanges([NativeTypeName("HANDLE")] IntPtr Process, [NativeTypeName("USHORT")] ushort NumberOfRanges, [NativeTypeName("PPROCESS_DYNAMIC_ENFORCED_ADDRESS_RANGE")] PROCESS_DYNAMIC_ENFORCED_ADDRESS_RANGE* Ranges);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetProcessAffinityUpdateMode([NativeTypeName("HANDLE")] IntPtr hProcess, [NativeTypeName("DWORD")] uint dwFlags);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int QueryProcessAffinityUpdateMode([NativeTypeName("HANDLE")] IntPtr hProcess, [NativeTypeName("LPDWORD")] uint* lpdwFlags);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("HANDLE")]
public static extern IntPtr CreateRemoteThreadEx([NativeTypeName("HANDLE")] IntPtr hProcess, [NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES* lpThreadAttributes, [NativeTypeName("SIZE_T")] nuint dwStackSize, [NativeTypeName("LPTHREAD_START_ROUTINE")] delegate* unmanaged<void*, uint> lpStartAddress, [NativeTypeName("LPVOID")] void* lpParameter, [NativeTypeName("DWORD")] uint dwCreationFlags, [NativeTypeName("LPPROC_THREAD_ATTRIBUTE_LIST")] IntPtr lpAttributeList, [NativeTypeName("LPDWORD")] uint* lpThreadId);
[DllImport("kernel32", ExactSpelling = true)]
public static extern void GetCurrentThreadStackLimits([NativeTypeName("PULONG_PTR")] uint* LowLimit, [NativeTypeName("PULONG_PTR")] uint* HighLimit);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetThreadContext([NativeTypeName("HANDLE")] IntPtr hThread, [NativeTypeName("LPCONTEXT")] CONTEXT* lpContext);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetProcessMitigationPolicy([NativeTypeName("HANDLE")] IntPtr hProcess, PROCESS_MITIGATION_POLICY MitigationPolicy, [NativeTypeName("PVOID")] void* lpBuffer, [NativeTypeName("SIZE_T")] nuint dwLength);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetThreadContext([NativeTypeName("HANDLE")] IntPtr hThread, [NativeTypeName("const CONTEXT *")] CONTEXT* lpContext);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetProcessMitigationPolicy(PROCESS_MITIGATION_POLICY MitigationPolicy, [NativeTypeName("PVOID")] void* lpBuffer, [NativeTypeName("SIZE_T")] nuint dwLength);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int FlushInstructionCache([NativeTypeName("HANDLE")] IntPtr hProcess, [NativeTypeName("LPCVOID")] void* lpBaseAddress, [NativeTypeName("SIZE_T")] nuint dwSize);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetThreadTimes([NativeTypeName("HANDLE")] IntPtr hThread, [NativeTypeName("LPFILETIME")] FILETIME* lpCreationTime, [NativeTypeName("LPFILETIME")] FILETIME* lpExitTime, [NativeTypeName("LPFILETIME")] FILETIME* lpKernelTime, [NativeTypeName("LPFILETIME")] FILETIME* lpUserTime);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("HANDLE")]
public static extern IntPtr OpenProcess([NativeTypeName("DWORD")] uint dwDesiredAccess, [NativeTypeName("BOOL")] int bInheritHandle, [NativeTypeName("DWORD")] uint dwProcessId);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int IsProcessorFeaturePresent([NativeTypeName("DWORD")] uint ProcessorFeature);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetProcessHandleCount([NativeTypeName("HANDLE")] IntPtr hProcess, [NativeTypeName("PDWORD")] uint* pdwHandleCount);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("DWORD")]
public static extern uint GetCurrentProcessorNumber();
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetThreadIdealProcessorEx([NativeTypeName("HANDLE")] IntPtr hThread, [NativeTypeName("PPROCESSOR_NUMBER")] PROCESSOR_NUMBER* lpIdealProcessor, [NativeTypeName("PPROCESSOR_NUMBER")] PROCESSOR_NUMBER* lpPreviousIdealProcessor);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetThreadIdealProcessorEx([NativeTypeName("HANDLE")] IntPtr hThread, [NativeTypeName("PPROCESSOR_NUMBER")] PROCESSOR_NUMBER* lpIdealProcessor);
[DllImport("kernel32", ExactSpelling = true)]
public static extern void GetCurrentProcessorNumberEx([NativeTypeName("PPROCESSOR_NUMBER")] PROCESSOR_NUMBER* ProcNumber);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetProcessPriorityBoost([NativeTypeName("HANDLE")] IntPtr hProcess, [NativeTypeName("PBOOL")] int* pDisablePriorityBoost);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetProcessPriorityBoost([NativeTypeName("HANDLE")] IntPtr hProcess, [NativeTypeName("BOOL")] int bDisablePriorityBoost);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetThreadIOPendingFlag([NativeTypeName("HANDLE")] IntPtr hThread, [NativeTypeName("PBOOL")] int* lpIOIsPending);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetSystemTimes([NativeTypeName("PFILETIME")] FILETIME* lpIdleTime, [NativeTypeName("PFILETIME")] FILETIME* lpKernelTime, [NativeTypeName("PFILETIME")] FILETIME* lpUserTime);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetThreadInformation([NativeTypeName("HANDLE")] IntPtr hThread, THREAD_INFORMATION_CLASS ThreadInformationClass, [NativeTypeName("LPVOID")] void* ThreadInformation, [NativeTypeName("DWORD")] uint ThreadInformationSize);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetThreadInformation([NativeTypeName("HANDLE")] IntPtr hThread, THREAD_INFORMATION_CLASS ThreadInformationClass, [NativeTypeName("LPVOID")] void* ThreadInformation, [NativeTypeName("DWORD")] uint ThreadInformationSize);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int IsProcessCritical([NativeTypeName("HANDLE")] IntPtr hProcess, [NativeTypeName("PBOOL")] int* Critical);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetProtectedPolicy([NativeTypeName("LPCGUID")] Guid* PolicyGuid, [NativeTypeName("ULONG_PTR")] nuint PolicyValue, [NativeTypeName("PULONG_PTR")] uint* OldPolicyValue);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int QueryProtectedPolicy([NativeTypeName("LPCGUID")] Guid* PolicyGuid, [NativeTypeName("PULONG_PTR")] uint* PolicyValue);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("DWORD")]
public static extern uint SetThreadIdealProcessor([NativeTypeName("HANDLE")] IntPtr hThread, [NativeTypeName("DWORD")] uint dwIdealProcessor);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetProcessInformation([NativeTypeName("HANDLE")] IntPtr hProcess, PROCESS_INFORMATION_CLASS ProcessInformationClass, [NativeTypeName("LPVOID")] void* ProcessInformation, [NativeTypeName("DWORD")] uint ProcessInformationSize);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetProcessInformation([NativeTypeName("HANDLE")] IntPtr hProcess, PROCESS_INFORMATION_CLASS ProcessInformationClass, [NativeTypeName("LPVOID")] void* ProcessInformation, [NativeTypeName("DWORD")] uint ProcessInformationSize);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetSystemCpuSetInformation([NativeTypeName("PSYSTEM_CPU_SET_INFORMATION")] SYSTEM_CPU_SET_INFORMATION* Information, [NativeTypeName("ULONG")] uint BufferLength, [NativeTypeName("PULONG")] uint* ReturnedLength, [NativeTypeName("HANDLE")] IntPtr Process, [NativeTypeName("ULONG")] uint Flags);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetProcessDefaultCpuSets([NativeTypeName("HANDLE")] IntPtr Process, [NativeTypeName("PULONG")] uint* CpuSetIds, [NativeTypeName("ULONG")] uint CpuSetIdCount, [NativeTypeName("PULONG")] uint* RequiredIdCount);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetProcessDefaultCpuSets([NativeTypeName("HANDLE")] IntPtr Process, [NativeTypeName("const ULONG *")] uint* CpuSetIds, [NativeTypeName("ULONG")] uint CpuSetIdCount);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetThreadSelectedCpuSets([NativeTypeName("HANDLE")] IntPtr Thread, [NativeTypeName("PULONG")] uint* CpuSetIds, [NativeTypeName("ULONG")] uint CpuSetIdCount, [NativeTypeName("PULONG")] uint* RequiredIdCount);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetThreadSelectedCpuSets([NativeTypeName("HANDLE")] IntPtr Thread, [NativeTypeName("const ULONG *")] uint* CpuSetIds, [NativeTypeName("ULONG")] uint CpuSetIdCount);
[DllImport("advapi32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int CreateProcessAsUserA([NativeTypeName("HANDLE")] IntPtr hToken, [NativeTypeName("LPCSTR")] sbyte* lpApplicationName, [NativeTypeName("LPSTR")] sbyte* lpCommandLine, [NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES* lpProcessAttributes, [NativeTypeName("LPSECURITY_ATTRIBUTES")] SECURITY_ATTRIBUTES* lpThreadAttributes, [NativeTypeName("BOOL")] int bInheritHandles, [NativeTypeName("DWORD")] uint dwCreationFlags, [NativeTypeName("LPVOID")] void* lpEnvironment, [NativeTypeName("LPCSTR")] sbyte* lpCurrentDirectory, [NativeTypeName("LPSTARTUPINFOA")] STARTUPINFOA* lpStartupInfo, [NativeTypeName("LPPROCESS_INFORMATION")] PROCESS_INFORMATION* lpProcessInformation);
[DllImport("kernel32", ExactSpelling = true, SetLastError = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetProcessShutdownParameters([NativeTypeName("LPDWORD")] uint* lpdwLevel, [NativeTypeName("LPDWORD")] uint* lpdwFlags);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetProcessDefaultCpuSetMasks([NativeTypeName("HANDLE")] IntPtr Process, [NativeTypeName("PGROUP_AFFINITY")] GROUP_AFFINITY* CpuSetMasks, [NativeTypeName("USHORT")] ushort CpuSetMaskCount, [NativeTypeName("PUSHORT")] ushort* RequiredMaskCount);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetProcessDefaultCpuSetMasks([NativeTypeName("HANDLE")] IntPtr Process, [NativeTypeName("PGROUP_AFFINITY")] GROUP_AFFINITY* CpuSetMasks, [NativeTypeName("USHORT")] ushort CpuSetMaskCount);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int GetThreadSelectedCpuSetMasks([NativeTypeName("HANDLE")] IntPtr Thread, [NativeTypeName("PGROUP_AFFINITY")] GROUP_AFFINITY* CpuSetMasks, [NativeTypeName("USHORT")] ushort CpuSetMaskCount, [NativeTypeName("PUSHORT")] ushort* RequiredMaskCount);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("BOOL")]
public static extern int SetThreadSelectedCpuSetMasks([NativeTypeName("HANDLE")] IntPtr Thread, [NativeTypeName("PGROUP_AFFINITY")] GROUP_AFFINITY* CpuSetMasks, [NativeTypeName("USHORT")] ushort CpuSetMaskCount);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("HRESULT")]
public static extern int SetThreadDescription([NativeTypeName("HANDLE")] IntPtr hThread, [NativeTypeName("PCWSTR")] ushort* lpThreadDescription);
[DllImport("kernel32", ExactSpelling = true)]
[return: NativeTypeName("HRESULT")]
public static extern int GetThreadDescription([NativeTypeName("HANDLE")] IntPtr hThread, [NativeTypeName("PWSTR *")] ushort** ppszThreadDescription);
[NativeTypeName("#define TLS_OUT_OF_INDEXES ((DWORD)0xFFFFFFFF)")]
public const uint TLS_OUT_OF_INDEXES = ((uint)(0xFFFFFFFF));
[NativeTypeName("#define CreateProcess CreateProcessW")]
public static delegate*<ushort*, ushort*, SECURITY_ATTRIBUTES*, SECURITY_ATTRIBUTES*, int, uint, void*, ushort*, STARTUPINFOW*, PROCESS_INFORMATION*, int> CreateProcess => &CreateProcessW;
[NativeTypeName("#define GetStartupInfo GetStartupInfoW")]
public static delegate*<STARTUPINFOW*, void> GetStartupInfo => &GetStartupInfoW;
[NativeTypeName("#define CreateProcessAsUser CreateProcessAsUserW")]
public static delegate*<IntPtr, ushort*, ushort*, SECURITY_ATTRIBUTES*, SECURITY_ATTRIBUTES*, int, uint, void*, ushort*, STARTUPINFOW*, PROCESS_INFORMATION*, int> CreateProcessAsUser => &CreateProcessAsUserW;
[NativeTypeName("#define PROC_THREAD_ATTRIBUTE_REPLACE_VALUE 0x00000001")]
public const int PROC_THREAD_ATTRIBUTE_REPLACE_VALUE = 0x00000001;
[NativeTypeName("#define PROCESS_AFFINITY_ENABLE_AUTO_UPDATE 0x00000001UL")]
public const uint PROCESS_AFFINITY_ENABLE_AUTO_UPDATE = 0x00000001U;
[NativeTypeName("#define THREAD_POWER_THROTTLING_CURRENT_VERSION 1")]
public const int THREAD_POWER_THROTTLING_CURRENT_VERSION = 1;
[NativeTypeName("#define THREAD_POWER_THROTTLING_EXECUTION_SPEED 0x1")]
public const int THREAD_POWER_THROTTLING_EXECUTION_SPEED = 0x1;
[NativeTypeName("#define THREAD_POWER_THROTTLING_VALID_FLAGS (THREAD_POWER_THROTTLING_EXECUTION_SPEED)")]
public const int THREAD_POWER_THROTTLING_VALID_FLAGS = (0x1);
[NativeTypeName("#define PME_CURRENT_VERSION 1")]
public const int PME_CURRENT_VERSION = 1;
[NativeTypeName("#define PME_FAILFAST_ON_COMMIT_FAIL_DISABLE 0x0")]
public const int PME_FAILFAST_ON_COMMIT_FAIL_DISABLE = 0x0;
[NativeTypeName("#define PME_FAILFAST_ON_COMMIT_FAIL_ENABLE 0x1")]
public const int PME_FAILFAST_ON_COMMIT_FAIL_ENABLE = 0x1;
[NativeTypeName("#define PROCESS_POWER_THROTTLING_CURRENT_VERSION 1")]
public const int PROCESS_POWER_THROTTLING_CURRENT_VERSION = 1;
[NativeTypeName("#define PROCESS_POWER_THROTTLING_EXECUTION_SPEED 0x1")]
public const int PROCESS_POWER_THROTTLING_EXECUTION_SPEED = 0x1;
[NativeTypeName("#define PROCESS_POWER_THROTTLING_VALID_FLAGS (PROCESS_POWER_THROTTLING_EXECUTION_SPEED)")]
public const int PROCESS_POWER_THROTTLING_VALID_FLAGS = (0x1);
[NativeTypeName("#define PROCESS_LEAP_SECOND_INFO_FLAG_ENABLE_SIXTY_SECOND 0x1")]
public const int PROCESS_LEAP_SECOND_INFO_FLAG_ENABLE_SIXTY_SECOND = 0x1;
[NativeTypeName("#define PROCESS_LEAP_SECOND_INFO_VALID_FLAGS (PROCESS_LEAP_SECOND_INFO_FLAG_ENABLE_SIXTY_SECOND)")]
public const int PROCESS_LEAP_SECOND_INFO_VALID_FLAGS = (0x1);
}
}
| 73.864608 | 715 | 0.73245 | [
"MIT"
] | DaZombieKiller/terrafx.interop.windows | sources/Interop/Windows/um/processthreadsapi/Windows.cs | 31,099 | C# |
using NUnit.Framework;
namespace ServiceStack.OrmLite.SqlServerTests.Expressions
{
public class PrimaryExpressionsTest : ExpressionsTestBase
{
private static class TestClass
{
public static int StaticProperty { get { return 12; } }
public static int _staticField = 12;
}
private class TestClass<T>
{
public static T StaticMethod(T value)
{
return value;
}
public T Property { get; set; }
public T _field;
public T Mehtod()
{
return _field;
}
public TestClass(T value)
{
Property = value;
_field = value;
}
}
private struct TestStruct<T>
{
public T Property { get { return _field; } }
public T _field;
public T Mehtod()
{
return _field;
}
public TestStruct(T value)
{
_field = value;
}
}
#region int
[Test]
public void Can_select_int_property_expression()
{
var tmp = new TestClass<int>(12);
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.IntColumn == tmp.Property);
Assert.IsNotNull(actual);
Assert.AreEqual(1, actual.Count);
CollectionAssert.Contains(actual, expected);
}
[Test]
public void Can_select_int_field_expression()
{
var tmp = new TestClass<int>(12);
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.IntColumn == tmp._field);
Assert.IsNotNull(actual);
Assert.AreEqual(1, actual.Count);
CollectionAssert.Contains(actual, expected);
}
[Test]
public void Can_select_int_method_expression()
{
var tmp = new TestClass<int>(12);
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.IntColumn == tmp.Mehtod());
Assert.IsNotNull(actual);
Assert.AreEqual(1, actual.Count);
CollectionAssert.Contains(actual, expected);
}
[Test]
public void Can_select_static_int_property_expression()
{
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.IntColumn == TestClass.StaticProperty);
Assert.IsNotNull(actual);
Assert.AreEqual(1, actual.Count);
CollectionAssert.Contains(actual, expected);
}
[Test]
public void Can_select_static_int_field_expression()
{
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.IntColumn == TestClass._staticField);
Assert.IsNotNull(actual);
Assert.AreEqual(1, actual.Count);
CollectionAssert.Contains(actual, expected);
}
[Test]
public void Can_select_static_int_method_expression()
{
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.IntColumn == TestClass<int>.StaticMethod(12));
Assert.IsNotNull(actual);
Assert.AreEqual(1, actual.Count);
CollectionAssert.Contains(actual, expected);
}
[Test]
public void Can_select_int_new_expression()
{
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.IntColumn == new TestClass<int>(12).Property);
Assert.IsNotNull(actual);
Assert.AreEqual(1, actual.Count);
CollectionAssert.Contains(actual, expected);
}
[Test]
public void Can_select_struct_int_field_expression()
{
var tmp = new TestStruct<int>(12);
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.IntColumn == tmp._field);
Assert.IsNotNull(actual);
Assert.AreEqual(1, actual.Count);
CollectionAssert.Contains(actual, expected);
}
[Test]
public void Can_select_struct_int_property_expression()
{
var tmp = new TestStruct<int>(12);
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.IntColumn == tmp.Property);
Assert.IsNotNull(actual);
Assert.AreEqual(1, actual.Count);
CollectionAssert.Contains(actual, expected);
}
[Test]
public void Can_select_struct_int_method_expression()
{
var tmp = new TestStruct<int>(12);
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.IntColumn == tmp.Mehtod());
Assert.IsNotNull(actual);
Assert.AreEqual(1, actual.Count);
CollectionAssert.Contains(actual, expected);
}
#endregion int
#region bool
[Test]
public void Can_select_bool_property_expression()
{
var tmp = new TestClass<bool>(false);
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.BoolColumn == tmp.Property);
Assert.IsNotNull(actual);
Assert.Greater(actual.Count, 1);
CollectionAssert.Contains(actual, expected);
}
[Test]
public void Can_select_bool_field_expression()
{
var tmp = new TestClass<bool>(false);
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.BoolColumn == tmp._field);
Assert.IsNotNull(actual);
Assert.Greater(actual.Count, 1);
CollectionAssert.Contains(actual, expected);
}
[Test]
public void Can_select_bool_method_expression()
{
var tmp = new TestClass<bool>(false);
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.BoolColumn == tmp.Mehtod());
Assert.IsNotNull(actual);
Assert.Greater(actual.Count, 1);
CollectionAssert.Contains(actual, expected);
}
[Test]
public void Can_select_static_bool_method_expression()
{
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.BoolColumn == TestClass<bool>.StaticMethod(false));
Assert.IsNotNull(actual);
Assert.Greater(actual.Count, 1);
CollectionAssert.Contains(actual, expected);
}
[Test]
public void Can_select_bool_new_expression()
{
var expected = new TestType()
{
IntColumn = 12,
BoolColumn = false,
StringColumn = "test"
};
EstablishContext(10, expected);
var actual = ConnectionString.OpenDbConnection().Select<TestType>(q => q.BoolColumn == new TestClass<bool>(false).Property);
Assert.IsNotNull(actual);
Assert.Greater(actual.Count, 1);
CollectionAssert.Contains(actual, expected);
}
#endregion bool
}
} | 28.358904 | 136 | 0.519467 | [
"BSD-3-Clause"
] | augustoproiete-forks/ServiceStack--ServiceStack.OrmLite | src/ServiceStack.OrmLite.SqlServerTests/Expressions/PrimaryExpressionsTest.cs | 10,353 | 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.IO;
using System.Text;
using System.Collections;
using System.Globalization;
using System.Net.Mail;
namespace System.Net.Mime
{
/// <summary>
/// Summary description for MimePart.
/// </summary>
internal class MimePart : MimeBasePart, IDisposable
{
private Stream _stream = null;
private bool _streamSet = false;
private bool _streamUsedOnce = false;
private AsyncCallback _readCallback;
private AsyncCallback _writeCallback;
private const int maxBufferSize = 0x4400; //seems optimal for send based on perf analysis
internal MimePart() { }
public void Dispose()
{
if (_stream != null)
{
_stream.Close();
}
}
internal Stream Stream => _stream;
internal ContentDisposition ContentDisposition
{
get { return _contentDisposition; }
set
{
_contentDisposition = value;
if (value == null)
{
((HeaderCollection)Headers).InternalRemove(MailHeaderInfo.GetString(MailHeaderID.ContentDisposition));
}
else
{
_contentDisposition.PersistIfNeeded((HeaderCollection)Headers, true);
}
}
}
internal TransferEncoding TransferEncoding
{
get
{
string value = Headers[MailHeaderInfo.GetString(MailHeaderID.ContentTransferEncoding)];
if (value.Equals("base64", StringComparison.OrdinalIgnoreCase))
{
return TransferEncoding.Base64;
}
else if (value.Equals("quoted-printable", StringComparison.OrdinalIgnoreCase))
{
return TransferEncoding.QuotedPrintable;
}
else if (value.Equals("7bit", StringComparison.OrdinalIgnoreCase))
{
return TransferEncoding.SevenBit;
}
else if (value.Equals("8bit", StringComparison.OrdinalIgnoreCase))
{
return TransferEncoding.EightBit;
}
else
{
return TransferEncoding.Unknown;
}
}
set
{
//QFE 4554
if (value == TransferEncoding.Base64)
{
Headers[MailHeaderInfo.GetString(MailHeaderID.ContentTransferEncoding)] = "base64";
}
else if (value == TransferEncoding.QuotedPrintable)
{
Headers[MailHeaderInfo.GetString(MailHeaderID.ContentTransferEncoding)] = "quoted-printable";
}
else if (value == TransferEncoding.SevenBit)
{
Headers[MailHeaderInfo.GetString(MailHeaderID.ContentTransferEncoding)] = "7bit";
}
else if (value == TransferEncoding.EightBit)
{
Headers[MailHeaderInfo.GetString(MailHeaderID.ContentTransferEncoding)] = "8bit";
}
else
{
throw new NotSupportedException(SR.Format(SR.MimeTransferEncodingNotSupported, value));
}
}
}
internal void SetContent(Stream stream)
{
if (stream == null)
{
throw new ArgumentNullException(nameof(stream));
}
if (_streamSet)
{
_stream.Close();
_stream = null;
_streamSet = false;
}
_stream = stream;
_streamSet = true;
_streamUsedOnce = false;
TransferEncoding = TransferEncoding.Base64;
}
internal void SetContent(Stream stream, string name, string mimeType)
{
if (stream == null)
{
throw new ArgumentNullException(nameof(stream));
}
if (mimeType != null && mimeType != string.Empty)
{
_contentType = new ContentType(mimeType);
}
if (name != null && name != string.Empty)
{
ContentType.Name = name;
}
SetContent(stream);
}
internal void SetContent(Stream stream, ContentType contentType)
{
if (stream == null)
{
throw new ArgumentNullException(nameof(stream));
}
_contentType = contentType;
SetContent(stream);
}
internal void Complete(IAsyncResult result, Exception e)
{
//if we already completed and we got called again,
//it mean's that there was an exception in the callback and we
//should just rethrow it.
MimePartContext context = (MimePartContext)result.AsyncState;
if (context._completed)
{
throw e;
}
try
{
if (context._outputStream != null)
{
context._outputStream.Close();
}
}
catch (Exception ex)
{
if (e == null)
{
e = ex;
}
}
context._completed = true;
context._result.InvokeCallback(e);
}
internal void ReadCallback(IAsyncResult result)
{
if (result.CompletedSynchronously)
{
return;
}
((MimePartContext)result.AsyncState)._completedSynchronously = false;
try
{
ReadCallbackHandler(result);
}
catch (Exception e)
{
Complete(result, e);
}
}
internal void ReadCallbackHandler(IAsyncResult result)
{
MimePartContext context = (MimePartContext)result.AsyncState;
context._bytesLeft = Stream.EndRead(result);
if (context._bytesLeft > 0)
{
IAsyncResult writeResult = context._outputStream.BeginWrite(context._buffer, 0, context._bytesLeft, _writeCallback, context);
if (writeResult.CompletedSynchronously)
{
WriteCallbackHandler(writeResult);
}
}
else
{
Complete(result, null);
}
}
internal void WriteCallback(IAsyncResult result)
{
if (result.CompletedSynchronously)
{
return;
}
((MimePartContext)result.AsyncState)._completedSynchronously = false;
try
{
WriteCallbackHandler(result);
}
catch (Exception e)
{
Complete(result, e);
}
}
internal void WriteCallbackHandler(IAsyncResult result)
{
MimePartContext context = (MimePartContext)result.AsyncState;
context._outputStream.EndWrite(result);
IAsyncResult readResult = Stream.BeginRead(context._buffer, 0, context._buffer.Length, _readCallback, context);
if (readResult.CompletedSynchronously)
{
ReadCallbackHandler(readResult);
}
}
internal Stream GetEncodedStream(Stream stream)
{
Stream outputStream = stream;
if (TransferEncoding == TransferEncoding.Base64)
{
outputStream = new Base64Stream(outputStream, new Base64WriteStateInfo());
}
else if (TransferEncoding == TransferEncoding.QuotedPrintable)
{
outputStream = new QuotedPrintableStream(outputStream, true);
}
else if (TransferEncoding == TransferEncoding.SevenBit || TransferEncoding == TransferEncoding.EightBit)
{
outputStream = new EightBitStream(outputStream);
}
return outputStream;
}
internal void ContentStreamCallbackHandler(IAsyncResult result)
{
MimePartContext context = (MimePartContext)result.AsyncState;
Stream outputStream = context._writer.EndGetContentStream(result);
context._outputStream = GetEncodedStream(outputStream);
_readCallback = new AsyncCallback(ReadCallback);
_writeCallback = new AsyncCallback(WriteCallback);
IAsyncResult readResult = Stream.BeginRead(context._buffer, 0, context._buffer.Length, _readCallback, context);
if (readResult.CompletedSynchronously)
{
ReadCallbackHandler(readResult);
}
}
internal void ContentStreamCallback(IAsyncResult result)
{
if (result.CompletedSynchronously)
{
return;
}
((MimePartContext)result.AsyncState)._completedSynchronously = false;
try
{
ContentStreamCallbackHandler(result);
}
catch (Exception e)
{
Complete(result, e);
}
}
internal class MimePartContext
{
internal MimePartContext(BaseWriter writer, LazyAsyncResult result)
{
_writer = writer;
_result = result;
_buffer = new byte[maxBufferSize];
}
internal Stream _outputStream;
internal LazyAsyncResult _result;
internal int _bytesLeft;
internal BaseWriter _writer;
internal byte[] _buffer;
internal bool _completed;
internal bool _completedSynchronously = true;
}
internal override IAsyncResult BeginSend(BaseWriter writer, AsyncCallback callback, bool allowUnicode, object state)
{
PrepareHeaders(allowUnicode);
writer.WriteHeaders(Headers, allowUnicode);
MimePartAsyncResult result = new MimePartAsyncResult(this, state, callback);
MimePartContext context = new MimePartContext(writer, result);
ResetStream();
_streamUsedOnce = true;
IAsyncResult contentResult = writer.BeginGetContentStream(new AsyncCallback(ContentStreamCallback), context);
if (contentResult.CompletedSynchronously)
{
ContentStreamCallbackHandler(contentResult);
}
return result;
}
internal override void Send(BaseWriter writer, bool allowUnicode)
{
if (Stream != null)
{
byte[] buffer = new byte[maxBufferSize];
PrepareHeaders(allowUnicode);
writer.WriteHeaders(Headers, allowUnicode);
Stream outputStream = writer.GetContentStream();
outputStream = GetEncodedStream(outputStream);
int read;
ResetStream();
_streamUsedOnce = true;
while ((read = Stream.Read(buffer, 0, maxBufferSize)) > 0)
{
outputStream.Write(buffer, 0, read);
}
outputStream.Close();
}
}
//Ensures that if we've used the stream once, we will either reset it to the origin, or throw.
internal void ResetStream()
{
if (_streamUsedOnce)
{
if (Stream.CanSeek)
{
Stream.Seek(0, SeekOrigin.Begin);
_streamUsedOnce = false;
}
else
{
throw new InvalidOperationException(SR.MimePartCantResetStream);
}
}
}
}
}
| 32.194805 | 141 | 0.521904 | [
"MIT"
] | FrancisFYK/corefx | src/System.Net.Mail/src/System/Net/Mime/MimePart.cs | 12,395 | C# |
// This file is part of Silk.NET.
//
// You may modify and distribute Silk.NET under the terms
// of the MIT license. See the LICENSE file for details.
using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Text;
using Silk.NET.Core;
using Silk.NET.Core.Native;
using Silk.NET.Core.Attributes;
using Silk.NET.Core.Contexts;
using Silk.NET.Core.Loader;
#pragma warning disable 1591
namespace Silk.NET.OpenGL.Legacy.Extensions.NV
{
public static class NVCommandListOverloads
{
public static unsafe void CreateCommandLists(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint n, [Count(Parameter = "n"), Flow(FlowDirection.Out)] Span<uint> lists)
{
// SpanOverloader
thisApi.CreateCommandLists(n, out lists.GetPinnableReference());
}
public static unsafe void CreateStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint n, [Count(Parameter = "n"), Flow(FlowDirection.Out)] Span<uint> states)
{
// SpanOverloader
thisApi.CreateStates(n, out states.GetPinnableReference());
}
public static unsafe void DeleteCommandLists(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint n, [Count(Parameter = "n"), Flow(FlowDirection.In)] ReadOnlySpan<uint> lists)
{
// SpanOverloader
thisApi.DeleteCommandLists(n, in lists.GetPinnableReference());
}
public static unsafe void DeleteStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint n, [Count(Parameter = "n"), Flow(FlowDirection.In)] ReadOnlySpan<uint> states)
{
// SpanOverloader
thisApi.DeleteStates(n, in states.GetPinnableReference());
}
public static unsafe void DrawCommands(this NVCommandList thisApi, [Flow(FlowDirection.In)] NV primitiveMode, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] nint* indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommands(primitiveMode, buffer, indirects, in sizes.GetPinnableReference(), count);
}
public static unsafe void DrawCommands(this NVCommandList thisApi, [Flow(FlowDirection.In)] NV primitiveMode, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] ReadOnlySpan<nint> indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommands(primitiveMode, buffer, in indirects.GetPinnableReference(), sizes, count);
}
public static unsafe void DrawCommands(this NVCommandList thisApi, [Flow(FlowDirection.In)] NV primitiveMode, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] ReadOnlySpan<nint> indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommands(primitiveMode, buffer, in indirects.GetPinnableReference(), in sizes.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] NV primitiveMode, [Flow(FlowDirection.In)] ulong* indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsAddress(primitiveMode, indirects, in sizes.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] NV primitiveMode, [Flow(FlowDirection.In)] ReadOnlySpan<ulong> indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsAddress(primitiveMode, in indirects.GetPinnableReference(), sizes, count);
}
public static unsafe void DrawCommandsAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] NV primitiveMode, [Flow(FlowDirection.In)] ReadOnlySpan<ulong> indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsAddress(primitiveMode, in indirects.GetPinnableReference(), in sizes.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] nint* indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] uint* states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, indirects, sizes, states, in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] nint* indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, indirects, sizes, in states.GetPinnableReference(), fbos, count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] nint* indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, indirects, sizes, in states.GetPinnableReference(), in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] nint* indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] uint* states, [Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, indirects, in sizes.GetPinnableReference(), states, fbos, count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] nint* indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] uint* states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, indirects, in sizes.GetPinnableReference(), states, in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] nint* indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, indirects, in sizes.GetPinnableReference(), in states.GetPinnableReference(), fbos, count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] nint* indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, indirects, in sizes.GetPinnableReference(), in states.GetPinnableReference(), in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] ReadOnlySpan<nint> indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] uint* states, [Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, in indirects.GetPinnableReference(), sizes, states, fbos, count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] ReadOnlySpan<nint> indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] uint* states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, in indirects.GetPinnableReference(), sizes, states, in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] ReadOnlySpan<nint> indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, in indirects.GetPinnableReference(), sizes, in states.GetPinnableReference(), fbos, count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] ReadOnlySpan<nint> indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, in indirects.GetPinnableReference(), sizes, in states.GetPinnableReference(), in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] ReadOnlySpan<nint> indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] uint* states, [Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, in indirects.GetPinnableReference(), in sizes.GetPinnableReference(), states, fbos, count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] ReadOnlySpan<nint> indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] uint* states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, in indirects.GetPinnableReference(), in sizes.GetPinnableReference(), states, in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] ReadOnlySpan<nint> indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, in indirects.GetPinnableReference(), in sizes.GetPinnableReference(), in states.GetPinnableReference(), fbos, count);
}
public static unsafe void DrawCommandsStates(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint buffer, [Flow(FlowDirection.In)] ReadOnlySpan<nint> indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStates(buffer, in indirects.GetPinnableReference(), in sizes.GetPinnableReference(), in states.GetPinnableReference(), in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ulong* indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] uint* states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(indirects, sizes, states, in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ulong* indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(indirects, sizes, in states.GetPinnableReference(), fbos, count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ulong* indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(indirects, sizes, in states.GetPinnableReference(), in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ulong* indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] uint* states, [Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(indirects, in sizes.GetPinnableReference(), states, fbos, count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ulong* indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] uint* states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(indirects, in sizes.GetPinnableReference(), states, in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ulong* indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(indirects, in sizes.GetPinnableReference(), in states.GetPinnableReference(), fbos, count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ulong* indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(indirects, in sizes.GetPinnableReference(), in states.GetPinnableReference(), in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ReadOnlySpan<ulong> indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] uint* states, [Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(in indirects.GetPinnableReference(), sizes, states, fbos, count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ReadOnlySpan<ulong> indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] uint* states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(in indirects.GetPinnableReference(), sizes, states, in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ReadOnlySpan<ulong> indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(in indirects.GetPinnableReference(), sizes, in states.GetPinnableReference(), fbos, count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ReadOnlySpan<ulong> indirects, [Flow(FlowDirection.In)] uint* sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(in indirects.GetPinnableReference(), sizes, in states.GetPinnableReference(), in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ReadOnlySpan<ulong> indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] uint* states, [Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(in indirects.GetPinnableReference(), in sizes.GetPinnableReference(), states, fbos, count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ReadOnlySpan<ulong> indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] uint* states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(in indirects.GetPinnableReference(), in sizes.GetPinnableReference(), states, in fbos.GetPinnableReference(), count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ReadOnlySpan<ulong> indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(in indirects.GetPinnableReference(), in sizes.GetPinnableReference(), in states.GetPinnableReference(), fbos, count);
}
public static unsafe void DrawCommandsStatesAddress(this NVCommandList thisApi, [Flow(FlowDirection.In)] ReadOnlySpan<ulong> indirects, [Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.DrawCommandsStatesAddress(in indirects.GetPinnableReference(), in sizes.GetPinnableReference(), in states.GetPinnableReference(), in fbos.GetPinnableReference(), count);
}
public static unsafe void ListDrawCommandsStatesClient(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint list, [Flow(FlowDirection.In)] uint segment, [Count(Parameter = "count"), Flow(FlowDirection.In)] void** indirects, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* sizes, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* states, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.ListDrawCommandsStatesClient(list, segment, indirects, sizes, states, in fbos.GetPinnableReference(), count);
}
public static unsafe void ListDrawCommandsStatesClient(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint list, [Flow(FlowDirection.In)] uint segment, [Count(Parameter = "count"), Flow(FlowDirection.In)] void** indirects, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* sizes, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.ListDrawCommandsStatesClient(list, segment, indirects, sizes, in states.GetPinnableReference(), fbos, count);
}
public static unsafe void ListDrawCommandsStatesClient(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint list, [Flow(FlowDirection.In)] uint segment, [Count(Parameter = "count"), Flow(FlowDirection.In)] void** indirects, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* sizes, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.ListDrawCommandsStatesClient(list, segment, indirects, sizes, in states.GetPinnableReference(), in fbos.GetPinnableReference(), count);
}
public static unsafe void ListDrawCommandsStatesClient(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint list, [Flow(FlowDirection.In)] uint segment, [Count(Parameter = "count"), Flow(FlowDirection.In)] void** indirects, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* states, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.ListDrawCommandsStatesClient(list, segment, indirects, in sizes.GetPinnableReference(), states, fbos, count);
}
public static unsafe void ListDrawCommandsStatesClient(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint list, [Flow(FlowDirection.In)] uint segment, [Count(Parameter = "count"), Flow(FlowDirection.In)] void** indirects, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* states, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.ListDrawCommandsStatesClient(list, segment, indirects, in sizes.GetPinnableReference(), states, in fbos.GetPinnableReference(), count);
}
public static unsafe void ListDrawCommandsStatesClient(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint list, [Flow(FlowDirection.In)] uint segment, [Count(Parameter = "count"), Flow(FlowDirection.In)] void** indirects, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.ListDrawCommandsStatesClient(list, segment, indirects, in sizes.GetPinnableReference(), in states.GetPinnableReference(), fbos, count);
}
public static unsafe void ListDrawCommandsStatesClient(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint list, [Flow(FlowDirection.In)] uint segment, [Count(Parameter = "count"), Flow(FlowDirection.In)] void** indirects, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.ListDrawCommandsStatesClient(list, segment, indirects, in sizes.GetPinnableReference(), in states.GetPinnableReference(), in fbos.GetPinnableReference(), count);
}
public static unsafe void ListDrawCommandsStatesClient(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint list, [Flow(FlowDirection.In)] uint segment, [Count(Parameter = "count"), Flow(FlowDirection.In)] in void* indirects, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* sizes, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* states, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.ListDrawCommandsStatesClient(list, segment, in indirects, sizes, states, in fbos.GetPinnableReference(), count);
}
public static unsafe void ListDrawCommandsStatesClient(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint list, [Flow(FlowDirection.In)] uint segment, [Count(Parameter = "count"), Flow(FlowDirection.In)] in void* indirects, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* sizes, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.ListDrawCommandsStatesClient(list, segment, in indirects, sizes, in states.GetPinnableReference(), fbos, count);
}
public static unsafe void ListDrawCommandsStatesClient(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint list, [Flow(FlowDirection.In)] uint segment, [Count(Parameter = "count"), Flow(FlowDirection.In)] in void* indirects, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* sizes, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.ListDrawCommandsStatesClient(list, segment, in indirects, sizes, in states.GetPinnableReference(), in fbos.GetPinnableReference(), count);
}
public static unsafe void ListDrawCommandsStatesClient(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint list, [Flow(FlowDirection.In)] uint segment, [Count(Parameter = "count"), Flow(FlowDirection.In)] in void* indirects, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* states, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.ListDrawCommandsStatesClient(list, segment, in indirects, in sizes.GetPinnableReference(), states, fbos, count);
}
public static unsafe void ListDrawCommandsStatesClient(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint list, [Flow(FlowDirection.In)] uint segment, [Count(Parameter = "count"), Flow(FlowDirection.In)] in void* indirects, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* states, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.ListDrawCommandsStatesClient(list, segment, in indirects, in sizes.GetPinnableReference(), states, in fbos.GetPinnableReference(), count);
}
public static unsafe void ListDrawCommandsStatesClient(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint list, [Flow(FlowDirection.In)] uint segment, [Count(Parameter = "count"), Flow(FlowDirection.In)] in void* indirects, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Count(Parameter = "count"), Flow(FlowDirection.In)] uint* fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.ListDrawCommandsStatesClient(list, segment, in indirects, in sizes.GetPinnableReference(), in states.GetPinnableReference(), fbos, count);
}
public static unsafe void ListDrawCommandsStatesClient(this NVCommandList thisApi, [Flow(FlowDirection.In)] uint list, [Flow(FlowDirection.In)] uint segment, [Count(Parameter = "count"), Flow(FlowDirection.In)] in void* indirects, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> sizes, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> states, [Count(Parameter = "count"), Flow(FlowDirection.In)] ReadOnlySpan<uint> fbos, [Flow(FlowDirection.In)] uint count)
{
// SpanOverloader
thisApi.ListDrawCommandsStatesClient(list, segment, in indirects, in sizes.GetPinnableReference(), in states.GetPinnableReference(), in fbos.GetPinnableReference(), count);
}
}
}
| 85.376437 | 512 | 0.717781 | [
"MIT"
] | ThomasMiz/Silk.NET | src/OpenGL/Extensions/Silk.NET.OpenGL.Legacy.Extensions.NV/NVCommandListOverloads.gen.cs | 29,711 | C# |
using UnityEngine;
namespace Tonhex
{
public class Fruit : Item
{
public override void Scored()
{
Debug.Log("Fruit::Scored() - TODO");
}
}
}
| 11.411765 | 48 | 0.505155 | [
"MIT"
] | aofdtonhao/pacman_space-bit | Assets/Scripts/Item/Fruit.cs | 194 | C# |
using System;
namespace NStandard
{
public struct VString
{
public string String;
public VString(string str)
{
String = str;
}
public override bool Equals(object obj)
{
switch (obj)
{
case VString: return String.Equals(((VString)obj).String);
case string _obj: return String.Equals(_obj);
default: return Equals(String, obj);
}
}
public override int GetHashCode() => String.GetHashCode();
public static bool operator ==(VString left, VString right) => left.Equals(right);
public static bool operator !=(VString left, VString right) => !left.Equals(right);
public static implicit operator string(VString operand) => operand.String;
public static implicit operator VString(string operand) => new(operand);
public override string ToString() => String.ToString();
public static string GetString<T>(T obj) where T : struct
{
if (obj is VString)
return obj.GetReflector().Field<string>(nameof(String)).Value;
else return null;
}
}
}
| 29.536585 | 91 | 0.577209 | [
"MIT"
] | zmjack/NStandard | NStandard/VString.cs | 1,213 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace gView.Framework.system.UI
{
public class AeroGlass
{
[StructLayout(LayoutKind.Sequential)]
public struct MARGINS
{
public int Left;
public int Right;
public int Top;
public int Bottom;
}
[DllImport("dwmapi.dll", PreserveSig = false)]
public static extern void DwmExtendFrameIntoClientArea
(IntPtr hwnd, ref MARGINS margins);
[DllImport("dwmapi.dll", PreserveSig = false)]
public static extern bool DwmIsCompositionEnabled();
}
}
| 25.535714 | 62 | 0.627972 | [
"MIT"
] | chandusekhar/gViewGisOS | gView.system.UI/Framework/system/UI/AeroGlass.cs | 717 | 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: MethodRequest.cs.tt
namespace Microsoft.Graph
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using System.Threading;
/// <summary>
/// The type ContentTypeUnpublishRequest.
/// </summary>
public partial class ContentTypeUnpublishRequest : BaseRequest, IContentTypeUnpublishRequest
{
/// <summary>
/// Constructs a new ContentTypeUnpublishRequest.
/// </summary>
public ContentTypeUnpublishRequest(
string requestUrl,
IBaseClient client,
IEnumerable<Option> options)
: base(requestUrl, client, options)
{
}
/// <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>
public System.Threading.Tasks.Task PostAsync(
CancellationToken cancellationToken = default)
{
this.Method = HttpMethods.POST;
return this.SendAsync(null, cancellationToken);
}
/// <summary>
/// Issues the POST request and returns a <see cref="GraphResponse"/> object.
/// </summary>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
/// <returns>The <see cref="GraphResponse"/> object of the request</returns>
public System.Threading.Tasks.Task<GraphResponse> PostResponseAsync(CancellationToken cancellationToken = default)
{
this.Method = HttpMethods.POST;
return this.SendAsyncWithGraphResponse(null, 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>
public IContentTypeUnpublishRequest Expand(string value)
{
this.QueryOptions.Add(new QueryOption("$expand", value));
return this;
}
/// <summary>
/// Adds the specified select value to the request.
/// </summary>
/// <param name="value">The select value.</param>
/// <returns>The request object to send.</returns>
public IContentTypeUnpublishRequest Select(string value)
{
this.QueryOptions.Add(new QueryOption("$select", value));
return this;
}
}
}
| 36.865854 | 153 | 0.584519 | [
"MIT"
] | ScriptBox21/msgraph-sdk-dotnet | src/Microsoft.Graph/Generated/requests/ContentTypeUnpublishRequest.cs | 3,023 | C# |
#region License
// Copyright (c) 2007 James Newton-King
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Runtime.Serialization.Formatters;
using Wenli.Data.Es.Base.Newtonsoft.Json.Serialization;
using System.Runtime.Serialization;
namespace Wenli.Data.Es.Base.Newtonsoft.Json
{
/// <summary>
/// Specifies the settings on a <see cref="JsonSerializer"/> object.
/// </summary>
public class JsonSerializerSettings
{
internal const ReferenceLoopHandling DefaultReferenceLoopHandling = ReferenceLoopHandling.Error;
internal const MissingMemberHandling DefaultMissingMemberHandling = MissingMemberHandling.Ignore;
internal const NullValueHandling DefaultNullValueHandling = NullValueHandling.Include;
internal const DefaultValueHandling DefaultDefaultValueHandling = DefaultValueHandling.Include;
internal const ObjectCreationHandling DefaultObjectCreationHandling = ObjectCreationHandling.Auto;
internal const PreserveReferencesHandling DefaultPreserveReferencesHandling = PreserveReferencesHandling.None;
internal const ConstructorHandling DefaultConstructorHandling = ConstructorHandling.Default;
internal const TypeNameHandling DefaultTypeNameHandling = TypeNameHandling.None;
internal const MetadataPropertyHandling DefaultMetadataPropertyHandling = MetadataPropertyHandling.Default;
internal const FormatterAssemblyStyle DefaultTypeNameAssemblyFormat = FormatterAssemblyStyle.Simple;
internal static readonly StreamingContext DefaultContext;
internal const Formatting DefaultFormatting = Formatting.None;
internal const DateFormatHandling DefaultDateFormatHandling = DateFormatHandling.IsoDateFormat;
internal const DateTimeZoneHandling DefaultDateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind;
internal const DateParseHandling DefaultDateParseHandling = DateParseHandling.DateTime;
internal const FloatParseHandling DefaultFloatParseHandling = FloatParseHandling.Double;
internal const FloatFormatHandling DefaultFloatFormatHandling = FloatFormatHandling.String;
internal const StringEscapeHandling DefaultStringEscapeHandling = StringEscapeHandling.Default;
internal const FormatterAssemblyStyle DefaultFormatterAssemblyStyle = FormatterAssemblyStyle.Simple;
internal static readonly CultureInfo DefaultCulture;
internal const bool DefaultCheckAdditionalContent = false;
internal const string DefaultDateFormatString = @"yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";
internal Formatting? _formatting;
internal DateFormatHandling? _dateFormatHandling;
internal DateTimeZoneHandling? _dateTimeZoneHandling;
internal DateParseHandling? _dateParseHandling;
internal FloatFormatHandling? _floatFormatHandling;
internal FloatParseHandling? _floatParseHandling;
internal StringEscapeHandling? _stringEscapeHandling;
internal CultureInfo _culture;
internal bool? _checkAdditionalContent;
internal int? _maxDepth;
internal bool _maxDepthSet;
internal string _dateFormatString;
internal bool _dateFormatStringSet;
internal FormatterAssemblyStyle? _typeNameAssemblyFormat;
internal DefaultValueHandling? _defaultValueHandling;
internal PreserveReferencesHandling? _preserveReferencesHandling;
internal NullValueHandling? _nullValueHandling;
internal ObjectCreationHandling? _objectCreationHandling;
internal MissingMemberHandling? _missingMemberHandling;
internal ReferenceLoopHandling? _referenceLoopHandling;
internal StreamingContext? _context;
internal ConstructorHandling? _constructorHandling;
internal TypeNameHandling? _typeNameHandling;
internal MetadataPropertyHandling? _metadataPropertyHandling;
/// <summary>
/// Gets or sets how reference loops (e.g. a class referencing itself) is handled.
/// </summary>
/// <value>Reference loop handling.</value>
public ReferenceLoopHandling ReferenceLoopHandling
{
get { return _referenceLoopHandling ?? DefaultReferenceLoopHandling; }
set { _referenceLoopHandling = value; }
}
/// <summary>
/// Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization.
/// </summary>
/// <value>Missing member handling.</value>
public MissingMemberHandling MissingMemberHandling
{
get { return _missingMemberHandling ?? DefaultMissingMemberHandling; }
set { _missingMemberHandling = value; }
}
/// <summary>
/// Gets or sets how objects are created during deserialization.
/// </summary>
/// <value>The object creation handling.</value>
public ObjectCreationHandling ObjectCreationHandling
{
get { return _objectCreationHandling ?? DefaultObjectCreationHandling; }
set { _objectCreationHandling = value; }
}
/// <summary>
/// Gets or sets how null values are handled during serialization and deserialization.
/// </summary>
/// <value>Null value handling.</value>
public NullValueHandling NullValueHandling
{
get { return _nullValueHandling ?? DefaultNullValueHandling; }
set { _nullValueHandling = value; }
}
/// <summary>
/// Gets or sets how null default are handled during serialization and deserialization.
/// </summary>
/// <value>The default value handling.</value>
public DefaultValueHandling DefaultValueHandling
{
get { return _defaultValueHandling ?? DefaultDefaultValueHandling; }
set { _defaultValueHandling = value; }
}
/// <summary>
/// Gets or sets a collection <see cref="JsonConverter"/> that will be used during serialization.
/// </summary>
/// <value>The converters.</value>
public IList<JsonConverter> Converters { get; set; }
/// <summary>
/// Gets or sets how object references are preserved by the serializer.
/// </summary>
/// <value>The preserve references handling.</value>
public PreserveReferencesHandling PreserveReferencesHandling
{
get { return _preserveReferencesHandling ?? DefaultPreserveReferencesHandling; }
set { _preserveReferencesHandling = value; }
}
/// <summary>
/// Gets or sets how type name writing and reading is handled by the serializer.
/// </summary>
/// <value>The type name handling.</value>
public TypeNameHandling TypeNameHandling
{
get { return _typeNameHandling ?? DefaultTypeNameHandling; }
set { _typeNameHandling = value; }
}
/// <summary>
/// Gets or sets how metadata properties are used during deserialization.
/// </summary>
/// <value>The metadata properties handling.</value>
public MetadataPropertyHandling MetadataPropertyHandling
{
get { return _metadataPropertyHandling ?? DefaultMetadataPropertyHandling; }
set { _metadataPropertyHandling = value; }
}
/// <summary>
/// Gets or sets how a type name assembly is written and resolved by the serializer.
/// </summary>
/// <value>The type name assembly format.</value>
public FormatterAssemblyStyle TypeNameAssemblyFormat
{
get { return _typeNameAssemblyFormat ?? DefaultFormatterAssemblyStyle; }
set { _typeNameAssemblyFormat = value; }
}
/// <summary>
/// Gets or sets how constructors are used during deserialization.
/// </summary>
/// <value>The constructor handling.</value>
public ConstructorHandling ConstructorHandling
{
get { return _constructorHandling ?? DefaultConstructorHandling; }
set { _constructorHandling = value; }
}
/// <summary>
/// Gets or sets the contract resolver used by the serializer when
/// serializing .NET objects to JSON and vice versa.
/// </summary>
/// <value>The contract resolver.</value>
public IContractResolver ContractResolver { get; set; }
/// <summary>
/// Gets or sets the <see cref="IReferenceResolver"/> used by the serializer when resolving references.
/// </summary>
/// <value>The reference resolver.</value>
public IReferenceResolver ReferenceResolver { get; set; }
/// <summary>
/// Gets or sets the <see cref="ITraceWriter"/> used by the serializer when writing trace messages.
/// </summary>
/// <value>The trace writer.</value>
public ITraceWriter TraceWriter { get; set; }
/// <summary>
/// Gets or sets the <see cref="SerializationBinder"/> used by the serializer when resolving type names.
/// </summary>
/// <value>The binder.</value>
public SerializationBinder Binder { get; set; }
/// <summary>
/// Gets or sets the error handler called during serialization and deserialization.
/// </summary>
/// <value>The error handler called during serialization and deserialization.</value>
public EventHandler<ErrorEventArgs> Error { get; set; }
/// <summary>
/// Gets or sets the <see cref="StreamingContext"/> used by the serializer when invoking serialization callback methods.
/// </summary>
/// <value>The context.</value>
public StreamingContext Context
{
get { return _context ?? DefaultContext; }
set { _context = value; }
}
/// <summary>
/// Get or set how <see cref="DateTime"/> and <see cref="DateTimeOffset"/> values are formatting when writing JSON text.
/// </summary>
public string DateFormatString
{
get { return _dateFormatString ?? DefaultDateFormatString; }
set
{
_dateFormatString = value;
_dateFormatStringSet = true;
}
}
/// <summary>
/// Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a <see cref="JsonReaderException"/>.
/// </summary>
public int? MaxDepth
{
get { return _maxDepth; }
set
{
if (value <= 0)
throw new ArgumentException("Value must be positive.", "value");
_maxDepth = value;
_maxDepthSet = true;
}
}
/// <summary>
/// Indicates how JSON text output is formatted.
/// </summary>
public Formatting Formatting
{
get { return _formatting ?? DefaultFormatting; }
set { _formatting = value; }
}
/// <summary>
/// Get or set how dates are written to JSON text.
/// </summary>
public DateFormatHandling DateFormatHandling
{
get { return _dateFormatHandling ?? DefaultDateFormatHandling; }
set { _dateFormatHandling = value; }
}
/// <summary>
/// Get or set how <see cref="DateTime"/> time zones are handling during serialization and deserialization.
/// </summary>
public DateTimeZoneHandling DateTimeZoneHandling
{
get { return _dateTimeZoneHandling ?? DefaultDateTimeZoneHandling; }
set { _dateTimeZoneHandling = value; }
}
/// <summary>
/// Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON.
/// </summary>
public DateParseHandling DateParseHandling
{
get { return _dateParseHandling ?? DefaultDateParseHandling; }
set { _dateParseHandling = value; }
}
/// <summary>
/// Get or set how special floating point numbers, e.g. <see cref="F:System.Double.NaN"/>,
/// <see cref="F:System.Double.PositiveInfinity"/> and <see cref="F:System.Double.NegativeInfinity"/>,
/// are written as JSON.
/// </summary>
public FloatFormatHandling FloatFormatHandling
{
get { return _floatFormatHandling ?? DefaultFloatFormatHandling; }
set { _floatFormatHandling = value; }
}
/// <summary>
/// Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text.
/// </summary>
public FloatParseHandling FloatParseHandling
{
get { return _floatParseHandling ?? DefaultFloatParseHandling; }
set { _floatParseHandling = value; }
}
/// <summary>
/// Get or set how strings are escaped when writing JSON text.
/// </summary>
public StringEscapeHandling StringEscapeHandling
{
get { return _stringEscapeHandling ?? DefaultStringEscapeHandling; }
set { _stringEscapeHandling = value; }
}
/// <summary>
/// Gets or sets the culture used when reading JSON. Defaults to <see cref="CultureInfo.InvariantCulture"/>.
/// </summary>
public CultureInfo Culture
{
get { return _culture ?? DefaultCulture; }
set { _culture = value; }
}
/// <summary>
/// Gets a value indicating whether there will be a check for additional content after deserializing an object.
/// </summary>
/// <value>
/// <c>true</c> if there will be a check for additional content after deserializing an object; otherwise, <c>false</c>.
/// </value>
public bool CheckAdditionalContent
{
get { return _checkAdditionalContent ?? DefaultCheckAdditionalContent; }
set { _checkAdditionalContent = value; }
}
static JsonSerializerSettings()
{
DefaultContext = new StreamingContext();
DefaultCulture = CultureInfo.InvariantCulture;
}
/// <summary>
/// Initializes a new instance of the <see cref="JsonSerializerSettings"/> class.
/// </summary>
public JsonSerializerSettings()
{
Converters = new List<JsonConverter>();
}
}
} | 43.271233 | 146 | 0.651513 | [
"Apache-2.0"
] | yswenli/Wenli.Data.Es | Wenli.Data.Es/Base/Newtonsoft.Json/JsonSerializerSettings.cs | 15,796 | C# |
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
namespace MyBox.Internal
{
public class ToggleLockHotkey
{
[MenuItem("Tools/MyBox/Toggle Lock &q")]
static void ToggleInspectorLock()
{
if (_mouseOverWindow == null)
{
int i = EditorPrefs.GetInt("LockableInspectorIndex", 0);
Type type = Assembly.GetAssembly(typeof(Editor)).GetType("UnityEditor.InspectorWindow");
Object[] findObjectsOfTypeAll = Resources.FindObjectsOfTypeAll(type);
_mouseOverWindow = (EditorWindow) findObjectsOfTypeAll[i];
}
if (_mouseOverWindow != null && _mouseOverWindow.GetType().Name == "InspectorWindow")
{
Type type = Assembly.GetAssembly(typeof(Editor)).GetType("UnityEditor.InspectorWindow");
PropertyInfo propertyInfo = type.GetProperty("isLocked");
if (propertyInfo == null) return;
bool value = (bool) propertyInfo.GetValue(_mouseOverWindow, null);
propertyInfo.SetValue(_mouseOverWindow, !value, null);
_mouseOverWindow.Repaint();
}
}
private static EditorWindow _mouseOverWindow;
}
} | 30.694444 | 92 | 0.736652 | [
"MIT"
] | bilalemregrkn/MyBox | Tools/Features/ToggleLockHotkey.cs | 1,107 | C# |
// Copyright (c) Philipp Wagner. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using DGraphSample.Csv.Ncar.Model.Enums;
namespace DGraphSample.Csv.Ncar.Model
{
/// <summary>
public class MetarStation
{
/// <summary>
/// 2 letter state (province) abbreviation
/// </summary>
public string CD { get; set; }
/// <summary>
/// 16 character station long name
/// </summary>
public string Station { get; set; }
/// <summary>
/// 4-character international id
/// </summary>
public string ICAO { get; set; }
/// <summary>
/// 3-character(FAA) id
/// </summary>
public string IATA { get; set; }
/// <summary>
/// 5-digit international synoptic number
/// </summary>
public string SYNOP { get; set; }
/// <summary>
/// Latitude(degrees minutes)
/// </summary>
public string Latitude { get; set; }
/// <summary>
/// Longitude(degree minutes)
/// </summary>
public string Longitude { get; set; }
/// <summary>
/// Station elevation(meters)
/// </summary>
public float? Elevation { get; set; }
/// <summary>
/// METAR reporting station.
/// </summary>
public MetarFlagEnum M { get; set; }
/// <summary>
/// NEXRAD (WSR-88D) Radar site
/// </summary>
public NexradFlagEnum N { get; set; }
/// <summary>
/// Aviation-specific flag
/// </summary>
public AviationFlagEnum V { get; set; }
/// <summary>
/// Upper air
/// </summary>
public UpperAirFlagEnum U { get; set; }
/// <summary>
/// Auto
/// </summary>
public AutoFlagEnum A { get; set; }
/// <summary>
/// Office type
/// </summary>
public OfficeTypeFlagEnum C { get; set; }
}
}
| 25.036145 | 101 | 0.506737 | [
"MIT"
] | bytefish/DGraphSample | DGraphSample/DGraphSample.Csv.Ncar/Model/MetarStation.cs | 2,078 | C# |
using System.IO;
namespace TeleSharp.TL
{
[TLObject(-971322408)]
public class TLWebDocument : TLObject
{
public override int Constructor
{
get
{
return -971322408;
}
}
public string Url { get; set; }
public long AccessHash { get; set; }
public int Size { get; set; }
public string MimeType { get; set; }
public TLVector<TLAbsDocumentAttribute> Attributes { get; set; }
public int DcId { get; set; }
public void ComputeFlags()
{
}
public override void DeserializeBody(BinaryReader br)
{
Url = StringUtil.Deserialize(br);
AccessHash = br.ReadInt64();
Size = br.ReadInt32();
MimeType = StringUtil.Deserialize(br);
Attributes = ObjectUtils.DeserializeVector<TLAbsDocumentAttribute>(br);
DcId = br.ReadInt32();
}
public override void SerializeBody(BinaryWriter bw)
{
bw.Write(Constructor);
StringUtil.Serialize(Url, bw);
bw.Write(AccessHash);
bw.Write(Size);
StringUtil.Serialize(MimeType, bw);
ObjectUtils.SerializeObject(Attributes, bw);
bw.Write(DcId);
}
}
}
| 25.634615 | 83 | 0.542386 | [
"MIT"
] | cobra91/TelegramCSharpForward | TeleSharp.TL/TL/TLWebDocument.cs | 1,333 | C# |
#region License & Metadata
// The MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
//
// Modified On: 2020/01/26 22:31
// Modified By: Alexis
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using SuperMemoAssistant.Sys.Security.Cryptography;
// ReSharper disable LocalizableElement
namespace SuperMemoAssistant.Extensions
{
public static class StringEx
{
#region Methods
public static string GetCrc32(this string content)
{
Crc32 crc32 = new Crc32();
string hash = string.Empty;
using (MemoryStream ms = new MemoryStream(Encoding.Default.GetBytes(content)))
foreach (byte b in crc32.ComputeHash(ms)) hash += b.ToString("x2").ToLower();
return hash;
}
public static string[] SplitLines(this string str, StringSplitOptions options = StringSplitOptions.None)
{
return str.Split(new[] { "\r\n", "\n", "\r" }, options);
}
public static string TrimStart(this string str, params string[] starts)
{
var start = starts.FirstOrDefault(str.StartsWith);
return start != null
? start == str ? string.Empty : str.Substring(start.Length)
: str;
}
public static string TrimEnd(this string str, params string[] ends)
{
var end = ends.FirstOrDefault(str.EndsWith);
return end != null
? end == str ? string.Empty : str.Substring(0, str.Length - end.Length)
: str;
}
public static string Truncate(this string text, int maxLength)
{
if (string.IsNullOrEmpty(text))
return text;
return text.Length <= maxLength ? text : text.Substring(0, maxLength);
}
public static string Quotify(this string text, bool escapeQuotes = false)
{
if (escapeQuotes)
text = text.Replace("\"", "\\\"");
return $"\"{text}\"";
}
public static string Ellipsis(this string text, int length)
{
if (text.Length <= length)
return text;
int pos = text.IndexOf(" ", length, StringComparison.Ordinal);
return pos >= 0 ? text.Substring(0, pos) + "..." : text;
}
public static string ReplaceFirst(this string text,
string search,
string replace)
{
int pos = text.IndexOf(search,
StringComparison.Ordinal);
return pos < 0
? text
: text.Substring(0,
pos) + replace + text.Substring(pos + search.Length);
}
public static string ReplaceNth(this string text,
string search,
string replace,
int nth)
{
int pos = text.NthIdexOf(search,
nth);
return pos < 0
? text
: text.Substring(0,
pos) + replace + text.Substring(pos + search.Length);
}
public static int NthIdexOf(this string text,
string search,
int nth)
{
int pos = -1;
while (nth > 0 && (pos = text.IndexOf(search,
pos + 1,
StringComparison.Ordinal)) >= 0)
nth--;
return pos;
}
public static string ToBase64(this string plainText)
{
var plainTextBytes = Encoding.UTF8.GetBytes(plainText);
return Convert.ToBase64String(plainTextBytes);
}
public static string FromBase64(this string base64EncodedData)
{
var base64EncodedBytes = Convert.FromBase64String(base64EncodedData);
return Encoding.UTF8.GetString(base64EncodedBytes);
}
public static string CapitalizeFirst(this string str)
{
switch (str)
{
case null: throw new ArgumentNullException(nameof(str));
case "": throw new ArgumentException($"{nameof(str)} cannot be empty", nameof(str));
default: return str.First().ToString().ToUpper() + str.Substring(1);
}
}
public static string Join<T>(string separator, IEnumerable<T> values, string defaultRet = null)
{
// ReSharper disable PossibleMultipleEnumeration
if (values == null || values.Any() == false)
return defaultRet;
separator ??= string.Empty;
return string.Join(separator, values);
// ReSharper restore PossibleMultipleEnumeration
}
public static string HtmlEncode(this string text)
{
// call the normal HtmlEncode first
char[] chars = WebUtility.HtmlEncode(text).ToCharArray();
StringBuilder encodedText = new StringBuilder();
foreach (char c in chars)
if (c > 127) // above normal ASCII
encodedText.Append("&#" + (int)c + ";");
else
encodedText.Append(c);
return encodedText.Replace("", "-\r\n")
.ToString();
}
public static string UrlEncode(this string text)
{
return WebUtility.UrlDecode(text);
}
public static string Before(this string str, string separator)
{
var idx = str.IndexOf(separator, StringComparison.Ordinal);
return idx >= 0
? (idx == 0 ? string.Empty : str.Substring(0, idx))
: null;
}
public static string After(this string str, string separator)
{
var idx = str.IndexOf(separator, StringComparison.Ordinal);
return idx >= 0
? str.Substring(idx + separator.Length)
: null;
}
#endregion
}
}
| 29.709251 | 108 | 0.604093 | [
"MIT"
] | KeepOnSurviving/SuperMemoAssistant | src/Core/SuperMemoAssistant.Interop/Extensions/StringEx.cs | 6,746 | C# |
using Altering.UI.Models;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
namespace Altering.UI.Services
{
public class AlteringService
{
private HttpClient _httpClient = new HttpClient();
private readonly string _alteringServiceUrl;
private readonly IConfiguration _configuration;
public AlteringService(IConfiguration configuration)
{
_configuration = configuration;
_alteringServiceUrl = _configuration["AlteringUrl"];
}
public async Task<List<AlterationViewModel>> List()
{
var uri = _alteringServiceUrl;
var responseString = await _httpClient.GetAsync(uri);
var result = await responseString.Content.ReadAsStringAsync();
var response = JsonConvert.DeserializeObject<IEnumerable<AlterationViewModel>>(result);
return response.ToList();
}
public async Task<AlterationViewModel> Get(Guid id)
{
var uri = $"{_alteringServiceUrl}/{id}";
var responseString = await _httpClient.GetAsync(uri);
var result = await responseString.Content.ReadAsStringAsync();
var response = JsonConvert.DeserializeObject<AlterationViewModel>(result);
return response;
}
async public Task Create(AlterationViewModel alteration)
{
var uri = $"{_alteringServiceUrl}";
var alterationContent = new StringContent(JsonConvert.SerializeObject(alteration), System.Text.Encoding.UTF8, "application/json");
var response = await _httpClient.PostAsync(uri, alterationContent);
response.EnsureSuccessStatusCode();
}
public async Task MarkAsFinished(AlterationViewModel alteration)
{
var uri = $"{_alteringServiceUrl}/{alteration.Id}";
var alterationContent = new StringContent(JsonConvert.SerializeObject(alteration), System.Text.Encoding.UTF8, "application/json");
var response = await _httpClient.PutAsync(uri, alterationContent);
response.EnsureSuccessStatusCode();
}
}
}
| 33.231884 | 142 | 0.668993 | [
"MIT"
] | LeandroArruda/custom-made | src/frontend/altering/Altering.UI/Services/AlteringService.cs | 2,295 | C# |
using Opdex.Platform.Common.Models;
namespace Opdex.Platform.WebApi.Models.Responses.LiquidityPools;
public class AddLiquidityAmountInQuoteResponseModel
{
/// <summary>
/// The quoted amount of tokens to provide to match the requested amount.
/// </summary>
/// <example>"2500.00000000"</example>
public FixedDecimal AmountIn { get; set; }
} | 30.25 | 77 | 0.730028 | [
"MIT"
] | Opdex/opdex-v1-api | src/Opdex.Platform.WebApi/Models/Responses/LiquidityPools/AddLiquidityAmountInQuoteResponseModel.cs | 363 | C# |
namespace DungeonsAndCodeWizards.Bags
{
public class Backpack : Bag
{
const int CAPACITY = 100;
public Backpack()
: base(CAPACITY) { }
}
}
| 16.454545 | 38 | 0.563536 | [
"MIT"
] | sevgin0954/SoftUni-Projects | C# OOP Basics/OOP Basics Exam - 18 March 2018/DungeonsAndCodeWizards/Models/Bags/Backpack.cs | 183 | C# |
using System;
using System.Windows;
using System.Windows.Data;
namespace VBeller.Wpf.Converter
{
/// <summary>
/// Provides conversion from <see cref="Enum"/> to <see cref="bool"/>, if the value equals the expected value.
/// </summary>
[ValueConversion(typeof(Enum), typeof(bool))]
public class EnumToBooleanConverter : IValueConverter
{
/// <summary>
/// Converts a <see cref="Enum"/> value to <see cref="bool"/> by comparing the value to the expected one passed as <see cref="parameter"/>.
/// </summary>
/// <param name="value">The <see cref="Enum"/> value to compare to the expected one.</param>
/// <param name="targetType">Ignored.</param>
/// <param name="parameter">The expted <see cref="Enum"/> value.</param>
/// <param name="culture">Ignored.</param>
/// <returns>True, if <see cref="value"/> equals <see cref="parameter"/>, otherwise false.
/// <see cref="DependencyProperty.UnsetValue"/> if parameters are missing.</returns>
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
var parameterString = parameter as string;
if (parameterString == null)
return DependencyProperty.UnsetValue;
if (value == null || !Enum.IsDefined(value.GetType(), value))
return DependencyProperty.UnsetValue;
var parameterValue = Enum.Parse(value.GetType(), parameterString);
return parameterValue.Equals(value);
}
/// <summary>
/// Converts the <see cref="parameter"/> to the corresponding <see cref="targetType"/> enum value.
/// </summary>
/// <param name="value">Ignored.</param>
/// <param name="targetType">The target <see cref="Enum"/> type.</param>
/// <param name="parameter">The string representaton of the <see cref="Enum"/> value.</param>
/// <param name="culture">Ignored.</param>
/// <returns>The <see cref="targetType"/> enum value.</returns>
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
var parameterString = parameter as string;
return parameterString == null ? DependencyProperty.UnsetValue : Enum.Parse(targetType, parameterString);
}
}
} | 48.4 | 147 | 0.629339 | [
"Apache-2.0"
] | halliba/VBeller.net | src/VBeller.Wpf/Converter/EnumToBooleanConverter.cs | 2,422 | C# |
using System;
using System.Net;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Orleans.Runtime;
using Orleans.GrainReferences;
using Orleans.Serialization.TypeSystem;
namespace Orleans.Serialization
{
/// <summary>
/// Utility class for configuring <see cref="JsonSerializerSettings"/> to support Orleans types.
/// </summary>
public class OrleansJsonSerializer
{
public const string UseFullAssemblyNamesProperty = "UseFullAssemblyNames";
public const string IndentJsonProperty = "IndentJSON";
public const string TypeNameHandlingProperty = "TypeNameHandling";
private readonly Lazy<JsonSerializerSettings> settings;
/// <summary>
/// Initializes a new instance of the <see cref="OrleansJsonSerializer"/> class.
/// </summary>
/// <param name="services">The service provider.</param>
public OrleansJsonSerializer(IServiceProvider services)
{
this.settings = new Lazy<JsonSerializerSettings>(() =>
{
return GetDefaultSerializerSettings(services);
});
}
/// <summary>
/// Returns the default serializer settings.
/// </summary>
/// <param name="services">
/// The service provider.
/// </param>
/// <returns>The default serializer settings.</returns>
public static JsonSerializerSettings GetDefaultSerializerSettings(IServiceProvider services)
{
var typeResolver = services.GetRequiredService<TypeResolver>();
var serializationBinder = new OrleansJsonSerializationBinder(typeResolver);
var settings = new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.All,
PreserveReferencesHandling = PreserveReferencesHandling.Objects,
DateFormatHandling = DateFormatHandling.IsoDateFormat,
DefaultValueHandling = DefaultValueHandling.Ignore,
MissingMemberHandling = MissingMemberHandling.Ignore,
NullValueHandling = NullValueHandling.Ignore,
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple,
Formatting = Formatting.None,
SerializationBinder = serializationBinder
};
settings.Converters.Add(new IPAddressConverter());
settings.Converters.Add(new IPEndPointConverter());
settings.Converters.Add(new GrainIdConverter());
settings.Converters.Add(new SiloAddressConverter());
settings.Converters.Add(new UniqueKeyConverter());
settings.Converters.Add(new GrainReferenceJsonConverter(services.GetRequiredService<GrainReferenceActivator>()));
return settings;
}
/// <summary>
/// Updates the provided serializer settings with the specified options.
/// </summary>
/// <param name="settings">The settings.</param>
/// <param name="useFullAssemblyNames">if set to <c>true</c>, use full assembly-qualified names when formatting type names.</param>
/// <param name="indentJson">if set to <c>true</c>, indent the formatted JSON.</param>
/// <param name="typeNameHandling">The type name handling options.</param>
/// <returns>The provided serializer settings.</returns>
public static JsonSerializerSettings UpdateSerializerSettings(JsonSerializerSettings settings, bool useFullAssemblyNames, bool indentJson, TypeNameHandling? typeNameHandling)
{
if (useFullAssemblyNames)
{
settings.TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Full;
}
if (indentJson)
{
settings.Formatting = Formatting.Indented;
}
if (typeNameHandling.HasValue)
{
settings.TypeNameHandling = typeNameHandling.Value;
}
return settings;
}
/// <summary>
/// Deserializes an object of the specified expected type from the provided input.
/// </summary>
/// <param name="expectedType">The expected type.</param>
/// <param name="input">The input.</param>
/// <returns>The deserialized object.</returns>
public object Deserialize(Type expectedType, string input)
{
if (string.IsNullOrWhiteSpace(input))
{
return null;
}
return JsonConvert.DeserializeObject(input, expectedType, this.settings.Value);
}
/// <summary>
/// Serializes an object to a JSON string.
/// </summary>
/// <param name="item">The object to serialize.</param>
/// <param name="expectedType">The type the deserializer should expect.</param>
public string Serialize(object item, Type expectedType) => JsonConvert.SerializeObject(item, expectedType, this.settings.Value);
}
/// <summary>
/// <see cref="Newtonsoft.Json.JsonConverter" /> implementation for <see cref="IPAddress"/>.
/// </summary>
/// <seealso cref="Newtonsoft.Json.JsonConverter" />
public class IPAddressConverter : JsonConverter
{
/// <inheritdoc/>
public override bool CanConvert(Type objectType)
{
return (objectType == typeof(IPAddress));
}
/// <inheritdoc/>
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
IPAddress ip = (IPAddress)value;
writer.WriteValue(ip.ToString());
}
/// <inheritdoc/>
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
JToken token = JToken.Load(reader);
return IPAddress.Parse(token.Value<string>());
}
}
/// <summary>
/// <see cref="Newtonsoft.Json.JsonConverter" /> implementation for <see cref="GrainId"/>.
/// </summary>
/// <seealso cref="Newtonsoft.Json.JsonConverter" />
public class GrainIdConverter : JsonConverter
{
/// <inheritdoc/>
public override bool CanConvert(Type objectType)
{
return (objectType == typeof(GrainId));
}
/// <inheritdoc/>
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
GrainId id = (GrainId)value;
writer.WriteStartObject();
writer.WritePropertyName("Type");
writer.WriteValue(id.Type.ToStringUtf8());
writer.WritePropertyName("Key");
writer.WriteValue(id.Key.ToStringUtf8());
writer.WriteEndObject();
}
/// <inheritdoc/>
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
JObject jo = JObject.Load(reader);
GrainId grainId = GrainId.Create(jo["Type"].ToObject<string>(), jo["Key"].ToObject<string>());
return grainId;
}
}
/// <summary>
/// <see cref="Newtonsoft.Json.JsonConverter" /> implementation for <see cref="SiloAddress"/>.
/// </summary>
/// <seealso cref="Newtonsoft.Json.JsonConverter" />
public class SiloAddressConverter : JsonConverter
{
/// <inheritdoc/>
public override bool CanConvert(Type objectType)
{
return (objectType == typeof(SiloAddress));
}
/// <inheritdoc/>
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
SiloAddress addr = (SiloAddress)value;
writer.WriteStartObject();
writer.WritePropertyName("SiloAddress");
writer.WriteValue(addr.ToParsableString());
writer.WriteEndObject();
}
/// <inheritdoc/>
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
JObject jo = JObject.Load(reader);
SiloAddress addr = SiloAddress.FromParsableString(jo["SiloAddress"].ToObject<string>());
return addr;
}
}
/// <summary>
/// <see cref="Newtonsoft.Json.JsonConverter" /> implementation for <see cref="UniqueKey"/>.
/// </summary>
/// <seealso cref="Newtonsoft.Json.JsonConverter" />
public class UniqueKeyConverter : JsonConverter
{
/// <inheritdoc/>
public override bool CanConvert(Type objectType)
{
return (objectType == typeof(UniqueKey));
}
/// <inheritdoc/>
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
UniqueKey key = (UniqueKey)value;
writer.WriteStartObject();
writer.WritePropertyName("UniqueKey");
writer.WriteValue(key.ToHexString());
writer.WriteEndObject();
}
/// <inheritdoc/>
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
JObject jo = JObject.Load(reader);
UniqueKey addr = UniqueKey.Parse(jo["UniqueKey"].ToObject<string>().AsSpan());
return addr;
}
}
/// <summary>
/// <see cref="Newtonsoft.Json.JsonConverter" /> implementation for <see cref="IPEndPoint"/>.
/// </summary>
/// <seealso cref="Newtonsoft.Json.JsonConverter" />
public class IPEndPointConverter : JsonConverter
{
/// <inheritdoc/>
public override bool CanConvert(Type objectType)
{
return (objectType == typeof(IPEndPoint));
}
/// <inheritdoc/>
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
IPEndPoint ep = (IPEndPoint)value;
writer.WriteStartObject();
writer.WritePropertyName("Address");
serializer.Serialize(writer, ep.Address);
writer.WritePropertyName("Port");
writer.WriteValue(ep.Port);
writer.WriteEndObject();
}
/// <inheritdoc/>
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
JObject jo = JObject.Load(reader);
IPAddress address = jo["Address"].ToObject<IPAddress>(serializer);
int port = jo["Port"].Value<int>();
return new IPEndPoint(address, port);
}
}
/// <summary>
/// <see cref="Newtonsoft.Json.JsonConverter" /> implementation for <see cref="GrainReference"/>.
/// </summary>
/// <seealso cref="Newtonsoft.Json.JsonConverter" />
public class GrainReferenceJsonConverter : JsonConverter
{
private static readonly Type AddressableType = typeof(IAddressable);
private readonly GrainReferenceActivator referenceActivator;
/// <summary>
/// Initializes a new instance of the <see cref="GrainReferenceJsonConverter"/> class.
/// </summary>
/// <param name="referenceActivator">The grain reference activator.</param>
public GrainReferenceJsonConverter(GrainReferenceActivator referenceActivator)
{
this.referenceActivator = referenceActivator;
}
/// <inheritdoc/>
public override bool CanConvert(Type objectType)
{
return AddressableType.IsAssignableFrom(objectType);
}
/// <inheritdoc/>
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
var val = (GrainReference)value;
writer.WriteStartObject();
writer.WritePropertyName("Id");
writer.WriteStartObject();
writer.WritePropertyName("Type");
writer.WriteValue(val.GrainId.Type.ToStringUtf8());
writer.WritePropertyName("Key");
writer.WriteValue(val.GrainId.Key.ToStringUtf8());
writer.WriteEndObject();
writer.WritePropertyName("Interface");
writer.WriteValue(val.InterfaceType.ToStringUtf8());
writer.WriteEndObject();
}
/// <inheritdoc/>
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
JObject jo = JObject.Load(reader);
var id = jo["Id"];
GrainId grainId = GrainId.Create(id["Type"].ToObject<string>(), id["Key"].ToObject<string>());
var iface = GrainInterfaceType.Create(jo["Interface"].ToString());
return this.referenceActivator.CreateReference(grainId, iface);
}
}
}
| 39.735562 | 182 | 0.620898 | [
"MIT"
] | BearerPipelineTest/orleans | src/Orleans.Core/Serialization/OrleansJsonSerializer.cs | 13,073 | C# |
using CG.Properties;
using System;
using System.ComponentModel.DataAnnotations;
using System.Data.Common;
namespace CG.Business.Repositories.Options
{
/// <summary>
/// This class represents configuration options for a LINQ based
/// repository.
/// </summary>
public class LinqRepositoryOptions : RepositoryOptions
{
// *******************************************************************
// Properties.
// *******************************************************************
#region Properties
/// <summary>
/// This property contains the connection string for the LINQ connection.
/// </summary>
[Required(ErrorMessageResourceName = "LinqRepositoryOptions_CS",
ErrorMessageResourceType = typeof(Resources))]
public string ConnectionString { get; set; }
/// <summary>
/// This property contains the name of the associated database, as parsed
/// from the <see cref="ConnectionString"/> property.
/// </summary>
public string DatabaseName
{
get
{
var parser = new DbConnectionStringBuilder();
parser.ConnectionString = ConnectionString;
if (false == parser.TryGetValue("database", out var databaseName))
{
databaseName = "unknown";
}
return $"{databaseName}";
}
}
/// <summary>
/// This property contains the name of the associated server, as parsed
/// from the <see cref="ConnectionString"/> property.
/// </summary>
public string ServerName
{
get
{
var parser = new DbConnectionStringBuilder();
parser.ConnectionString = ConnectionString;
if (false == parser.TryGetValue("server", out var serverName))
{
serverName = "unknown";
}
return $"{serverName}";
}
}
/// <summary>
/// This property indicated whether the LINQ connection is trusted, as parsed
/// from the <see cref="ConnectionString"/> property.
/// </summary>
public bool TrustedConnection
{
get
{
var parser = new DbConnectionStringBuilder();
parser.ConnectionString = ConnectionString;
if (false == parser.TryGetValue("trustedconnection", out var flag))
{
flag = "False";
}
if (false == bool.TryParse($"{flag}", out var value))
{
value = false;
}
return value;
}
}
/// <summary>
/// This property indicated whether the LINQ connection supports multiple active
/// result sets, as parsed from the <see cref="ConnectionString"/> property.
/// </summary>
public bool MultipleActiveResultSets
{
get
{
var parser = new DbConnectionStringBuilder();
parser.ConnectionString = ConnectionString;
if (false == parser.TryGetValue("multipleactiveresultsets", out var flag))
{
flag = "False";
}
if (false == bool.TryParse($"{flag}", out var value))
{
value = false;
}
return value;
}
}
#endregion
}
}
| 32.504425 | 90 | 0.484617 | [
"MIT"
] | CodeGator/CG.Linq | src/CG.Linq/Business/Repositories/Options/LinqRepositoryOptions.cs | 3,675 | C# |
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using BlazorShared.Authorization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
namespace Microsoft.eShopWeb.Web.Controllers;
[Route("[controller]")]
[ApiController]
public class UserController : ControllerBase
{
private readonly ITokenClaimsService _tokenClaimsService;
public UserController(ITokenClaimsService tokenClaimsService)
{
_tokenClaimsService = tokenClaimsService;
}
[HttpGet]
[Authorize]
[AllowAnonymous]
public async Task<IActionResult> GetCurrentUser() =>
Ok(User.Identity.IsAuthenticated ? await CreateUserInfo(User) : UserInfo.Anonymous);
private async Task<UserInfo> CreateUserInfo(ClaimsPrincipal claimsPrincipal)
{
if (!claimsPrincipal.Identity.IsAuthenticated)
{
return UserInfo.Anonymous;
}
var userInfo = new UserInfo
{
IsAuthenticated = true
};
if (claimsPrincipal.Identity is ClaimsIdentity claimsIdentity)
{
userInfo.NameClaimType = claimsIdentity.NameClaimType;
userInfo.RoleClaimType = claimsIdentity.RoleClaimType;
}
else
{
userInfo.NameClaimType = "name";
userInfo.RoleClaimType = "role";
}
if (claimsPrincipal.Claims.Any())
{
var claims = new List<ClaimValue>();
var nameClaims = claimsPrincipal.FindAll(userInfo.NameClaimType);
foreach (var claim in nameClaims)
{
claims.Add(new ClaimValue(userInfo.NameClaimType, claim.Value));
}
foreach (var claim in claimsPrincipal.Claims.Except(nameClaims))
{
claims.Add(new ClaimValue(claim.Type, claim.Value));
}
userInfo.Claims = claims;
}
var token = await _tokenClaimsService.GetTokenAsync(claimsPrincipal.Identity.Name);
userInfo.Token = token;
return userInfo;
}
}
| 28.866667 | 92 | 0.653118 | [
"MIT"
] | 10088/eShopOnWeb | src/Web/Controllers/UserController.cs | 2,167 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace DawidKobierskiLab5
{
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
}
}
| 21.684211 | 60 | 0.694175 | [
"Unlicense"
] | baatochan/KredekCSharpProgrammingCourse | Lab6/DawidKobierskiLab5/Global.asax.cs | 414 | C# |
using Carfamsoft.ModelToView.Shared;
namespace Carfamsoft.ModelToView.WebPages
{
/// <summary>
/// Specifies the contract required to render an instance of the <see cref="ControlInfo"/> class.
/// </summary>
[System.Obsolete]
public interface IControlRenderer
{
/// <summary>
/// Gets or sets the options for rendering an object as a collection of HTML controls.
/// </summary>
ControlRenderOptions RenderOptions { get; set; }
/// <summary>
/// Renders the specified control info.
/// </summary>
/// <param name="info">The control info to render.</param>
/// <returns></returns>
string Render(ControlInfo info);
}
} | 31.565217 | 101 | 0.61708 | [
"Apache-2.0"
] | bigabdoul/ModelToView | src/Carfamsoft.ModelToView/WebPages/IControlRenderer.cs | 728 | C# |
#pragma warning disable IDE0073
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage( "Style", "IDE1006:Naming Styles" )]
| 35 | 66 | 0.776623 | [
"Apache-2.0"
] | seaseducation/Shipwright.Core | Core/test/GlobalSuppressions.cs | 387 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class QuantumJump : MonoBehaviour
{
[Tooltip("Model to apply warp FX to")]
[SerializeField] Transform scalableObject;
[SerializeField] GameObject quantumParticleControllerObject;
Vector3 originalScale;
// Start is called before the first frame update
void Start()
{
originalScale = scalableObject.localScale;
}
public void BeginJumpSequence(Vector3 _t)
{
StopCoroutine("InitiateQuantumJump");
StartCoroutine("InitiateQuantumJump", _t);
}
public void BeginTurnSequence(Vector3 _t)
{
//Do nothing
}
IEnumerator InitiateQuantumJump(Vector3 target)
{
GameObject QPC = Instantiate(quantumParticleControllerObject, transform.position, Quaternion.identity) as GameObject;
QPC.name = "Departure";
QuantumParticleController controller = QPC.GetComponent<QuantumParticleController>();
//Start: Rotation, no grav
controller.Emit(10);
controller.SetEmission(5);
controller.SetForceRotation(15, 1);
controller.SetForceGravity(0);
controller.SetForceDrag(0);
yield return new WaitForSeconds(2);
//Grow:
controller.SetForceGravity(-.1f);
controller.SetForceDrag(1);
controller.SetForceRotation(0, 1);
int timeInFrames = 25;
float growTime = 0.25f;
for (int i = 0; i < timeInFrames; i++)
{
float c = (1 / (float)timeInFrames) * (float)i;
float factor = 1.2f;
float x = Mathf.SmoothStep(originalScale.x, originalScale.x * factor, c);
float y = Mathf.SmoothStep(originalScale.y, originalScale.y * factor, c);
float z = Mathf.SmoothStep(originalScale.z, originalScale.z * factor, c);
scalableObject.localScale = new Vector3(x, y, z);
yield return new WaitForSeconds( growTime / (float)timeInFrames); //Wait for a little bit, making this a function of time not frames.
}
//Shrink:
controller.SetEmission(0);
controller.SetForceGravity(10);
timeInFrames = 25;
float shrinkTime = 0.3f;
for (int i = 0; i < timeInFrames; i++)
{
float c = (1 / (float)timeInFrames) * (float)i;
float x = Mathf.SmoothStep(originalScale.x, 0, c);
float y = Mathf.SmoothStep(originalScale.y, 0, c);
float z = Mathf.SmoothStep(originalScale.z, 0, c);
scalableObject.localScale = new Vector3(x, y, z);
yield return new WaitForSeconds(shrinkTime / (float)timeInFrames);
}
yield return new WaitForSeconds(1);
transform.position = target;
//Create landing QPC
QPC = Instantiate(quantumParticleControllerObject, transform.position, Quaternion.identity) as GameObject;
QPC.name = "Arrival";
controller = null;
controller = QPC.GetComponent<QuantumParticleController>();
//controller.SetEmissionSphere(1f);
controller.Emit(10);
controller.SetEmission(5);
controller.SetForceGravity(10);
controller.SetForceRotation(0, 1);
controller.SetForceDrag(1);
yield return new WaitForSeconds(1f);
controller.SetForceGravity(-1);
controller.Emit(10);
yield return new WaitForSeconds(.2f);
//Arrive Grow
timeInFrames = 10;
float arriveTime = 0.1f;
for (int i = 0; i < timeInFrames; i++)
{
float c = (1 / (float)timeInFrames) * (float)i;
float factor = 1.1f;
float x = Mathf.SmoothStep(0, originalScale.x * factor, c);
float y = Mathf.SmoothStep(0, originalScale.y * factor, c);
float z = Mathf.SmoothStep(0, originalScale.z * factor, c);
scalableObject.localScale = new Vector3(x, y, z);
yield return new WaitForSeconds(arriveTime / (float)timeInFrames);
}
controller.SetForceGravity(0);
controller.SetForceRotation(15, .1f);
controller.SetForceDrag(0);
//Arrive Settle
timeInFrames = 10;
float settleTime = 0.1f;
for (int i = 0; i < timeInFrames; i++)
{
float c = (1 / (float)timeInFrames) * (float)i;
float factor = 1.1f;
float x = Mathf.SmoothStep(originalScale.x * factor, originalScale.x, c);
float y = Mathf.SmoothStep(originalScale.y * factor, originalScale.y, c);
float z = Mathf.SmoothStep(originalScale.z * factor, originalScale.z, c);
scalableObject.localScale = new Vector3(x, y, z);
yield return new WaitForSeconds(settleTime / (float)timeInFrames);
}
scalableObject.localScale = originalScale;
controller.SetEmission(0);
yield return null;
}
}
| 31.541401 | 152 | 0.614499 | [
"MIT"
] | jameshosken/100-Plays-Of-Spaceships | Unity/100 Plays Of Spaceships/Assets/Scripts/QuantumJump.cs | 4,954 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading;
using DxLibDLL;
using Charlotte.Commons;
using Charlotte.Games;
namespace Charlotte.GameCommons
{
public static class DDEngine
{
public static long FrameStartTime;
public static long HzChaserTime;
public static int SlowdownLevel;
public static int FrameProcessingMillis;
public static int FrameProcessingMillis_Worst;
public static int FrameProcessingMillis_WorstFrame;
public static int ProcFrame;
public static int FreezeInputFrame;
public static bool WindowIsActive;
private static void CheckHz()
{
long currTime = DDUtils.GetCurrTime();
if (1 <= SlowdownLevel)
HzChaserTime += (long)(16.666 * SlowdownLevel); // テスト用
else
HzChaserTime += 16L; // 16.666 == 60Hz
HzChaserTime = SCommon.ToRange(HzChaserTime, currTime - 100L, currTime + 100L);
while (currTime < HzChaserTime)
{
Thread.Sleep(1);
currTime = DDUtils.GetCurrTime();
}
FrameStartTime = currTime;
}
public static Action DispDebug = () => { };
public static void EachFrame()
{
//Ground.EL.ExecuteAllTask();
DDGround.EL.ExecuteAllTask();
DDGround.SystemTasks.ExecuteAllTask();
DispDebug();
DDMouse.PosChanged_Delay();
DDCurtain.EachFrame();
if (!DDSEUtils.EachFrame())
{
DDMusicUtils.EachFrame();
}
// アプリ固有 >
波紋効果.EachFrame();
// < アプリ固有
DDSubScreenUtils.ChangeDrawScreen(DX.DX_SCREEN_BACK);
if (DDGround.RealScreenDraw_W == -1)
{
bool mosaicFlag =
DDConfig.DrawScreen_MosaicFlag &&
DDGround.RealScreen_W % DDConsts.Screen_W == 0 &&
DDGround.RealScreen_H % DDConsts.Screen_H == 0;
if (mosaicFlag)
DX.SetDrawMode(DX.DX_DRAWMODE_NEAREST);
if (DX.DrawExtendGraph(0, 0, DDGround.RealScreen_W, DDGround.RealScreen_H, DDGround.MainScreen.GetHandle(), 0) != 0) // ? 失敗
throw new DDError();
if (mosaicFlag)
DX.SetDrawMode(DDConsts.DEFAULT_DX_DRAWMODE); // restore
}
else
{
if (DX.DrawBox(0, 0, DDGround.RealScreen_W, DDGround.RealScreen_H, DX.GetColor(0, 0, 0), 1) != 0) // ? 失敗
throw new DDError();
bool mosaicFlag =
DDConfig.DrawScreen_MosaicFlag &&
DDGround.RealScreenDraw_W % DDConsts.Screen_W == 0 &&
DDGround.RealScreenDraw_H % DDConsts.Screen_H == 0;
if (mosaicFlag)
DX.SetDrawMode(DX.DX_DRAWMODE_NEAREST);
if (DX.DrawExtendGraph(
DDGround.RealScreenDraw_L,
DDGround.RealScreenDraw_T,
DDGround.RealScreenDraw_L + DDGround.RealScreenDraw_W,
DDGround.RealScreenDraw_T + DDGround.RealScreenDraw_H, DDGround.MainScreen.GetHandle(), 0) != 0) // ? 失敗
throw new DDError();
if (mosaicFlag)
DX.SetDrawMode(DDConsts.DEFAULT_DX_DRAWMODE); // restore
}
GC.Collect(0);
FrameProcessingMillis = (int)(DDUtils.GetCurrTime() - FrameStartTime);
if (FrameProcessingMillis_Worst < FrameProcessingMillis || !DDUtils.CountDown(ref FrameProcessingMillis_WorstFrame))
{
FrameProcessingMillis_Worst = FrameProcessingMillis;
FrameProcessingMillis_WorstFrame = 120;
}
// DxLib >
DX.ScreenFlip();
if (DX.CheckHitKey(DX.KEY_INPUT_ESCAPE) == 1 || DX.ProcessMessage() == -1)
{
throw new DDCoffeeBreak();
}
// < DxLib
CheckHz();
ProcFrame++;
DDUtils.CountDown(ref FreezeInputFrame);
WindowIsActive = DDUtils.IsWindowActive();
if (SCommon.IMAX < ProcFrame) // 192.9日程度でカンスト
{
ProcFrame = SCommon.IMAX; // 2bs
throw new DDError();
}
DDPad.EachFrame();
DDKey.EachFrame();
DDInput.EachFrame();
DDMouse.EachFrame();
// Swap MainScreen
{
DDSubScreen tmp = DDGround.MainScreen;
DDGround.MainScreen = DDGround.LastMainScreen;
DDGround.LastMainScreen = tmp;
}
DDGround.MainScreen.ChangeDrawScreen();
// ? ALT + ENTER -> フルスクリーン切り替え
if ((1 <= DDKey.GetInput(DX.KEY_INPUT_LALT) || 1 <= DDKey.GetInput(DX.KEY_INPUT_RALT)) && DDKey.GetInput(DX.KEY_INPUT_RETURN) == 1)
{
// ? 現在フルスクリーン -> フルスクリーン解除
if (
DDGround.RealScreen_W == DDGround.MonitorRect.W &&
DDGround.RealScreen_H == DDGround.MonitorRect.H
)
{
DDMain.SetScreenSize(DDGround.UnfullScreen_W, DDGround.UnfullScreen_H);
}
else // ? 現在フルスクリーンではない -> フルスクリーンにする
{
DDGround.UnfullScreen_W = DDGround.RealScreen_W;
DDGround.UnfullScreen_H = DDGround.RealScreen_H;
DDMain.SetFullScreen();
}
DDEngine.FreezeInput(30); // エンターキー押下がゲームに影響しないように
}
DX.ClearDrawScreen();
}
public static void FreezeInput(int frame = 1) // frame: 1 == このフレームのみ, 2 == このフレームと次のフレーム ...
{
if (frame < 1 || SCommon.IMAX < frame)
throw new DDError("frame: " + frame);
FreezeInputFrame = Math.Max(FreezeInputFrame, frame); // frame より長いフレーム数が既に設定されていたら、そちらを優先する。
}
}
}
| 25.613757 | 134 | 0.687461 | [
"MIT"
] | soleil-taruto/Elsa2 | e20210244_Hakonoko/Elsa20200001/Elsa20200001/GameCommons/DDEngine.cs | 5,155 | C# |
using System;
using Microsoft.AspNetCore.Http;
namespace CodeCube.Mvc.AspNetCore
{
public sealed class HttpHelper
{
private readonly IHttpContextAccessor _httpContextAccessor;
public HttpHelper(IHttpContextAccessor httpContextAccessor)
{
_httpContextAccessor = httpContextAccessor;
}
/// <summary>
/// Retrieve the absolute URI.
/// </summary>
/// <returns>Absolute URL for the request in URI-format.</returns>
public Uri GetAbsoluteUri()
{
var request = _httpContextAccessor.HttpContext.Request;
UriBuilder uriBuilder = new UriBuilder
{
Scheme = request.Scheme,
Host = request.Host.Host,
Path = request.Path.ToString(),
Query = request.QueryString.ToString()
};
return uriBuilder.Uri;
}
}
}
| 27.441176 | 74 | 0.584137 | [
"MIT"
] | Rohem/CodeCube.MVC | CodeCube.MVC.AspNetCore/HttpHelper.cs | 935 | C# |
using System;
using System.IO;
using System.Windows.Forms;
using static StarportExcel.Structs;
namespace StarportExcel
{
public partial class PlanetTypeForm : Form
{
string excelPath = "";
string outputPath = @"G:\My Drive\Personal Stuff\Starport\Output.txt";
private StreamWriter output = new StreamWriter(@"G:\My Drive\Personal Stuff\Starport\Output.txt");
public PlanetTypeForm()
{
InitializeComponent();
}
private void PlanetTypeForm_FormClosing(object sender, FormClosingEventArgs e)
{
//output.Flush();
CloseOutput();
}
// Tool strip stuff from here down
private void OpenToolStripButton_Click(object sender, EventArgs e)
{
var openFileDialog1 = new OpenFileDialog
{
Filter = "Text Files|*.txt|All Files|*.*",
FilterIndex = 2,
Title = "Open the Excel Sheet"
};
openFileDialog1.ShowDialog();
//Check to see if a filename was given
if (openFileDialog1.FileName != "")
{
SetOutputPath(@openFileDialog1.FileName);
}
}
private void SaveToolStripButton_Click(object sender, EventArgs e)
{
var saveFileDialog1 = new SaveFileDialog
{
Filter = "Text Files|*.txt|All Files|*.*",
Title = "Save an Image File"
};
saveFileDialog1.ShowDialog();
if (saveFileDialog1.FileName != "")
{
File.WriteAllText(@saveFileDialog1.FileName, "");
}
}
private void HelpMeNiggaDamnToolStripButton_Click(object sender, EventArgs e)
{
MessageBox.Show("This box is for essentially displaying the data to a text file, I may make it display to the box in future iterations.", "Message");
}
private void CopyToolStripButton_Click(object sender, EventArgs e)
{
}
//buttons
private void ArcticsButton_Click(object sender, EventArgs e)
{
int.TryParse(numberTextBox.Text, out int temp);
//Console.WriteLine("Temp is : " + temp);
if (temp > 0)
{
int planetNumber = Int32.Parse(numberTextBox.Text);
Excel excel = OpenFileAt(2);
string planet = excel.ReadCellString(planetNumber, 2); //read row planet number column c
excel.Close();//dellocate
numberTextBox.Text = planet;
}
else if (ArcticZoundsCheckBox.Checked && ArcticsCheckBox.Checked) //both
{
Excel excel = OpenFileAt(2);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Arctics: ");
for (int i = 1; i <= planet; i++)
{
WriteAllPlanetInfo(i, excel);
}
output.Flush();
excel.Close();
MessageBox.Show("Arctics added to " + outputPath, "Completed");
}
else if (ArcticZoundsCheckBox.Checked && !ArcticsCheckBox.Checked) //Arctic Zounds only
{
Excel excel = OpenFileAt(2);
int planet = (int)excel.ReadCellDouble(2, 8); //amount of zounds
output.WriteLine("Arctic Zounds: ");
for (int i = 1; i <= planet; i++)
{
output.WriteLine(excel.ReadCellString(i, 5)); //column F
}
output.Flush();
excel.Close();
MessageBox.Show("Arctics Zounds added to " + outputPath, "Completed");
}
else if (!ArcticZoundsCheckBox.Checked && ArcticsCheckBox.Checked) //normies only
{
Excel excel = OpenFileAt(2);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Arctic Non-Zounds: ");
for (int i = 1; i <= planet; i++)
{
string box = excel.ReadCellString(i, 2);
for (int j = 0; j < box.Length; j++)//go through string
{
if (box[j].Equals('.'))
{
if (j + 5 < box.Length && !box[j + 5].Equals('Z'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
else if (j + 3 == box.Length-1 && !box[j-4].Equals('.'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
}
}
}
output.Flush();
excel.Close();
MessageBox.Show("Arctics without Zounds added to " + outputPath, "Completed");
}
else
{
MessageBox.Show("Nothing was selected");
}
}
private void DesertsButton_Click(object sender, EventArgs e)
{
int.TryParse(numberTextBox.Text, out int temp);
if (temp > 0)
{
int planetNumber = Int32.Parse(numberTextBox.Text);
Excel excel = OpenFileAt(3);
string planet = excel.ReadCellString(planetNumber, 2); //read row planet number column c
excel.Close();//dellocate
numberTextBox.Text = planet;
}
else if (DesertZoundsCheckBox.Checked && DesertsCheckBox.Checked) //both
{
Excel excel = OpenFileAt(3);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Deserts: ");
for (int i = 1; i <= planet; i++)
{
WriteAllPlanetInfo(i, excel);
}
output.Flush();
excel.Close();
MessageBox.Show("Deserts added to " + outputPath, "Completed");
}
else if (DesertZoundsCheckBox.Checked && !DesertsCheckBox.Checked) //Desert Zounds only
{
Excel excel = OpenFileAt(3);
int planet = (int)excel.ReadCellDouble(2, 8); //amount of zounds
output.WriteLine("Desert Zounds: ");
for (int i = 1; i <= planet; i++)
{
output.WriteLine(excel.ReadCellString(i, 5)); //column F
}
output.Flush();
excel.Close();
MessageBox.Show("Deserts Zounds added to " + outputPath, "Completed");
}
else if (!DesertZoundsCheckBox.Checked && DesertsCheckBox.Checked) //normies only
{
Excel excel = OpenFileAt(3);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Desert Non-Zounds: ");
for (int i = 1; i <= planet; i++)
{
string box = excel.ReadCellString(i, 2);
for (int j = 0; j < box.Length; j++)//go through string
{
if (box[j].Equals('.'))
{
if (j + 5 < box.Length && !box[j + 5].Equals('Z'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
else if (j + 3 == box.Length - 1 && !box[j - 4].Equals('.'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
}
}
}
output.Flush();
excel.Close();
MessageBox.Show("Deserts without Zounds added to " + outputPath, "Completed");
}
else
{
MessageBox.Show("Nothing was selected");
}
}
private void EarthlikesButton_Click(object sender, EventArgs e)
{
int.TryParse(numberTextBox.Text, out int temp);
if (temp > 0)
{
int planetNumber = Int32.Parse(numberTextBox.Text);
Excel excel = OpenFileAt(4);
string planet = excel.ReadCellString(planetNumber, 2); //read row planet number column c
excel.Close();//dellocate
numberTextBox.Text = planet;
}
else if (EarthlikeZoundsCheckBox.Checked && EarthlikesCheckBox.Checked) //both
{
Excel excel = OpenFileAt(4);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Earthlikes: ");
for (int i = 1; i <= planet; i++)
{
WriteAllPlanetInfo(i, excel);
}
output.Flush();
excel.Close();
MessageBox.Show("Earthlikes added to " + outputPath, "Completed");
}
else if (EarthlikeZoundsCheckBox.Checked && !EarthlikesCheckBox.Checked) //Earthlike Zounds only
{
Excel excel = OpenFileAt(4);
int planet = (int)excel.ReadCellDouble(2, 8); //amount of zounds
output.WriteLine("Earthlike Zounds: ");
for (int i = 1; i <= planet; i++)
{
output.WriteLine(excel.ReadCellString(i, 5)); //column F
}
output.Flush();
excel.Close();
MessageBox.Show("Earthlikes Zounds added to " + outputPath, "Completed");
}
else if (!EarthlikeZoundsCheckBox.Checked && EarthlikesCheckBox.Checked) //normies only
{
Excel excel = OpenFileAt(4);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Earthlike Non-Zounds: ");
for (int i = 1; i <= planet; i++)
{
string box = excel.ReadCellString(i, 2);
for (int j = 0; j < box.Length; j++)//go through string
{
if (box[j].Equals('.'))
{
if (j + 5 < box.Length && !box[j + 5].Equals('Z'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
else if (j + 3 == box.Length - 1 && !box[j - 4].Equals('.'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
}
}
}
output.Flush();
excel.Close();
MessageBox.Show("Earthlikes without Zounds added to " + outputPath, "Completed");
}
else
{
MessageBox.Show("Nothing was selected");
}
}
private void GreenhousesButton_Click(object sender, EventArgs e)
{
int.TryParse(numberTextBox.Text, out int temp);
if (temp > 0)
{
int planetNumber = Int32.Parse(numberTextBox.Text);
Excel excel = OpenFileAt(5);
string planet = excel.ReadCellString(planetNumber, 2); //read row planet number column c
excel.Close();//dellocate
numberTextBox.Text = planet;
}
else if (GreenhouseZoundsCheckBox.Checked && GreenhousesCheckBox.Checked) //both
{
Excel excel = OpenFileAt(5);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Greenhouses: ");
for (int i = 1; i <= planet; i++)
{
WriteAllPlanetInfo(i, excel);
}
output.Flush();
excel.Close();
MessageBox.Show("Greenhouses added to " + outputPath, "Completed");
}
else if (GreenhouseZoundsCheckBox.Checked && !GreenhousesCheckBox.Checked) //Greenhouse Zounds only
{
Excel excel = OpenFileAt(5);
int planet = (int)excel.ReadCellDouble(2, 8); //amount of zounds
output.WriteLine("Greenhouse Zounds: ");
for (int i = 1; i <= planet; i++)
{
output.WriteLine(excel.ReadCellString(i, 5)); //column F
}
output.Flush();
excel.Close();
MessageBox.Show("Greenhouses Zounds added to " + outputPath, "Completed");
}
else if (!GreenhouseZoundsCheckBox.Checked && GreenhousesCheckBox.Checked) //normies only
{
Excel excel = OpenFileAt(5);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Greenhouse Non-Zounds: ");
for (int i = 1; i <= planet; i++)
{
string box = excel.ReadCellString(i, 2);
for (int j = 0; j < box.Length; j++)//go through string
{
if (box[j].Equals('.'))
{
if (j + 5 < box.Length && !box[j + 5].Equals('Z'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
else if (j + 3 == box.Length - 1 && !box[j - 4].Equals('.'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
}
}
}
output.Flush();
excel.Close();
MessageBox.Show("Greenhouses without Zounds added to " + outputPath, "Completed");
}
else
{
MessageBox.Show("Nothing was selected");
}
}
private void MountainousButton_Click(object sender, EventArgs e)
{
int.TryParse(numberTextBox.Text, out int temp);
if (temp > 0)
{
int planetNumber = Int32.Parse(numberTextBox.Text);
Excel excel = OpenFileAt(6);
string planet = excel.ReadCellString(planetNumber, 2); //read row planet number column c
excel.Close();//dellocate
numberTextBox.Text = planet;
}
else if (MountainZoundsCheckBox.Checked && MountainousCheckBox.Checked) //both
{
Excel excel = OpenFileAt(6);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Mountainous: ");
for (int i = 1; i <= planet; i++)
{
WriteAllPlanetInfo(i, excel);
}
output.Flush();
excel.Close();
MessageBox.Show("Mountainous added to " + outputPath, "Completed");
}
else if (MountainZoundsCheckBox.Checked && !MountainousCheckBox.Checked) //Mountain Zounds only
{
Excel excel = OpenFileAt(6);
int planet = (int)excel.ReadCellDouble(2, 8); //amount of zounds
output.WriteLine("Mountain Zounds: ");
for (int i = 1; i <= planet; i++)
{
output.WriteLine(excel.ReadCellString(i, 5)); //column F
}
output.Flush();
excel.Close();
MessageBox.Show("Mountainous Zounds added to " + outputPath, "Completed");
}
else if (!MountainZoundsCheckBox.Checked && MountainousCheckBox.Checked) //normies only
{
Excel excel = OpenFileAt(6);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Mountain Non-Zounds: ");
for (int i = 1; i <= planet; i++)
{
string box = excel.ReadCellString(i, 2);
for (int j = 0; j < box.Length; j++)//go through string
{
if (box[j].Equals('.'))
{
if (j + 5 < box.Length && !box[j + 5].Equals('Z'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
else if (j + 3 == box.Length - 1 && !box[j - 4].Equals('.'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
}
}
}
output.Flush();
excel.Close();
MessageBox.Show("Mountainous without Zounds added to " + outputPath, "Completed");
}
else
{
MessageBox.Show("Nothing was selected");
}
}
private void OceanicsButton_Click(object sender, EventArgs e)
{
int.TryParse(numberTextBox.Text, out int temp);
if (temp > 0)
{
int planetNumber = Int32.Parse(numberTextBox.Text);
Excel excel = OpenFileAt(7);
string planet = excel.ReadCellString(planetNumber, 2); //read row planet number column c
excel.Close();//dellocate
numberTextBox.Text = planet;
}
else if (OceanicZoundsCheckBox.Checked && OceanicsCheckBox.Checked) //both
{
Excel excel = OpenFileAt(7);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Oceanics: ");
for (int i = 1; i <= planet; i++)
{
WriteAllPlanetInfo(i, excel);
}
output.Flush();
excel.Close();
MessageBox.Show("Oceanics added to " + outputPath, "Completed");
}
else if (OceanicZoundsCheckBox.Checked && !OceanicsCheckBox.Checked) //Oceanic Zounds only
{
Excel excel = OpenFileAt(7);
int planet = (int)excel.ReadCellDouble(2, 8); //amount of zounds
output.WriteLine("Oceanic Zounds: ");
for (int i = 1; i <= planet; i++)
{
output.WriteLine(excel.ReadCellString(i, 5)); //column F
}
output.Flush();
excel.Close();
MessageBox.Show("Oceanics Zounds added to " + outputPath, "Completed");
}
else if (!OceanicZoundsCheckBox.Checked && OceanicsCheckBox.Checked) //normies only
{
Excel excel = OpenFileAt(7);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Oceanic Non-Zounds: ");
for (int i = 1; i <= planet; i++)
{
string box = excel.ReadCellString(i, 2);
for (int j = 0; j < box.Length; j++)//go through string
{
if (box[j].Equals('.'))
{
if (j + 5 < box.Length && !box[j + 5].Equals('Z'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
else if (j + 3 == box.Length - 1 && !box[j - 4].Equals('.'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
}
}
}
output.Flush();
excel.Close();
MessageBox.Show("Oceanics without Zounds added to " + outputPath, "Completed");
}
else
{
MessageBox.Show("Nothing was selected");
}
}
private void ParadisesButton_Click(object sender, EventArgs e)
{
int.TryParse(numberTextBox.Text, out int temp);
if (temp > 0)
{
int planetNumber = Int32.Parse(numberTextBox.Text);
Excel excel = OpenFileAt(8);
string planet = excel.ReadCellString(planetNumber, 2); //read row planet number column c
excel.Close();//dellocate
numberTextBox.Text = planet;
}
else
{
Excel excel = OpenFileAt(8);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Paradises: ");
for (int i = 1; i <= planet; i++)
{
WriteAllPlanetInfo(i, excel);
}
output.Flush();
excel.Close();
MessageBox.Show("Paradises added to " + outputPath, "Completed");
}
}
private void RockiesButton_Click(object sender, EventArgs e)
{
int.TryParse(numberTextBox.Text, out int temp);
if (temp > 0)
{
int planetNumber = Int32.Parse(numberTextBox.Text);
Excel excel = OpenFileAt(9);
string planet = excel.ReadCellString(planetNumber, 2); //read row planet number column c
excel.Close();//dellocate
numberTextBox.Text = planet;
}
else if (RockyZoundsCheckBox.Checked && RockiesCheckBox.Checked) //both
{
Excel excel = OpenFileAt(9);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Rockies: ");
for (int i = 1; i <= planet; i++)
{
WriteAllPlanetInfo(i, excel);
}
output.Flush();
excel.Close();
MessageBox.Show("Rockies added to " + outputPath, "Completed");
}
else if (RockyZoundsCheckBox.Checked && !RockiesCheckBox.Checked) //Rockie Zounds only
{
Excel excel = OpenFileAt(9);
int planet = (int)excel.ReadCellDouble(2, 8); //amount of zounds
output.WriteLine("Rocky Zounds: ");
for (int i = 1; i <= planet; i++)
{
output.WriteLine(excel.ReadCellString(i, 5)); //column F
}
output.Flush();
excel.Close();
MessageBox.Show("Rocky Zounds added to " + outputPath, "Completed");
}
else if (!RockyZoundsCheckBox.Checked && RockiesCheckBox.Checked) //normies only
{
Excel excel = OpenFileAt(9);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Rocky Non-Zounds: ");
for (int i = 1; i <= planet; i++)
{
string box = excel.ReadCellString(i, 2);
for (int j = 0; j < box.Length; j++)//go through string
{
if (box[j].Equals('.'))
{
if (j + 5 < box.Length && !box[j + 5].Equals('Z'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
else if (j + 3 == box.Length - 1 && !box[j - 4].Equals('.'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
}
}
}
output.Flush();
excel.Close();
MessageBox.Show("Rockies without Zounds added to " + outputPath, "Completed");
}
else
{
MessageBox.Show("Nothing was selected");
}
}
private void VolcanicsButton_Click(object sender, EventArgs e)
{
int.TryParse(numberTextBox.Text, out int temp);
if (temp > 0)
{
int planetNumber = Int32.Parse(numberTextBox.Text);
Excel excel = OpenFileAt(10);
string planet = excel.ReadCellString(planetNumber, 2); //read row planet number column c
excel.Close();//dellocate
numberTextBox.Text = planet;
}
else if (VolcanicZoundsCheckBox.Checked && VolcanicsCheckBox.Checked) //both
{
Excel excel = OpenFileAt(10);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Volcanics: ");
for (int i = 1; i <= planet; i++)
{
WriteAllPlanetInfo(i, excel);
}
output.Flush();
excel.Close();
MessageBox.Show("Volcanics added to " + outputPath, "Completed");
}
else if (VolcanicZoundsCheckBox.Checked && !VolcanicsCheckBox.Checked) //Volcanic Zounds only
{
Excel excel = OpenFileAt(10);
int planet = (int)excel.ReadCellDouble(2, 8); //amount of zounds
output.WriteLine("Volcanic Zounds: ");
for (int i = 1; i <= planet; i++)
{
output.WriteLine(excel.ReadCellString(i, 5)); //column F
}
output.Flush();
excel.Close();
MessageBox.Show("Volcanics Zounds added to " + outputPath, "Completed");
}
else if (!VolcanicZoundsCheckBox.Checked && VolcanicsCheckBox.Checked) //normies only
{
Excel excel = OpenFileAt(10);
int planet = (int)excel.ReadCellDouble(1, 8); //amount of planets
output.WriteLine("Volcanic Non-Zounds: ");
for (int i = 1; i <= planet; i++)
{
string box = excel.ReadCellString(i, 2);
for (int j = 0; j < box.Length; j++)//go through string
{
if (box[j].Equals('.'))
{
if (j + 5 < box.Length && !box[j + 5].Equals('Z'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
else if (j + 3 == box.Length - 1 && !box[j - 4].Equals('.'))
{
output.WriteLine(excel.ReadCellString(i, 2)); //column C
}
}
}
}
output.Flush();
excel.Close();
MessageBox.Show("Volcanics without Zounds added to " + outputPath, "Completed");
}
else
{
MessageBox.Show("Nothing was selected");
}
}
private void WriteAllPlanetInfo(int planetNum, Excel excel)
{
output.Write(excel.ReadCellString(planetNum, 2) + " | "); //column C
//Console.WriteLine(excel.ReadCellString(planetNum, 2));
for(int i = 10; i <= 38; i++)
{
//Console.WriteLine(i);
if (i == 11 || i == 12 || (i >= 14 && i <= 19) || (i >= 25 && i <=37))
{
var temp = excel.ReadCellDouble(planetNum, i);
output.Write(temp + " | ");
}
else if (i == 38)
{
string temp = excel.ReadCellString(planetNum, i);
output.Write(temp);
}
else
{
string temp = excel.ReadCellString(planetNum, i);
output.Write(temp + " | ");
}
}
output.WriteLine("");
}
/// <summary>
/// Finds and outputs the planet info if the string matches
/// </summary>
/// <param name="find"></param>
/// <param name="column"></param>
private void WriteAllPlanetInfoIf(string find, int column)
{
for (int j = 2; j <= 10; j++) // goes through each sheet
{
Excel excel = OpenFileAt(j);
int planet = (int)excel.ReadCellDouble(1, 8);
for (int i = 1; i <= planet; i++) // goes through the planet list
{
if (excel.ReadCellString(planet, column).Equals(find))
{
WriteAllPlanetInfo(planet, excel);
}
}
excel.Close();
}
}
/// <summary>
/// Finds and outputs the planet info if the integer matches
/// </summary>
/// <param name="find"></param>
/// <param name="column"></param>
private void WriteAllPlanetInfoIf(int find, int column)
{
for (int j = 2; j <= 10; j++) // goes through each sheet
{
Excel excel = OpenFileAt(j);
int planet = (int)excel.ReadCellDouble(1, 8);
for (int i = 1; i <= planet; i++) // goes through the planet list
{
int temp = (int)excel.ReadCellDouble(planet, column);
if (temp.Equals(find))
{
WriteAllPlanetInfo(planet, excel);
}
}
excel.Close();
}
}
/// <summary>
/// Finds and compares the number and outprints all the planet info if true
/// </summary>
/// <param name="find"></param>
/// <param name="column"></param>
private void WriteAllPlanetInfoIf(int compare, int column, bool greaterThan, bool lessThan, bool equalTo)
{
for (int j = 2; j <= 10; j++) // goes through each sheet
{
Excel excel = OpenFileAt(j);
int planet = (int)excel.ReadCellDouble(1, 8);
for (int i = 1; i <= planet; i++) // goes through the planet list
{
double temp = excel.ReadCellDouble(planet, column);
if (temp < compare && lessThan)
{
WriteAllPlanetInfo(planet, excel);
}
else if (temp > compare && greaterThan)
{
WriteAllPlanetInfo(planet, excel);
}
else if (temp == compare && equalTo)
{
WriteAllPlanetInfo(planet, excel);
}
}
excel.Close();
}
}
private void NeedsDefensesButton_Click(object sender, EventArgs e)
{
Excel excel = OpenFileAt(1);
output.WriteLine("Needs Defense List: ");
for (int i = 2; i < Program.GetMax(); i++)
{
output.WriteLine(excel.ReadCellString(i, 14)); //needs defense column
}
output.Flush();
excel.Close();
MessageBox.Show("Needs Defense List added to Output.txt", "Completed");
}
private void GrowingButton_Click(object sender, EventArgs e)
{
Excel excel = OpenFileAt(1);
output.WriteLine("Growing List: ");
for (int i = 2; i < Program.GetMax(); i++)
{
output.WriteLine(excel.ReadCellString(i, 11)); //growing column
}
output.Flush();
excel.Close();
MessageBox.Show("Growing List added to Output.txt", "Completed");
}
private void RenameListsButton_Click(object sender, EventArgs e)
{
Excel excel = OpenFileAt(1);
output.WriteLine("Rename Lists : Coordinates | Current Name | Rename ");
for (int i = 2; i < Program.GetMax(); i++)
{
if (excel.ReadCellString(i, 6) != "")
{
output.Write(excel.ReadCellString(i, 6) + " | "); //location
}
if (excel.ReadCellString(i, 7) != "")
{
output.Write(excel.ReadCellString(i, 7) + " | ");//before
}
if (excel.ReadCellString(i, 8) != "")
{
output.Write("/namecolony " + excel.ReadCellString(i, 8));//after
}
if(excel.ReadCellString(i, 6) != "" || excel.ReadCellString(i, 7) != "" || excel.ReadCellString(i, 8) != "")
{
output.WriteLine("");
}
}
output.Flush();
excel.Close();
MessageBox.Show("Rename lists added to Output.txt", "Completed");
}
private void DoubleDomeListButton_Click(object sender, EventArgs e)
{
Excel excel = OpenFileAt(1);
output.WriteLine("Double Domes Lists: Candidates | Double Domes: ");
for (int i = 2; i < Program.GetMax(); i++)
{
if (excel.ReadCellString(i, 18) != "")
{
output.Write(excel.ReadCellString(i, 18) + " | "); //Candidates
}
if (excel.ReadCellString(i, 19) != "")
{
output.Write(excel.ReadCellString(i, 19) + " | ");//double doems
}
if (excel.ReadCellString(i, 18) != "" || excel.ReadCellString(i, 19) != "")
{
output.WriteLine("");
}
}
output.Flush();
excel.Close();
MessageBox.Show("Double Domes list added to Output.txt", "Completed");
}
private Excel OpenFileAt(int num)
{
Excel excel = new Excel(excelPath, num);
return excel;
}
public void SetExcelPath(string path)
{
excelPath = path;
}
public StreamWriter GetOutput()
{
return output;
}
public void SetOutputPath(string path)
{
outputPath = path;
output = new StreamWriter(outputPath);
}
public void OpenOutput()
{
output = new StreamWriter(outputPath);
}
public void CloseOutput()
{
GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
GC.WaitForPendingFinalizers();
//Marshal.FinalReleaseComObject(output);
output.Close();
//GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced);
//GC.WaitForPendingFinalizers();
}
private void ClearOutputButton_Click(object sender, EventArgs e)
{
CloseOutput();
File.WriteAllText(outputPath, "");
OpenOutput();
output.Flush();
MessageBox.Show(outputPath + " has been cleared", "Message");
}
private void LineBreakButton_Click(object sender, EventArgs e)
{
output.WriteLine("");
output.WriteLine("_____________________________________________");
output.WriteLine("");
}
private void FindMoraleButton_Click(object sender, EventArgs e)
{
}
private void SameSystemListButton_Click(object sender, EventArgs e)
{
Coordinates system = Algorithms.GetCoordinates(numberTextBox.Text);
for (int j = 2; j <= 10; j++) // goes through each sheet
{
Excel excel = OpenFileAt(j);
int planet = (int)excel.ReadCellDouble(1, 8);
for (int i = 1; i <= planet; i++) // goes through the planet list
{
string planetName = excel.ReadCellString(i, 2);
Coordinates planetCoords = Algorithms.GetCoordinates(planetName);
if(system.x == planetCoords.x && system.y == planetCoords.y)
{
output.WriteLine(planetName);
}
}
excel.Close();
}
output.Flush();
MessageBox.Show("Colonies in the Same System to output", "Message");
}
private void BuildListButton_Click(object sender, EventArgs e)
{
Excel excel = OpenFileAt(11);
int planetsToBuild = (int) excel.ReadCellDouble(1, 15);
for (int i = 1; i <= planetsToBuild; i++) //planet tally is in P column
{
//output.Write("Coordinates: ");
output.Write(excel.ReadCellString(i, 2)); //coordinates
output.Write(" | ");
//output.Write("Planet Name: ");
output.Write(excel.ReadCellString(i, 3)); //colony name
output.Write(" | ");
//output.Write("Colony Name: ");
output.Write(excel.ReadCellString(i, 4));//Planet Name
output.Write(" | ");
output.Write("Zounds: ");
output.Write(excel.ReadCellBool(i, 5));//Zoundsable
output.Write(" | ");
output.Write("Medium: ");
output.Write(excel.ReadCellBool(i, 6));//Medium
output.Write(" | ");
output.Write("?: ");
output.Write(excel.ReadCellBool(i, 7));//Questionable
output.Write(" | ");
output.Write("Decconstruct: ");
output.Write(excel.ReadCellBool(i, 8));//Deconstruct
output.Write(" | ");
//output.Write("Research x/10: ");
output.Write((int) excel.ReadCellDouble(i, 9)); //Research
output.Write(" | ");
output.WriteLine("");
}
output.Flush();
MessageBox.Show("Build List added to output", "Message");
}
private void SolarsListButton_Click(object sender, EventArgs e)
{
WriteAllPlanetInfoIf(15, 33, false, true, true);
WriteAllPlanetInfoIf(100, 34, false, true, true);
MessageBox.Show("Weak Solar Colonies to Output", "Completed!");
}
private void LasersListButton_Click(object sender, EventArgs e)
{
WriteAllPlanetInfoIf(150, 32, true, false, true);
MessageBox.Show("Laser Colonies to Output", "Completed!");
}
private void CMinesListButton_Click(object sender, EventArgs e)
{
WriteAllPlanetInfoIf(100, 31, true, false, true);
MessageBox.Show("Compound Mine Colonies to Output", "Completed!");
}
private void NukesListButton_Click(object sender, EventArgs e)
{
WriteAllPlanetInfoIf(250, 32, true, false, true);
MessageBox.Show("Nukes Colonies to Output", "Completed!");
}
private void SocialismListButton_Click(object sender, EventArgs e)
{
WriteAllPlanetInfoIf("Socialism", 13);
MessageBox.Show("Socialism Colonies to Output", "Completed!");
}
private void DemocracyListButton_Click(object sender, EventArgs e)
{
WriteAllPlanetInfoIf("Democracy", 13);
MessageBox.Show("Democracy Colonies to Output", "Completed!");
}
private void PrisonListButton_Click(object sender, EventArgs e)
{
WriteAllPlanetInfoIf("Prison", 13);
MessageBox.Show("Prison Colonies to Output", "Completed!");
}
private void DirectorshipListButton_Click(object sender, EventArgs e)
{
WriteAllPlanetInfoIf("Directorship", 13);
MessageBox.Show("Directorship Colonies to Output", "Completed!");
}
private void ConstructionListButton_Click(object sender, EventArgs e)
{
Excel excel = OpenFileAt(1);
output.WriteLine("Construction List: ");
for (int i = 2; i < Program.GetMax(); i++)
{
output.WriteLine(excel.ReadCellString(i, 25)); //needs defense column
}
output.Flush();
excel.Close();
MessageBox.Show("Construction List added to Output.txt", "Completed");
}
private void LowMetalButton_Click(object sender, EventArgs e)
{
for (int j = 2; j <= 10; j++) // goes through each sheet
{
Excel excel = OpenFileAt(j);
int planet = (int)excel.ReadCellDouble(1, 8);
for (int i = 1; i <= planet; i++) // goes through the planet list
{
if (excel.ReadCellInt(i,26) <= 5000){
}
}
}
}
}//PlanetTypeForm
}//namespace
| 37.696619 | 161 | 0.459206 | [
"MIT"
] | roku674/StarportExcel | Starport/Forms/PlanetTypeForm.cs | 42,373 | C# |
using Application.Common.Behaviours;
using Application.Common.Interfaces;
using Application.Features.UrlItems;
using Application.Infrastructure.Persistance;
using MediatR;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace Application;
public static class DependencyInjection
{
public static IServiceCollection AddInfrastructure(this IServiceCollection services, IConfiguration configuration)
{
services.AddDbContext<AppDbContext>(options =>
options.UseSqlServer(
configuration.GetConnectionString("DefaultConnection"),
b => b.MigrationsAssembly(typeof(AppDbContext).Assembly.FullName)));
services.AddScoped<IAppDbContext>(provider => provider.GetService<AppDbContext>());
return services;
}
public static void AddApplication(this IServiceCollection services)
{
services.AddMediatR(typeof(DependencyInjection).Assembly);
// MediatR Pipeline, executes in order of registraion.
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(UnhandledExceptionBehavior<,>));
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(LoggingBehavior<,>));
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>));
// Validators
services.AddTransient<IValidator<CreateUrlItemCommand>, CreateUrlItemCommandValidator>();
}
} | 39 | 118 | 0.751687 | [
"Apache-2.0"
] | andrewtomas/url-shortener | backend/Application/DependencyInjection.cs | 1,484 | C# |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
using System;
using System.Collections.Generic;
using Aliyun.Acs.Core.Transform;
using Aliyun.Acs.CCC.Model.V20200701;
namespace Aliyun.Acs.CCC.Transform.V20200701
{
public class CancelAttendedTransferResponseUnmarshaller
{
public static CancelAttendedTransferResponse Unmarshall(UnmarshallerContext _ctx)
{
CancelAttendedTransferResponse cancelAttendedTransferResponse = new CancelAttendedTransferResponse();
cancelAttendedTransferResponse.HttpResponse = _ctx.HttpResponse;
cancelAttendedTransferResponse.Code = _ctx.StringValue("CancelAttendedTransfer.Code");
cancelAttendedTransferResponse.HttpStatusCode = _ctx.IntegerValue("CancelAttendedTransfer.HttpStatusCode");
cancelAttendedTransferResponse.Message = _ctx.StringValue("CancelAttendedTransfer.Message");
cancelAttendedTransferResponse.RequestId = _ctx.StringValue("CancelAttendedTransfer.RequestId");
List<string> cancelAttendedTransferResponse_params = new List<string>();
for (int i = 0; i < _ctx.Length("CancelAttendedTransfer.Params.Length"); i++) {
cancelAttendedTransferResponse_params.Add(_ctx.StringValue("CancelAttendedTransfer.Params["+ i +"]"));
}
cancelAttendedTransferResponse._Params = cancelAttendedTransferResponse_params;
CancelAttendedTransferResponse.CancelAttendedTransfer_Data data = new CancelAttendedTransferResponse.CancelAttendedTransfer_Data();
data.ContextId = _ctx.LongValue("CancelAttendedTransfer.Data.ContextId");
CancelAttendedTransferResponse.CancelAttendedTransfer_Data.CancelAttendedTransfer_CallContext callContext = new CancelAttendedTransferResponse.CancelAttendedTransfer_Data.CancelAttendedTransfer_CallContext();
callContext.CallType = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.CallType");
callContext.InstanceId = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.InstanceId");
callContext.JobId = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.JobId");
List<CancelAttendedTransferResponse.CancelAttendedTransfer_Data.CancelAttendedTransfer_CallContext.CancelAttendedTransfer_ChannelContext> callContext_channelContexts = new List<CancelAttendedTransferResponse.CancelAttendedTransfer_Data.CancelAttendedTransfer_CallContext.CancelAttendedTransfer_ChannelContext>();
for (int i = 0; i < _ctx.Length("CancelAttendedTransfer.Data.CallContext.ChannelContexts.Length"); i++) {
CancelAttendedTransferResponse.CancelAttendedTransfer_Data.CancelAttendedTransfer_CallContext.CancelAttendedTransfer_ChannelContext channelContext = new CancelAttendedTransferResponse.CancelAttendedTransfer_Data.CancelAttendedTransfer_CallContext.CancelAttendedTransfer_ChannelContext();
channelContext.AssociatedData = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.ChannelContexts["+ i +"].AssociatedData");
channelContext.CallType = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.ChannelContexts["+ i +"].CallType");
channelContext.ChannelFlags = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.ChannelContexts["+ i +"].ChannelFlags");
channelContext.ChannelId = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.ChannelContexts["+ i +"].ChannelId");
channelContext.ChannelState = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.ChannelContexts["+ i +"].ChannelState");
channelContext.Destination = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.ChannelContexts["+ i +"].Destination");
channelContext.Index = _ctx.IntegerValue("CancelAttendedTransfer.Data.CallContext.ChannelContexts["+ i +"].Index");
channelContext.JobId = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.ChannelContexts["+ i +"].JobId");
channelContext.Originator = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.ChannelContexts["+ i +"].Originator");
channelContext.ReleaseInitiator = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.ChannelContexts["+ i +"].ReleaseInitiator");
channelContext.ReleaseReason = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.ChannelContexts["+ i +"].ReleaseReason");
channelContext.Timestamp = _ctx.LongValue("CancelAttendedTransfer.Data.CallContext.ChannelContexts["+ i +"].Timestamp");
channelContext.UserExtension = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.ChannelContexts["+ i +"].UserExtension");
channelContext.UserId = _ctx.StringValue("CancelAttendedTransfer.Data.CallContext.ChannelContexts["+ i +"].UserId");
callContext_channelContexts.Add(channelContext);
}
callContext.ChannelContexts = callContext_channelContexts;
data.CallContext = callContext;
CancelAttendedTransferResponse.CancelAttendedTransfer_Data.CancelAttendedTransfer_UserContext userContext = new CancelAttendedTransferResponse.CancelAttendedTransfer_Data.CancelAttendedTransfer_UserContext();
userContext.BreakCode = _ctx.StringValue("CancelAttendedTransfer.Data.UserContext.BreakCode");
userContext.DeviceId = _ctx.StringValue("CancelAttendedTransfer.Data.UserContext.DeviceId");
userContext.Extension = _ctx.StringValue("CancelAttendedTransfer.Data.UserContext.Extension");
userContext.Heartbeat = _ctx.LongValue("CancelAttendedTransfer.Data.UserContext.Heartbeat");
userContext.InstanceId = _ctx.StringValue("CancelAttendedTransfer.Data.UserContext.InstanceId");
userContext.JobId = _ctx.StringValue("CancelAttendedTransfer.Data.UserContext.JobId");
userContext.Mobile = _ctx.StringValue("CancelAttendedTransfer.Data.UserContext.Mobile");
userContext.OutboundScenario = _ctx.BooleanValue("CancelAttendedTransfer.Data.UserContext.OutboundScenario");
userContext.Reserved = _ctx.LongValue("CancelAttendedTransfer.Data.UserContext.Reserved");
userContext.UserId = _ctx.StringValue("CancelAttendedTransfer.Data.UserContext.UserId");
userContext.UserState = _ctx.StringValue("CancelAttendedTransfer.Data.UserContext.UserState");
userContext.WorkMode = _ctx.StringValue("CancelAttendedTransfer.Data.UserContext.WorkMode");
List<string> userContext_signedSkillGroupIdList = new List<string>();
for (int i = 0; i < _ctx.Length("CancelAttendedTransfer.Data.UserContext.SignedSkillGroupIdList.Length"); i++) {
userContext_signedSkillGroupIdList.Add(_ctx.StringValue("CancelAttendedTransfer.Data.UserContext.SignedSkillGroupIdList["+ i +"]"));
}
userContext.SignedSkillGroupIdList = userContext_signedSkillGroupIdList;
data.UserContext = userContext;
cancelAttendedTransferResponse.Data = data;
return cancelAttendedTransferResponse;
}
}
}
| 73.215686 | 316 | 0.806374 | [
"Apache-2.0"
] | aliyun/aliyun-openapi-net-sdk | aliyun-net-sdk-ccc/CCC/Transform/V20200701/CancelAttendedTransferResponseUnmarshaller.cs | 7,468 | C# |
using Plang.CoyoteRuntime.Values;
namespace Plang.CoyoteRuntime
{
public static class PrtValues
{
public static PrtBool Box(bool value)
{
return value;
}
public static PrtInt Box(long value)
{
return new PrtInt(value);
}
public static PrtInt Box(int value)
{
return new PrtInt(value);
}
public static PrtInt Box(short value)
{
return new PrtInt(value);
}
public static PrtInt Box(byte value)
{
return new PrtInt(value);
}
public static PrtFloat Box(double value)
{
return new PrtFloat(value);
}
public static PrtFloat Box(float value)
{
return new PrtFloat(value);
}
public static PrtBool SafeEquals(IPrtValue val1, IPrtValue val2)
{
return ReferenceEquals(val1, val2) || val1 != null && val1.Equals(val2);
}
public static IPrtValue PrtCastValue(IPrtValue value, PrtType type)
{
//todo: Needs to be fixed for better error message
/*if (!PrtInhabitsType(value, type))
throw new PrtInhabitsTypeException(
$"value {value.ToString()} is not a member of type {type.ToString()}");*/
return value.Clone();
}
}
} | 25.178571 | 93 | 0.539007 | [
"MIT"
] | KelvinLi2020/P | Src/PRuntimes/CoyoteRuntime/PrtValues.cs | 1,412 | C# |
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using osu.Framework.Bindables;
using osu.Framework.Extensions.ExceptionExtensions;
using osu.Framework.Graphics;
using osu.Framework.Logging;
using osu.Game.Configuration;
using osu.Game.Online.API.Requests;
using osu.Game.Users;
namespace osu.Game.Online.API
{
public class APIAccess : Component, IAPIProvider
{
private readonly OsuConfigManager config;
private readonly OAuth authentication;
public string Endpoint => @"https://osu.ppy.sh";
private const string client_id = @"5";
private const string client_secret = @"FGc9GAtyHzeQDshWP5Ah7dega8hJACAJpQtw6OXk";
private readonly Queue<APIRequest> queue = new Queue<APIRequest>();
/// <summary>
/// The username/email provided by the user when initiating a login.
/// </summary>
public string ProvidedUsername { get; private set; }
private string password;
public Bindable<User> LocalUser { get; } = new Bindable<User>(createGuestUser());
public Bindable<UserActivity> Activity { get; } = new Bindable<UserActivity>();
protected bool HasLogin => authentication.Token.Value != null || (!string.IsNullOrEmpty(ProvidedUsername) && !string.IsNullOrEmpty(password));
private readonly CancellationTokenSource cancellationToken = new CancellationTokenSource();
private readonly Logger log;
public APIAccess(OsuConfigManager config)
{
this.config = config;
authentication = new OAuth(client_id, client_secret, Endpoint);
log = Logger.GetLogger(LoggingTarget.Network);
ProvidedUsername = config.Get<string>(OsuSetting.Username);
authentication.TokenString = config.Get<string>(OsuSetting.Token);
authentication.Token.ValueChanged += onTokenChanged;
LocalUser.BindValueChanged(u =>
{
u.OldValue?.Activity.UnbindFrom(Activity);
u.NewValue.Activity.BindTo(Activity);
}, true);
var thread = new Thread(run)
{
Name = "APIAccess",
IsBackground = true
};
thread.Start();
}
private void onTokenChanged(ValueChangedEvent<OAuthToken> e) => config.Set(OsuSetting.Token, config.Get<bool>(OsuSetting.SavePassword) ? authentication.TokenString : string.Empty);
private readonly List<IOnlineComponent> components = new List<IOnlineComponent>();
internal new void Schedule(Action action) => base.Schedule(action);
/// <summary>
/// Register a component to receive API events.
/// Fires <see cref="IOnlineComponent.APIStateChanged"/> once immediately to ensure a correct state.
/// </summary>
/// <param name="component"></param>
public void Register(IOnlineComponent component)
{
Schedule(() => components.Add(component));
component.APIStateChanged(this, state);
}
public void Unregister(IOnlineComponent component)
{
Schedule(() => components.Remove(component));
}
public string AccessToken => authentication.RequestAccessToken();
/// <summary>
/// Number of consecutive requests which failed due to network issues.
/// </summary>
private int failureCount;
private void run()
{
while (!cancellationToken.IsCancellationRequested)
{
switch (State)
{
case APIState.Failing:
//todo: replace this with a ping request.
log.Add(@"In a failing state, waiting a bit before we try again...");
Thread.Sleep(5000);
if (!IsLoggedIn) goto case APIState.Connecting;
if (queue.Count == 0)
{
log.Add(@"Queueing a ping request");
Queue(new GetUserRequest());
}
break;
case APIState.Offline:
case APIState.Connecting:
// work to restore a connection...
if (!HasLogin)
{
State = APIState.Offline;
Thread.Sleep(50);
continue;
}
State = APIState.Connecting;
// save the username at this point, if the user requested for it to be.
config.Set(OsuSetting.Username, config.Get<bool>(OsuSetting.SaveUsername) ? ProvidedUsername : string.Empty);
if (!authentication.HasValidAccessToken && !authentication.AuthenticateWithLogin(ProvidedUsername, password))
{
//todo: this fails even on network-related issues. we should probably handle those differently.
//NotificationOverlay.ShowMessage("Login failed!");
log.Add(@"Login failed!");
password = null;
authentication.Clear();
continue;
}
var userReq = new GetUserRequest();
userReq.Success += u =>
{
LocalUser.Value = u;
// todo: save/pull from settings
LocalUser.Value.Status.Value = new UserStatusOnline();
failureCount = 0;
//we're connected!
State = APIState.Online;
};
if (!handleRequest(userReq))
{
if (State == APIState.Connecting)
State = APIState.Failing;
continue;
}
// The Success callback event is fired on the main thread, so we should wait for that to run before proceeding.
// Without this, we will end up circulating this Connecting loop multiple times and queueing up many web requests
// before actually going online.
while (State > APIState.Offline && State < APIState.Online)
Thread.Sleep(500);
break;
}
// hard bail if we can't get a valid access token.
if (authentication.RequestAccessToken() == null)
{
Logout();
continue;
}
while (true)
{
APIRequest req;
lock (queue)
{
if (queue.Count == 0) break;
req = queue.Dequeue();
}
handleRequest(req);
}
Thread.Sleep(50);
}
}
public void Perform(APIRequest request)
{
try
{
request.Perform(this);
}
catch (Exception e)
{
// todo: fix exception handling
request.Fail(e);
}
}
public Task PerformAsync(APIRequest request) =>
Task.Factory.StartNew(() => Perform(request), TaskCreationOptions.LongRunning);
public void Login(string username, string password)
{
Debug.Assert(State == APIState.Offline);
ProvidedUsername = username;
this.password = password;
}
public RegistrationRequest.RegistrationRequestErrors CreateAccount(string email, string username, string password)
{
Debug.Assert(State == APIState.Offline);
var req = new RegistrationRequest
{
Url = $@"{Endpoint}/users",
Method = HttpMethod.Post,
Username = username,
Email = email,
Password = password
};
try
{
req.Perform();
}
catch (Exception e)
{
try
{
return JObject.Parse(req.GetResponseString()).SelectToken("form_error", true).ToObject<RegistrationRequest.RegistrationRequestErrors>();
}
catch
{
// if we couldn't deserialize the error message let's throw the original exception outwards.
e.Rethrow();
}
}
return null;
}
/// <summary>
/// Handle a single API request.
/// Ensures all exceptions are caught and dealt with correctly.
/// </summary>
/// <param name="req">The request.</param>
/// <returns>true if the request succeeded.</returns>
private bool handleRequest(APIRequest req)
{
try
{
req.Perform(this);
// we could still be in initialisation, at which point we don't want to say we're Online yet.
if (IsLoggedIn) State = APIState.Online;
failureCount = 0;
return true;
}
catch (WebException we)
{
handleWebException(we);
return false;
}
catch (Exception ex)
{
Logger.Error(ex, "Error occurred while handling an API request.");
return false;
}
}
private APIState state;
public APIState State
{
get => state;
private set
{
if (state == value)
return;
APIState oldState = state;
state = value;
log.Add($@"We just went {state}!");
Schedule(() =>
{
components.ForEach(c => c.APIStateChanged(this, state));
OnStateChange?.Invoke(oldState, state);
});
}
}
private bool handleWebException(WebException we)
{
HttpStatusCode statusCode = (we.Response as HttpWebResponse)?.StatusCode
?? (we.Status == WebExceptionStatus.UnknownError ? HttpStatusCode.NotAcceptable : HttpStatusCode.RequestTimeout);
// special cases for un-typed but useful message responses.
switch (we.Message)
{
case "Unauthorized":
case "Forbidden":
statusCode = HttpStatusCode.Unauthorized;
break;
}
switch (statusCode)
{
case HttpStatusCode.Unauthorized:
Logout();
return true;
case HttpStatusCode.RequestTimeout:
failureCount++;
log.Add($@"API failure count is now {failureCount}");
if (failureCount < 3)
// we might try again at an api level.
return false;
if (State == APIState.Online)
{
State = APIState.Failing;
flushQueue();
}
return true;
}
return true;
}
public bool IsLoggedIn => LocalUser.Value.Id > 1;
public void Queue(APIRequest request)
{
lock (queue) queue.Enqueue(request);
}
public event StateChangeDelegate OnStateChange;
public delegate void StateChangeDelegate(APIState oldState, APIState newState);
private void flushQueue(bool failOldRequests = true)
{
lock (queue)
{
var oldQueueRequests = queue.ToArray();
queue.Clear();
if (failOldRequests)
{
foreach (var req in oldQueueRequests)
req.Fail(new WebException(@"Disconnected from server"));
}
}
}
public void Logout()
{
flushQueue();
password = null;
authentication.Clear();
// Scheduled prior to state change such that the state changed event is invoked with the correct user present
Schedule(() => LocalUser.Value = createGuestUser());
State = APIState.Offline;
}
private static User createGuestUser() => new GuestUser();
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
flushQueue();
cancellationToken.Cancel();
}
}
internal class GuestUser : User
{
public GuestUser()
{
Username = @"Guest";
Id = 1;
}
}
public enum APIState
{
/// <summary>
/// We cannot login (not enough credentials).
/// </summary>
Offline,
/// <summary>
/// We are having connectivity issues.
/// </summary>
Failing,
/// <summary>
/// We are in the process of (re-)connecting.
/// </summary>
Connecting,
/// <summary>
/// We are online.
/// </summary>
Online
}
}
| 33.175 | 189 | 0.48373 | [
"MIT"
] | E223/osu | osu.Game/Online/API/APIAccess.cs | 14,160 | 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("MagicNumbers")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MagicNumbers")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b5753a03-8d27-4036-8b01-214c4a7278c8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 37.756757 | 84 | 0.745168 | [
"MIT"
] | yani-valeva/Programming-Basics | ExamPreparation/MagicNumbers/Properties/AssemblyInfo.cs | 1,400 | C# |
//----------------------------------------------
// LitJson Ruler
// © 2015 yedo-factory
// auto-generated
//----------------------------------------------
namespace LJR
{
public static class Setting
{
public static string BaseUrl = "file:///Applications/workspace/LJR/Assets/LJR/Demo/Server/";
}
}
| 23.461538 | 94 | 0.485246 | [
"Apache-2.0"
] | 408794550/871AR | Assets/LJR/Scripts/Common/Setting.cs | 308 | C# |
using System;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
namespace StandWorld.UI.MainMenu
{
public class TabGroup : MonoBehaviour
{
[Header("Tab Color")]
public Color tabActive;
public Color tabExit;
[Header("Text Color")]
public Color textActive;
public Color textExit;
public TabButton selectedTab;
public int DeselectIndex;
public PanelGroup panelGroup;
public List<TabButton> tabButtons;
public void Start()
{
OnTabSelected(selectedTab);
}
public void Subscribe(TabButton button)
{
if (tabButtons == null)
{
tabButtons = new List<TabButton>();
}
tabButtons.Add(button);
}
public void OnTabEnter(TabButton button)
{
ResetTabs();
if (selectedTab == null || button != selectedTab)
{
Color temp1 = tabActive;
temp1.a = 0.9f;
button.background.color = temp1;
GameObject gameObject = button.gameObject.transform.GetChild(0).gameObject;
gameObject.GetComponent<TextMeshProUGUI>().color = textActive;
}
}
public void OnTabExit()
{
ResetTabs();
}
public void OnTabSelected(TabButton button)
{
if (selectedTab != null)
{
selectedTab.Deselect();
}
selectedTab = button;
selectedTab.Select();
ResetTabs();
button.background.color = tabActive;
GameObject gameObject = button.gameObject.transform.GetChild(0).gameObject;
gameObject.GetComponent<TextMeshProUGUI>().color = textActive;
if (panelGroup != null)
{
panelGroup.SetPageIndex(selectedTab.transform.GetSiblingIndex(), DeselectIndex);
DeselectIndex = selectedTab.transform.GetSiblingIndex();
}
}
public void ResetTabs()
{
foreach (TabButton button in tabButtons)
{
if (selectedTab != null && button == selectedTab)
{
continue;
}
button.background.color = tabExit;
GameObject gameObject = button.gameObject.transform.GetChild(0).gameObject;
gameObject.GetComponent<TextMeshProUGUI>().color = textExit;
}
}
}
}
| 27.957895 | 96 | 0.519955 | [
"MIT"
] | Stand1k/StandWorld | Assets/StandWorld/Scripts/UI/MainMenu/Tabs/TabGroup.cs | 2,658 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using Granular.Extensions;
namespace System.Windows.Media.Animation
{
public class SequentialClock : IClock
{
public TimeSpan FirstTick { get; private set; }
public TimeSpan LastTick { get; private set; }
public TimeSpan Duration { get; private set; }
private IEnumerable<IClock> clocks;
public SequentialClock(IEnumerable<IClock> clocks)
{
this.clocks = clocks;
if (!clocks.Any())
{
FirstTick = TimeSpan.Zero;
LastTick = TimeSpan.Zero;
Duration = TimeSpan.Zero;
}
else
{
FirstTick = clocks.First().FirstTick;
LastTick = clocks.Take(clocks.Count() - 1).Select(clock => clock.Duration).Aggregate((t1, t2) => t1 + t2) + clocks.Last().LastTick;
Duration = clocks.Select(clock => clock.Duration).Aggregate((t1, t2) => t1 + t2);
}
}
public ClockState Tick(TimeSpan time)
{
ClockProgressState progressState;
if (time < FirstTick)
{
progressState = ClockProgressState.BeforeStarted;
}
else if (time < LastTick)
{
progressState = ClockProgressState.Active;
}
else
{
progressState = ClockProgressState.AfterEnded;
}
TimeSpan previousTick = Granular.Compatibility.TimeSpan.MinValue;
TimeSpan nextTick = Granular.Compatibility.TimeSpan.MaxValue;
TimeSpan totalDuration = TimeSpan.Zero;
foreach (IClock clock in clocks)
{
ClockState state = clock.Tick(time - totalDuration);
if (state.PreviousTick != Granular.Compatibility.TimeSpan.MinValue)
{
previousTick = previousTick.Max(state.PreviousTick + totalDuration);
}
if (state.NextTick != Granular.Compatibility.TimeSpan.MaxValue)
{
nextTick = nextTick.Min(state.NextTick + totalDuration);
}
totalDuration += clock.Duration;
}
return new ClockState(progressState, 0, 0, previousTick, nextTick);
}
}
}
| 32.697368 | 148 | 0.52837 | [
"Apache-2.0"
] | bridgedotnet/Granular | Granular.Presentation/Media/Animation/SequentialClock.cs | 2,487 | C# |
/* _BEGIN_TEMPLATE_
{
"id": "ICC_466",
"name": [
"萨隆苦囚",
"Saronite Chain Gang"
],
"text": [
"<b>嘲讽</b>\n<b>战吼:</b>召唤另一个萨隆苦囚。",
"[x]<b>Taunt</b>\n<b>Battlecry:</b> Summon another\nSaronite Chain Gang."
],
"cardClass": "NEUTRAL",
"type": "MINION",
"cost": 4,
"rarity": "RARE",
"set": "ICECROWN",
"collectible": true,
"dbfId": 42395
}
_END_TEMPLATE_ */
namespace HREngine.Bots
{
class Sim_ICC_466 : SimTemplate //* Saronite Chain Gang
{
// Taunt Battlecry: Summon another Saronite Chain Gang.
public override void getBattlecryEffect(Playfield p, Minion m, Minion target, int choice)
{
p.callKid(m.handcard.card, m.zonepos, m.own);
}
}
} | 20.942857 | 97 | 0.58663 | [
"MIT"
] | chi-rei-den/Silverfish | cards/ICECROWN/ICC/Sim_ICC_466.cs | 771 | C# |
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Diagnostics.EventFlow.Configuration;
using Microsoft.Diagnostics.EventFlow.Inputs;
using Microsoft.Diagnostics.EventFlow.TestHelpers;
using Moq;
using Xunit;
namespace Microsoft.Diagnostics.EventFlow.Core.Tests
{
public class DiagnosticPipelineTests
{
[Fact]
public void ConstructorShouldRequireHealthReport()
{
ArgumentNullException ex = Assert.Throws<ArgumentNullException>(() =>
{
DiagnosticPipeline pipeline = new DiagnosticPipeline(
null,
new List<TraceInput>(),
null,
new List<EventSink>());
});
Assert.Equal("healthReporter", ex.ParamName);
}
[Fact]
public void ShouldPassOneInputToOneOutput()
{
// Setup
Mock<IHealthReporter> healthReporterMock = new Mock<IHealthReporter>();
Mock<IOutput> mockOutput = new Mock<IOutput>();
DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration()
{
MaxBatchDelayMsec = 10,
PipelineCompletionTimeoutMsec = 5000
};
using (UnitTestInput unitTestInput = new UnitTestInput())
using (DiagnosticPipeline pipeline = new DiagnosticPipeline(
healthReporterMock.Object,
new IObservable<EventData>[] { unitTestInput },
null,
new EventSink[] { new EventSink(mockOutput.Object, null) },
settings))
{
// Execrise
unitTestInput.SendMessage("Test information");
}
// Verify
mockOutput.Verify(o => o.SendEventsAsync(It.Is<IReadOnlyCollection<EventData>>(c => c.Count == 1),
It.IsAny<long>(), It.IsAny<CancellationToken>()), Times.Exactly(1));
}
[Fact]
public void UsableIfBufferOverflowOccurs()
{
Mock<IHealthReporter> healthReporterMock = new Mock<IHealthReporter>();
var deterministicTaskScheduler = new DeterministicTaskScheduler();
UnitTestOutput unitTestOutput = new UnitTestOutput();
DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration()
{
MaxBatchDelayMsec = 10,
PipelineCompletionTimeoutMsec = 5000,
PipelineBufferSize = 1,
MaxConcurrency = 1,
MaxEventBatchSize = 1
};
const int TestBatchSize = 6;
using (UnitTestInput unitTestInput = new UnitTestInput())
using (DiagnosticPipeline pipeline = new DiagnosticPipeline(
healthReporterMock.Object,
new IObservable<EventData>[] { unitTestInput },
null,
new EventSink[] { new EventSink(unitTestOutput, null) },
settings,
disposeDependencies: false,
taskScheduler: deterministicTaskScheduler))
{
// Six events in quick succession will cause a buffer overflow
// (we have a buffer of 1 set for the pipeline, but the pipeline has 3 blocks, so the actual buffer space is 3).
// There should be no ill effects from that on the input--not catching any exceptions.
for (int i = 0; i < TestBatchSize; i++)
{
unitTestInput.SendMessage($"Message {i}");
}
// Wait for the pipeline to drain
deterministicTaskScheduler.RunTasksUntilIdle();
Assert.True(unitTestOutput.CallCount > 0, "At least one message should get to the output");
// We should get a warning about throttling
healthReporterMock.Verify(o => o.ReportWarning(It.IsAny<string>(), It.Is<string>(s => s == EventFlowContextIdentifiers.Throttling)), Times.AtLeastOnce());
// Pipeline should still be usable after this. Let's try to send a message through it.
unitTestOutput.CallCount = 0;
healthReporterMock.ResetCalls();
unitTestInput.SendMessage("Final message");
// Give the pipeline a chance to process the message
deterministicTaskScheduler.RunTasksUntilIdle();
// The message should have come through.
Assert.Equal(1, unitTestOutput.CallCount);
// There should be no new warnings or errors
healthReporterMock.Verify(o => o.ReportWarning(It.IsAny<string>(), It.IsAny<string>()), Times.Never());
healthReporterMock.Verify(o => o.ReportProblem(It.IsAny<string>(), It.IsAny<string>()), Times.Never());
}
}
[Fact]
public void UsableIfExceptionInGlobalFilterOccurs()
{
Mock<IHealthReporter> healthReporterMock = new Mock<IHealthReporter>();
UnitTestOutput unitTestOutput = new UnitTestOutput();
DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration()
{
MaxBatchDelayMsec = 10,
PipelineCompletionTimeoutMsec = 10000,
MaxEventBatchSize = 2
};
UnitTestFilter unitTestFilter = new UnitTestFilter();
unitTestFilter.EvaluationFailureCondition = "Trouble == true";
const int TestBatchSize = 6;
DateTime pipelineDisposalStart;
using (UnitTestInput unitTestInput = new UnitTestInput())
using (DiagnosticPipeline pipeline = new DiagnosticPipeline(
healthReporterMock.Object,
new IObservable<EventData>[] { unitTestInput },
new IFilter[] { unitTestFilter },
new EventSink[] { new EventSink(unitTestOutput, null) },
settings))
{
// Half of the events should cause filtering to fail with an exception
for (int i = 0; i < TestBatchSize; i++)
{
if (i % 2 == 0)
{
unitTestInput.SendData(new Dictionary<string, object> { ["Trouble"] = true });
}
else
{
unitTestInput.SendMessage("Hi!");
}
}
pipelineDisposalStart = DateTime.Now;
}
DateTime pipelineDisposalEnd = DateTime.Now;
// We should have got good events and warnings about bad events
Assert.True(TestBatchSize / 2 == unitTestOutput.EventCount,
$"Events missing: expected: {TestBatchSize / 2}, " +
$"actual: {unitTestOutput.EventCount}, " +
$"filter invocations: {unitTestFilter.CallCount}, " +
$"pipeline disposal time: {(pipelineDisposalEnd - pipelineDisposalStart).TotalMilliseconds} msec");
healthReporterMock.Verify(o => o.ReportWarning(It.IsAny<string>(), It.Is<string>(s => s == EventFlowContextIdentifiers.Filtering)), Times.Exactly(TestBatchSize / 2));
}
[Fact]
public void UsableIfExceptionInOutputSpecificFilterOccurs()
{
Mock<IHealthReporter> healthReporterMock = new Mock<IHealthReporter>();
UnitTestOutput unitTestOutput = new UnitTestOutput();
DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration()
{
MaxBatchDelayMsec = 10,
PipelineCompletionTimeoutMsec = 10000,
MaxEventBatchSize = 2
};
UnitTestFilter unitTestFilter = new UnitTestFilter();
unitTestFilter.EvaluationFailureCondition = "Trouble == true";
const int TestEventCount = 6;
DateTime pipelineDisposalStart;
using (UnitTestInput unitTestInput = new UnitTestInput())
using (DiagnosticPipeline pipeline = new DiagnosticPipeline(
healthReporterMock.Object,
new IObservable<EventData>[] { unitTestInput },
null,
new EventSink[] { new EventSink(unitTestOutput, new IFilter[] { unitTestFilter }) },
settings))
{
// Half of the events should cause filtering to fail with an exception
for (int i = 0; i < TestEventCount; i++)
{
if (i % 2 == 0)
{
unitTestInput.SendData(new Dictionary<string, object> { ["Trouble"] = true });
}
else
{
unitTestInput.SendMessage("Hi!");
}
}
pipelineDisposalStart = DateTime.Now;
}
// We should have got good events and warnings about bad events
DateTime pipelineDisposalEnd = DateTime.Now;
// We should have got good events and warnings about bad events
Assert.True(TestEventCount / 2 == unitTestOutput.EventCount,
$"Events missing: expected: {TestEventCount / 2}, " +
$"actual: {unitTestOutput.EventCount}, " +
$"filter invocations: {unitTestFilter.CallCount}, " +
$"pipeline disposal time: {(pipelineDisposalEnd - pipelineDisposalStart).TotalMilliseconds} msec");
healthReporterMock.Verify(o => o.ReportWarning(It.IsAny<string>(), It.Is<string>(s => s == EventFlowContextIdentifiers.Filtering)), Times.Exactly(TestEventCount / 2));
}
[Fact]
public void CanDisposePipelineStuckInAFilter()
{
Mock<IHealthReporter> healthReporterMock = new Mock<IHealthReporter>();
UnitTestOutput unitTestOutput = new UnitTestOutput();
const int CompletionTimeoutMsec = 5000;
DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration()
{
MaxBatchDelayMsec = 10,
PipelineCompletionTimeoutMsec = CompletionTimeoutMsec,
MaxEventBatchSize = 1,
PipelineBufferSize = 1,
MaxConcurrency = 1
};
UnitTestFilter unitTestFilter = new UnitTestFilter();
unitTestFilter.EvaluationDelay = TimeSpan.MaxValue;
Stopwatch stopwatch;
using (UnitTestInput unitTestInput = new UnitTestInput())
using (DiagnosticPipeline pipeline = new DiagnosticPipeline(
healthReporterMock.Object,
new IObservable<EventData>[] { unitTestInput },
new IFilter[] { unitTestFilter },
new EventSink[] { new EventSink(unitTestOutput, null) },
settings))
{
// Saturate the pipeline
for (int i = 0; i < 10; i++)
{
unitTestInput.SendMessage("Hi!");
}
stopwatch = Stopwatch.StartNew();
}
stopwatch.Stop();
// We should have received no events on the output side--everything should have been stuck in the filter (or dropped because of buffer overflow)
Assert.Equal(0, unitTestOutput.CallCount);
// Ensure the pipeline stops within the timeout (plus some padding)
Assert.InRange(stopwatch.ElapsedMilliseconds, 0, CompletionTimeoutMsec + 200);
}
[Fact]
public void CanDisposePipelineStuckInAnOutput()
{
Mock<IHealthReporter> healthReporterMock = new Mock<IHealthReporter>();
UnitTestOutput unitTestOutput = new UnitTestOutput();
unitTestOutput.SendEventsDelay = TimeSpan.MaxValue;
unitTestOutput.DisregardCancellationToken = true;
const int CompletionTimeoutMsec = 5000;
DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration()
{
MaxBatchDelayMsec = 10,
PipelineCompletionTimeoutMsec = CompletionTimeoutMsec,
MaxEventBatchSize = 1,
PipelineBufferSize = 1,
MaxConcurrency = 1
};
Stopwatch stopwatch;
using (UnitTestInput unitTestInput = new UnitTestInput())
using (DiagnosticPipeline pipeline = new DiagnosticPipeline(
healthReporterMock.Object,
new IObservable<EventData>[] { unitTestInput },
null,
new EventSink[] { new EventSink(unitTestOutput, null) },
settings))
{
// Saturate the pipeline
for (int i = 0; i < 10; i++)
{
unitTestInput.SendMessage("Hi!");
}
stopwatch = Stopwatch.StartNew();
}
stopwatch.Stop();
// We should have received not sent any data successfully
Assert.Equal(0, unitTestOutput.CallCount);
// Ensure the pipeline stops within the timeout (plus some padding)
Assert.InRange(stopwatch.ElapsedMilliseconds, 0, CompletionTimeoutMsec + 200);
}
[Fact]
public void UsableIfExceptionInOutputOccurs()
{
Mock<IHealthReporter> healthReporterMock = new Mock<IHealthReporter>();
UnitTestOutput unitTestOutput = new UnitTestOutput();
unitTestOutput.FailureCondition = (transmissionSequenceNumber) => transmissionSequenceNumber % 2 == 0;
DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration()
{
MaxBatchDelayMsec = 10,
PipelineCompletionTimeoutMsec = 5000,
MaxEventBatchSize = 2
};
const int TestEventCount = 32;
using (UnitTestInput unitTestInput = new UnitTestInput())
using (DiagnosticPipeline pipeline = new DiagnosticPipeline(
healthReporterMock.Object,
new IObservable<EventData>[] { unitTestInput },
null,
new EventSink[] { new EventSink(unitTestOutput, null) },
settings))
{
// Half of the events should cause output to fail with an exception
for (int i = 0; i < TestEventCount; i++)
{
unitTestInput.SendMessage("Hi!");
}
}
// We should have at least TestEventCount / MaxEventBatchSize calls to the output
int expectedMinCallCount = TestEventCount / settings.MaxEventBatchSize;
Assert.InRange(unitTestOutput.CallCount, expectedMinCallCount, TestEventCount);
// Half of these calls (modulo 1) should have failed
healthReporterMock.Verify(o => o.ReportWarning(It.IsAny<string>(), It.Is<string>(s => s == EventFlowContextIdentifiers.Output)),
Times.Between(unitTestOutput.CallCount / 2, unitTestOutput.CallCount / 2 + 1, Moq.Range.Inclusive));
}
[Fact]
public async Task WarnsAboutThrottlingIfOneSinkIsSlow()
{
Mock<IHealthReporter> healthReporterMock = new Mock<IHealthReporter>();
UnitTestOutput fastOutput = new UnitTestOutput();
UnitTestOutput slowOutput = new UnitTestOutput();
slowOutput.SendEventsDelay = TimeSpan.FromMilliseconds(50);
const int InputBufferSize = 10;
const int BurstCount = 100;
DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration()
{
MaxBatchDelayMsec = 10,
PipelineBufferSize = InputBufferSize,
MaxEventBatchSize = 4,
MaxConcurrency = 2,
PipelineCompletionTimeoutMsec = 5000
};
using (UnitTestInput unitTestInput = new UnitTestInput())
using (DiagnosticPipeline pipeline = new DiagnosticPipeline(
healthReporterMock.Object,
new IObservable<EventData>[] { unitTestInput },
null,
new EventSink[] { new EventSink(fastOutput, null), new EventSink(slowOutput, null) },
settings))
{
for (int burst = 0; burst < BurstCount; burst++)
{
// Each burst fills the input buffer
for (int i = 0; i < InputBufferSize; i++)
{
unitTestInput.SendMessage($"{burst}--{i}");
}
// Give the pipeline some time to process events--the fast output will keep up, the slow one, certainly not
bool eventsReceived = await TaskUtils.PollWaitAsync(() => fastOutput.EventCount == (burst+1) * InputBufferSize, TimeSpan.FromSeconds(5));
Assert.True(eventsReceived);
}
// Slow output should have received some, but not all events
Assert.InRange(slowOutput.EventCount, 1, BurstCount * InputBufferSize - 1);
}
healthReporterMock.Verify(o => o.ReportWarning(It.IsAny<string>(), It.Is<string>(s => s == EventFlowContextIdentifiers.Throttling)),
Times.AtLeastOnce());
}
[Fact]
public async Task DoesNotWarnIfNoThrottlingOccurs()
{
Mock<IHealthReporter> healthReporterMock = new Mock<IHealthReporter>();
// Need two outputs to force the pipeline to use the BroadcastBlock.
UnitTestOutput firstOutput = new UnitTestOutput();
UnitTestOutput secondOutput = new UnitTestOutput();
const int InputBufferSize = 100;
DiagnosticPipelineConfiguration settings = new DiagnosticPipelineConfiguration()
{
MaxBatchDelayMsec = 10,
PipelineBufferSize = InputBufferSize,
MaxEventBatchSize = 4,
MaxConcurrency = 2,
PipelineCompletionTimeoutMsec = 5000
};
using (UnitTestInput unitTestInput = new UnitTestInput())
using (DiagnosticPipeline pipeline = new DiagnosticPipeline(
healthReporterMock.Object,
new IObservable<EventData>[] { unitTestInput },
null,
new EventSink[] { new EventSink(firstOutput, null), new EventSink(secondOutput, null) },
settings))
{
for (int i = 0; i < InputBufferSize; i++)
{
unitTestInput.SendMessage(i.ToString());
}
// There should be no problem for both outputs to receive all events
bool eventsReceived = await TaskUtils.PollWaitAsync(() => firstOutput.EventCount == InputBufferSize, TimeSpan.FromMilliseconds(100));
Assert.True(eventsReceived);
eventsReceived = await TaskUtils.PollWaitAsync(() => secondOutput.EventCount == InputBufferSize, TimeSpan.FromMilliseconds(100));
Assert.True(eventsReceived);
}
healthReporterMock.Verify(o => o.ReportWarning(It.IsAny<string>(), It.Is<string>(s => s == EventFlowContextIdentifiers.Throttling)),
Times.Never());
}
}
}
| 44.050661 | 179 | 0.572179 | [
"MIT"
] | Azure/diagnostics-eventflow | test/Microsoft.Diagnostics.EventFlow.Core.Tests/DiagnosticPipelineTests.cs | 20,001 | 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 SheepFinance.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
| 39.518519 | 151 | 0.582006 | [
"MIT"
] | Abel13/SheepFinance | SheepFinance/Properties/Settings.Designer.cs | 1,069 | C# |
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/aiplatform/v1/vizier_service.proto
// </auto-generated>
// Original file comments:
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#pragma warning disable 0414, 1591
#region Designer generated code
using grpc = global::Grpc.Core;
namespace Google.Cloud.AIPlatform.V1 {
/// <summary>
/// Vertex Vizier API.
///
/// Vizier service is a GCP service to solve blackbox optimization problems,
/// such as tuning machine learning hyperparameters and searching over deep
/// learning architectures.
/// </summary>
public static partial class VizierService
{
static readonly string __ServiceName = "google.cloud.aiplatform.v1.VizierService";
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context)
{
#if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION
if (message is global::Google.Protobuf.IBufferMessage)
{
context.SetPayloadLength(message.CalculateSize());
global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter());
context.Complete();
return;
}
#endif
context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message));
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static class __Helper_MessageCache<T>
{
public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T));
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static T __Helper_DeserializeMessage<T>(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser<T> parser) where T : global::Google.Protobuf.IMessage<T>
{
#if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION
if (__Helper_MessageCache<T>.IsBufferMessage)
{
return parser.ParseFrom(context.PayloadAsReadOnlySequence());
}
#endif
return parser.ParseFrom(context.PayloadAsNewBuffer());
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.CreateStudyRequest> __Marshaller_google_cloud_aiplatform_v1_CreateStudyRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.CreateStudyRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.Study> __Marshaller_google_cloud_aiplatform_v1_Study = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.Study.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.GetStudyRequest> __Marshaller_google_cloud_aiplatform_v1_GetStudyRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.GetStudyRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.ListStudiesRequest> __Marshaller_google_cloud_aiplatform_v1_ListStudiesRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.ListStudiesRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.ListStudiesResponse> __Marshaller_google_cloud_aiplatform_v1_ListStudiesResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.ListStudiesResponse.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.DeleteStudyRequest> __Marshaller_google_cloud_aiplatform_v1_DeleteStudyRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.DeleteStudyRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Protobuf.WellKnownTypes.Empty> __Marshaller_google_protobuf_Empty = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Protobuf.WellKnownTypes.Empty.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.LookupStudyRequest> __Marshaller_google_cloud_aiplatform_v1_LookupStudyRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.LookupStudyRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.SuggestTrialsRequest> __Marshaller_google_cloud_aiplatform_v1_SuggestTrialsRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.SuggestTrialsRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.LongRunning.Operation> __Marshaller_google_longrunning_Operation = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.LongRunning.Operation.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.CreateTrialRequest> __Marshaller_google_cloud_aiplatform_v1_CreateTrialRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.CreateTrialRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.Trial> __Marshaller_google_cloud_aiplatform_v1_Trial = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.Trial.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.GetTrialRequest> __Marshaller_google_cloud_aiplatform_v1_GetTrialRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.GetTrialRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.ListTrialsRequest> __Marshaller_google_cloud_aiplatform_v1_ListTrialsRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.ListTrialsRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.ListTrialsResponse> __Marshaller_google_cloud_aiplatform_v1_ListTrialsResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.ListTrialsResponse.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.AddTrialMeasurementRequest> __Marshaller_google_cloud_aiplatform_v1_AddTrialMeasurementRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.AddTrialMeasurementRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.CompleteTrialRequest> __Marshaller_google_cloud_aiplatform_v1_CompleteTrialRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.CompleteTrialRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.DeleteTrialRequest> __Marshaller_google_cloud_aiplatform_v1_DeleteTrialRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.DeleteTrialRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.CheckTrialEarlyStoppingStateRequest> __Marshaller_google_cloud_aiplatform_v1_CheckTrialEarlyStoppingStateRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.CheckTrialEarlyStoppingStateRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.StopTrialRequest> __Marshaller_google_cloud_aiplatform_v1_StopTrialRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.StopTrialRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsRequest> __Marshaller_google_cloud_aiplatform_v1_ListOptimalTrialsRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsResponse> __Marshaller_google_cloud_aiplatform_v1_ListOptimalTrialsResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsResponse.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.CreateStudyRequest, global::Google.Cloud.AIPlatform.V1.Study> __Method_CreateStudy = new grpc::Method<global::Google.Cloud.AIPlatform.V1.CreateStudyRequest, global::Google.Cloud.AIPlatform.V1.Study>(
grpc::MethodType.Unary,
__ServiceName,
"CreateStudy",
__Marshaller_google_cloud_aiplatform_v1_CreateStudyRequest,
__Marshaller_google_cloud_aiplatform_v1_Study);
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.GetStudyRequest, global::Google.Cloud.AIPlatform.V1.Study> __Method_GetStudy = new grpc::Method<global::Google.Cloud.AIPlatform.V1.GetStudyRequest, global::Google.Cloud.AIPlatform.V1.Study>(
grpc::MethodType.Unary,
__ServiceName,
"GetStudy",
__Marshaller_google_cloud_aiplatform_v1_GetStudyRequest,
__Marshaller_google_cloud_aiplatform_v1_Study);
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.ListStudiesRequest, global::Google.Cloud.AIPlatform.V1.ListStudiesResponse> __Method_ListStudies = new grpc::Method<global::Google.Cloud.AIPlatform.V1.ListStudiesRequest, global::Google.Cloud.AIPlatform.V1.ListStudiesResponse>(
grpc::MethodType.Unary,
__ServiceName,
"ListStudies",
__Marshaller_google_cloud_aiplatform_v1_ListStudiesRequest,
__Marshaller_google_cloud_aiplatform_v1_ListStudiesResponse);
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.DeleteStudyRequest, global::Google.Protobuf.WellKnownTypes.Empty> __Method_DeleteStudy = new grpc::Method<global::Google.Cloud.AIPlatform.V1.DeleteStudyRequest, global::Google.Protobuf.WellKnownTypes.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"DeleteStudy",
__Marshaller_google_cloud_aiplatform_v1_DeleteStudyRequest,
__Marshaller_google_protobuf_Empty);
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.LookupStudyRequest, global::Google.Cloud.AIPlatform.V1.Study> __Method_LookupStudy = new grpc::Method<global::Google.Cloud.AIPlatform.V1.LookupStudyRequest, global::Google.Cloud.AIPlatform.V1.Study>(
grpc::MethodType.Unary,
__ServiceName,
"LookupStudy",
__Marshaller_google_cloud_aiplatform_v1_LookupStudyRequest,
__Marshaller_google_cloud_aiplatform_v1_Study);
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.SuggestTrialsRequest, global::Google.LongRunning.Operation> __Method_SuggestTrials = new grpc::Method<global::Google.Cloud.AIPlatform.V1.SuggestTrialsRequest, global::Google.LongRunning.Operation>(
grpc::MethodType.Unary,
__ServiceName,
"SuggestTrials",
__Marshaller_google_cloud_aiplatform_v1_SuggestTrialsRequest,
__Marshaller_google_longrunning_Operation);
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.CreateTrialRequest, global::Google.Cloud.AIPlatform.V1.Trial> __Method_CreateTrial = new grpc::Method<global::Google.Cloud.AIPlatform.V1.CreateTrialRequest, global::Google.Cloud.AIPlatform.V1.Trial>(
grpc::MethodType.Unary,
__ServiceName,
"CreateTrial",
__Marshaller_google_cloud_aiplatform_v1_CreateTrialRequest,
__Marshaller_google_cloud_aiplatform_v1_Trial);
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.GetTrialRequest, global::Google.Cloud.AIPlatform.V1.Trial> __Method_GetTrial = new grpc::Method<global::Google.Cloud.AIPlatform.V1.GetTrialRequest, global::Google.Cloud.AIPlatform.V1.Trial>(
grpc::MethodType.Unary,
__ServiceName,
"GetTrial",
__Marshaller_google_cloud_aiplatform_v1_GetTrialRequest,
__Marshaller_google_cloud_aiplatform_v1_Trial);
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.ListTrialsRequest, global::Google.Cloud.AIPlatform.V1.ListTrialsResponse> __Method_ListTrials = new grpc::Method<global::Google.Cloud.AIPlatform.V1.ListTrialsRequest, global::Google.Cloud.AIPlatform.V1.ListTrialsResponse>(
grpc::MethodType.Unary,
__ServiceName,
"ListTrials",
__Marshaller_google_cloud_aiplatform_v1_ListTrialsRequest,
__Marshaller_google_cloud_aiplatform_v1_ListTrialsResponse);
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.AddTrialMeasurementRequest, global::Google.Cloud.AIPlatform.V1.Trial> __Method_AddTrialMeasurement = new grpc::Method<global::Google.Cloud.AIPlatform.V1.AddTrialMeasurementRequest, global::Google.Cloud.AIPlatform.V1.Trial>(
grpc::MethodType.Unary,
__ServiceName,
"AddTrialMeasurement",
__Marshaller_google_cloud_aiplatform_v1_AddTrialMeasurementRequest,
__Marshaller_google_cloud_aiplatform_v1_Trial);
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.CompleteTrialRequest, global::Google.Cloud.AIPlatform.V1.Trial> __Method_CompleteTrial = new grpc::Method<global::Google.Cloud.AIPlatform.V1.CompleteTrialRequest, global::Google.Cloud.AIPlatform.V1.Trial>(
grpc::MethodType.Unary,
__ServiceName,
"CompleteTrial",
__Marshaller_google_cloud_aiplatform_v1_CompleteTrialRequest,
__Marshaller_google_cloud_aiplatform_v1_Trial);
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.DeleteTrialRequest, global::Google.Protobuf.WellKnownTypes.Empty> __Method_DeleteTrial = new grpc::Method<global::Google.Cloud.AIPlatform.V1.DeleteTrialRequest, global::Google.Protobuf.WellKnownTypes.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"DeleteTrial",
__Marshaller_google_cloud_aiplatform_v1_DeleteTrialRequest,
__Marshaller_google_protobuf_Empty);
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.CheckTrialEarlyStoppingStateRequest, global::Google.LongRunning.Operation> __Method_CheckTrialEarlyStoppingState = new grpc::Method<global::Google.Cloud.AIPlatform.V1.CheckTrialEarlyStoppingStateRequest, global::Google.LongRunning.Operation>(
grpc::MethodType.Unary,
__ServiceName,
"CheckTrialEarlyStoppingState",
__Marshaller_google_cloud_aiplatform_v1_CheckTrialEarlyStoppingStateRequest,
__Marshaller_google_longrunning_Operation);
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.StopTrialRequest, global::Google.Cloud.AIPlatform.V1.Trial> __Method_StopTrial = new grpc::Method<global::Google.Cloud.AIPlatform.V1.StopTrialRequest, global::Google.Cloud.AIPlatform.V1.Trial>(
grpc::MethodType.Unary,
__ServiceName,
"StopTrial",
__Marshaller_google_cloud_aiplatform_v1_StopTrialRequest,
__Marshaller_google_cloud_aiplatform_v1_Trial);
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsRequest, global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsResponse> __Method_ListOptimalTrials = new grpc::Method<global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsRequest, global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsResponse>(
grpc::MethodType.Unary,
__ServiceName,
"ListOptimalTrials",
__Marshaller_google_cloud_aiplatform_v1_ListOptimalTrialsRequest,
__Marshaller_google_cloud_aiplatform_v1_ListOptimalTrialsResponse);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::Google.Cloud.AIPlatform.V1.VizierServiceReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of VizierService</summary>
[grpc::BindServiceMethod(typeof(VizierService), "BindService")]
public abstract partial class VizierServiceBase
{
/// <summary>
/// Creates a Study. A resource name will be generated after creation of the
/// Study.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.AIPlatform.V1.Study> CreateStudy(global::Google.Cloud.AIPlatform.V1.CreateStudyRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Gets a Study by name.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.AIPlatform.V1.Study> GetStudy(global::Google.Cloud.AIPlatform.V1.GetStudyRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Lists all the studies in a region for an associated project.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.AIPlatform.V1.ListStudiesResponse> ListStudies(global::Google.Cloud.AIPlatform.V1.ListStudiesRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Deletes a Study.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Empty> DeleteStudy(global::Google.Cloud.AIPlatform.V1.DeleteStudyRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Looks a study up using the user-defined display_name field instead of the
/// fully qualified resource name.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.AIPlatform.V1.Study> LookupStudy(global::Google.Cloud.AIPlatform.V1.LookupStudyRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Adds one or more Trials to a Study, with parameter values
/// suggested by Vertex Vizier. Returns a long-running
/// operation associated with the generation of Trial suggestions.
/// When this long-running operation succeeds, it will contain
/// a [SuggestTrialsResponse][google.cloud.ml.v1.SuggestTrialsResponse].
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.LongRunning.Operation> SuggestTrials(global::Google.Cloud.AIPlatform.V1.SuggestTrialsRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Adds a user provided Trial to a Study.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.AIPlatform.V1.Trial> CreateTrial(global::Google.Cloud.AIPlatform.V1.CreateTrialRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Gets a Trial.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.AIPlatform.V1.Trial> GetTrial(global::Google.Cloud.AIPlatform.V1.GetTrialRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Lists the Trials associated with a Study.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.AIPlatform.V1.ListTrialsResponse> ListTrials(global::Google.Cloud.AIPlatform.V1.ListTrialsRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Adds a measurement of the objective metrics to a Trial. This measurement
/// is assumed to have been taken before the Trial is complete.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.AIPlatform.V1.Trial> AddTrialMeasurement(global::Google.Cloud.AIPlatform.V1.AddTrialMeasurementRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Marks a Trial as complete.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.AIPlatform.V1.Trial> CompleteTrial(global::Google.Cloud.AIPlatform.V1.CompleteTrialRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Deletes a Trial.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Empty> DeleteTrial(global::Google.Cloud.AIPlatform.V1.DeleteTrialRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Checks whether a Trial should stop or not. Returns a
/// long-running operation. When the operation is successful,
/// it will contain a
/// [CheckTrialEarlyStoppingStateResponse][google.cloud.ml.v1.CheckTrialEarlyStoppingStateResponse].
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.LongRunning.Operation> CheckTrialEarlyStoppingState(global::Google.Cloud.AIPlatform.V1.CheckTrialEarlyStoppingStateRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Stops a Trial.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.AIPlatform.V1.Trial> StopTrial(global::Google.Cloud.AIPlatform.V1.StopTrialRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Lists the pareto-optimal Trials for multi-objective Study or the
/// optimal Trials for single-objective Study. The definition of
/// pareto-optimal can be checked in wiki page.
/// https://en.wikipedia.org/wiki/Pareto_efficiency
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsResponse> ListOptimalTrials(global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for VizierService</summary>
public partial class VizierServiceClient : grpc::ClientBase<VizierServiceClient>
{
/// <summary>Creates a new client for VizierService</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public VizierServiceClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for VizierService that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public VizierServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
protected VizierServiceClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
protected VizierServiceClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
/// <summary>
/// Creates a Study. A resource name will be generated after creation of the
/// Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Study CreateStudy(global::Google.Cloud.AIPlatform.V1.CreateStudyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return CreateStudy(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Creates a Study. A resource name will be generated after creation of the
/// Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Study CreateStudy(global::Google.Cloud.AIPlatform.V1.CreateStudyRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_CreateStudy, null, options, request);
}
/// <summary>
/// Creates a Study. A resource name will be generated after creation of the
/// Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Study> CreateStudyAsync(global::Google.Cloud.AIPlatform.V1.CreateStudyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return CreateStudyAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Creates a Study. A resource name will be generated after creation of the
/// Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Study> CreateStudyAsync(global::Google.Cloud.AIPlatform.V1.CreateStudyRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_CreateStudy, null, options, request);
}
/// <summary>
/// Gets a Study by name.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Study GetStudy(global::Google.Cloud.AIPlatform.V1.GetStudyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return GetStudy(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Gets a Study by name.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Study GetStudy(global::Google.Cloud.AIPlatform.V1.GetStudyRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_GetStudy, null, options, request);
}
/// <summary>
/// Gets a Study by name.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Study> GetStudyAsync(global::Google.Cloud.AIPlatform.V1.GetStudyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return GetStudyAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Gets a Study by name.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Study> GetStudyAsync(global::Google.Cloud.AIPlatform.V1.GetStudyRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_GetStudy, null, options, request);
}
/// <summary>
/// Lists all the studies in a region for an associated project.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.ListStudiesResponse ListStudies(global::Google.Cloud.AIPlatform.V1.ListStudiesRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return ListStudies(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Lists all the studies in a region for an associated project.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.ListStudiesResponse ListStudies(global::Google.Cloud.AIPlatform.V1.ListStudiesRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_ListStudies, null, options, request);
}
/// <summary>
/// Lists all the studies in a region for an associated project.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.ListStudiesResponse> ListStudiesAsync(global::Google.Cloud.AIPlatform.V1.ListStudiesRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return ListStudiesAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Lists all the studies in a region for an associated project.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.ListStudiesResponse> ListStudiesAsync(global::Google.Cloud.AIPlatform.V1.ListStudiesRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_ListStudies, null, options, request);
}
/// <summary>
/// Deletes a Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Protobuf.WellKnownTypes.Empty DeleteStudy(global::Google.Cloud.AIPlatform.V1.DeleteStudyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return DeleteStudy(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Deletes a Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Protobuf.WellKnownTypes.Empty DeleteStudy(global::Google.Cloud.AIPlatform.V1.DeleteStudyRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_DeleteStudy, null, options, request);
}
/// <summary>
/// Deletes a Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteStudyAsync(global::Google.Cloud.AIPlatform.V1.DeleteStudyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return DeleteStudyAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Deletes a Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteStudyAsync(global::Google.Cloud.AIPlatform.V1.DeleteStudyRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_DeleteStudy, null, options, request);
}
/// <summary>
/// Looks a study up using the user-defined display_name field instead of the
/// fully qualified resource name.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Study LookupStudy(global::Google.Cloud.AIPlatform.V1.LookupStudyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return LookupStudy(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Looks a study up using the user-defined display_name field instead of the
/// fully qualified resource name.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Study LookupStudy(global::Google.Cloud.AIPlatform.V1.LookupStudyRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_LookupStudy, null, options, request);
}
/// <summary>
/// Looks a study up using the user-defined display_name field instead of the
/// fully qualified resource name.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Study> LookupStudyAsync(global::Google.Cloud.AIPlatform.V1.LookupStudyRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return LookupStudyAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Looks a study up using the user-defined display_name field instead of the
/// fully qualified resource name.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Study> LookupStudyAsync(global::Google.Cloud.AIPlatform.V1.LookupStudyRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_LookupStudy, null, options, request);
}
/// <summary>
/// Adds one or more Trials to a Study, with parameter values
/// suggested by Vertex Vizier. Returns a long-running
/// operation associated with the generation of Trial suggestions.
/// When this long-running operation succeeds, it will contain
/// a [SuggestTrialsResponse][google.cloud.ml.v1.SuggestTrialsResponse].
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.LongRunning.Operation SuggestTrials(global::Google.Cloud.AIPlatform.V1.SuggestTrialsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return SuggestTrials(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Adds one or more Trials to a Study, with parameter values
/// suggested by Vertex Vizier. Returns a long-running
/// operation associated with the generation of Trial suggestions.
/// When this long-running operation succeeds, it will contain
/// a [SuggestTrialsResponse][google.cloud.ml.v1.SuggestTrialsResponse].
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.LongRunning.Operation SuggestTrials(global::Google.Cloud.AIPlatform.V1.SuggestTrialsRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_SuggestTrials, null, options, request);
}
/// <summary>
/// Adds one or more Trials to a Study, with parameter values
/// suggested by Vertex Vizier. Returns a long-running
/// operation associated with the generation of Trial suggestions.
/// When this long-running operation succeeds, it will contain
/// a [SuggestTrialsResponse][google.cloud.ml.v1.SuggestTrialsResponse].
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.LongRunning.Operation> SuggestTrialsAsync(global::Google.Cloud.AIPlatform.V1.SuggestTrialsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return SuggestTrialsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Adds one or more Trials to a Study, with parameter values
/// suggested by Vertex Vizier. Returns a long-running
/// operation associated with the generation of Trial suggestions.
/// When this long-running operation succeeds, it will contain
/// a [SuggestTrialsResponse][google.cloud.ml.v1.SuggestTrialsResponse].
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.LongRunning.Operation> SuggestTrialsAsync(global::Google.Cloud.AIPlatform.V1.SuggestTrialsRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_SuggestTrials, null, options, request);
}
/// <summary>
/// Adds a user provided Trial to a Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Trial CreateTrial(global::Google.Cloud.AIPlatform.V1.CreateTrialRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return CreateTrial(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Adds a user provided Trial to a Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Trial CreateTrial(global::Google.Cloud.AIPlatform.V1.CreateTrialRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_CreateTrial, null, options, request);
}
/// <summary>
/// Adds a user provided Trial to a Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Trial> CreateTrialAsync(global::Google.Cloud.AIPlatform.V1.CreateTrialRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return CreateTrialAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Adds a user provided Trial to a Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Trial> CreateTrialAsync(global::Google.Cloud.AIPlatform.V1.CreateTrialRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_CreateTrial, null, options, request);
}
/// <summary>
/// Gets a Trial.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Trial GetTrial(global::Google.Cloud.AIPlatform.V1.GetTrialRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return GetTrial(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Gets a Trial.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Trial GetTrial(global::Google.Cloud.AIPlatform.V1.GetTrialRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_GetTrial, null, options, request);
}
/// <summary>
/// Gets a Trial.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Trial> GetTrialAsync(global::Google.Cloud.AIPlatform.V1.GetTrialRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return GetTrialAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Gets a Trial.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Trial> GetTrialAsync(global::Google.Cloud.AIPlatform.V1.GetTrialRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_GetTrial, null, options, request);
}
/// <summary>
/// Lists the Trials associated with a Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.ListTrialsResponse ListTrials(global::Google.Cloud.AIPlatform.V1.ListTrialsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return ListTrials(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Lists the Trials associated with a Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.ListTrialsResponse ListTrials(global::Google.Cloud.AIPlatform.V1.ListTrialsRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_ListTrials, null, options, request);
}
/// <summary>
/// Lists the Trials associated with a Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.ListTrialsResponse> ListTrialsAsync(global::Google.Cloud.AIPlatform.V1.ListTrialsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return ListTrialsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Lists the Trials associated with a Study.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.ListTrialsResponse> ListTrialsAsync(global::Google.Cloud.AIPlatform.V1.ListTrialsRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_ListTrials, null, options, request);
}
/// <summary>
/// Adds a measurement of the objective metrics to a Trial. This measurement
/// is assumed to have been taken before the Trial is complete.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Trial AddTrialMeasurement(global::Google.Cloud.AIPlatform.V1.AddTrialMeasurementRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return AddTrialMeasurement(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Adds a measurement of the objective metrics to a Trial. This measurement
/// is assumed to have been taken before the Trial is complete.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Trial AddTrialMeasurement(global::Google.Cloud.AIPlatform.V1.AddTrialMeasurementRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_AddTrialMeasurement, null, options, request);
}
/// <summary>
/// Adds a measurement of the objective metrics to a Trial. This measurement
/// is assumed to have been taken before the Trial is complete.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Trial> AddTrialMeasurementAsync(global::Google.Cloud.AIPlatform.V1.AddTrialMeasurementRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return AddTrialMeasurementAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Adds a measurement of the objective metrics to a Trial. This measurement
/// is assumed to have been taken before the Trial is complete.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Trial> AddTrialMeasurementAsync(global::Google.Cloud.AIPlatform.V1.AddTrialMeasurementRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_AddTrialMeasurement, null, options, request);
}
/// <summary>
/// Marks a Trial as complete.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Trial CompleteTrial(global::Google.Cloud.AIPlatform.V1.CompleteTrialRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return CompleteTrial(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Marks a Trial as complete.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Trial CompleteTrial(global::Google.Cloud.AIPlatform.V1.CompleteTrialRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_CompleteTrial, null, options, request);
}
/// <summary>
/// Marks a Trial as complete.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Trial> CompleteTrialAsync(global::Google.Cloud.AIPlatform.V1.CompleteTrialRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return CompleteTrialAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Marks a Trial as complete.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Trial> CompleteTrialAsync(global::Google.Cloud.AIPlatform.V1.CompleteTrialRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_CompleteTrial, null, options, request);
}
/// <summary>
/// Deletes a Trial.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Protobuf.WellKnownTypes.Empty DeleteTrial(global::Google.Cloud.AIPlatform.V1.DeleteTrialRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return DeleteTrial(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Deletes a Trial.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Protobuf.WellKnownTypes.Empty DeleteTrial(global::Google.Cloud.AIPlatform.V1.DeleteTrialRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_DeleteTrial, null, options, request);
}
/// <summary>
/// Deletes a Trial.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteTrialAsync(global::Google.Cloud.AIPlatform.V1.DeleteTrialRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return DeleteTrialAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Deletes a Trial.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteTrialAsync(global::Google.Cloud.AIPlatform.V1.DeleteTrialRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_DeleteTrial, null, options, request);
}
/// <summary>
/// Checks whether a Trial should stop or not. Returns a
/// long-running operation. When the operation is successful,
/// it will contain a
/// [CheckTrialEarlyStoppingStateResponse][google.cloud.ml.v1.CheckTrialEarlyStoppingStateResponse].
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.LongRunning.Operation CheckTrialEarlyStoppingState(global::Google.Cloud.AIPlatform.V1.CheckTrialEarlyStoppingStateRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return CheckTrialEarlyStoppingState(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Checks whether a Trial should stop or not. Returns a
/// long-running operation. When the operation is successful,
/// it will contain a
/// [CheckTrialEarlyStoppingStateResponse][google.cloud.ml.v1.CheckTrialEarlyStoppingStateResponse].
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.LongRunning.Operation CheckTrialEarlyStoppingState(global::Google.Cloud.AIPlatform.V1.CheckTrialEarlyStoppingStateRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_CheckTrialEarlyStoppingState, null, options, request);
}
/// <summary>
/// Checks whether a Trial should stop or not. Returns a
/// long-running operation. When the operation is successful,
/// it will contain a
/// [CheckTrialEarlyStoppingStateResponse][google.cloud.ml.v1.CheckTrialEarlyStoppingStateResponse].
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.LongRunning.Operation> CheckTrialEarlyStoppingStateAsync(global::Google.Cloud.AIPlatform.V1.CheckTrialEarlyStoppingStateRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return CheckTrialEarlyStoppingStateAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Checks whether a Trial should stop or not. Returns a
/// long-running operation. When the operation is successful,
/// it will contain a
/// [CheckTrialEarlyStoppingStateResponse][google.cloud.ml.v1.CheckTrialEarlyStoppingStateResponse].
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.LongRunning.Operation> CheckTrialEarlyStoppingStateAsync(global::Google.Cloud.AIPlatform.V1.CheckTrialEarlyStoppingStateRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_CheckTrialEarlyStoppingState, null, options, request);
}
/// <summary>
/// Stops a Trial.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Trial StopTrial(global::Google.Cloud.AIPlatform.V1.StopTrialRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return StopTrial(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Stops a Trial.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.Trial StopTrial(global::Google.Cloud.AIPlatform.V1.StopTrialRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_StopTrial, null, options, request);
}
/// <summary>
/// Stops a Trial.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Trial> StopTrialAsync(global::Google.Cloud.AIPlatform.V1.StopTrialRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return StopTrialAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Stops a Trial.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.Trial> StopTrialAsync(global::Google.Cloud.AIPlatform.V1.StopTrialRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_StopTrial, null, options, request);
}
/// <summary>
/// Lists the pareto-optimal Trials for multi-objective Study or the
/// optimal Trials for single-objective Study. The definition of
/// pareto-optimal can be checked in wiki page.
/// https://en.wikipedia.org/wiki/Pareto_efficiency
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsResponse ListOptimalTrials(global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return ListOptimalTrials(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Lists the pareto-optimal Trials for multi-objective Study or the
/// optimal Trials for single-objective Study. The definition of
/// pareto-optimal can be checked in wiki page.
/// https://en.wikipedia.org/wiki/Pareto_efficiency
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsResponse ListOptimalTrials(global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_ListOptimalTrials, null, options, request);
}
/// <summary>
/// Lists the pareto-optimal Trials for multi-objective Study or the
/// optimal Trials for single-objective Study. The definition of
/// pareto-optimal can be checked in wiki page.
/// https://en.wikipedia.org/wiki/Pareto_efficiency
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsResponse> ListOptimalTrialsAsync(global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return ListOptimalTrialsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Lists the pareto-optimal Trials for multi-objective Study or the
/// optimal Trials for single-objective Study. The definition of
/// pareto-optimal can be checked in wiki page.
/// https://en.wikipedia.org/wiki/Pareto_efficiency
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsResponse> ListOptimalTrialsAsync(global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_ListOptimalTrials, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
protected override VizierServiceClient NewInstance(ClientBaseConfiguration configuration)
{
return new VizierServiceClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public static grpc::ServerServiceDefinition BindService(VizierServiceBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_CreateStudy, serviceImpl.CreateStudy)
.AddMethod(__Method_GetStudy, serviceImpl.GetStudy)
.AddMethod(__Method_ListStudies, serviceImpl.ListStudies)
.AddMethod(__Method_DeleteStudy, serviceImpl.DeleteStudy)
.AddMethod(__Method_LookupStudy, serviceImpl.LookupStudy)
.AddMethod(__Method_SuggestTrials, serviceImpl.SuggestTrials)
.AddMethod(__Method_CreateTrial, serviceImpl.CreateTrial)
.AddMethod(__Method_GetTrial, serviceImpl.GetTrial)
.AddMethod(__Method_ListTrials, serviceImpl.ListTrials)
.AddMethod(__Method_AddTrialMeasurement, serviceImpl.AddTrialMeasurement)
.AddMethod(__Method_CompleteTrial, serviceImpl.CompleteTrial)
.AddMethod(__Method_DeleteTrial, serviceImpl.DeleteTrial)
.AddMethod(__Method_CheckTrialEarlyStoppingState, serviceImpl.CheckTrialEarlyStoppingState)
.AddMethod(__Method_StopTrial, serviceImpl.StopTrial)
.AddMethod(__Method_ListOptimalTrials, serviceImpl.ListOptimalTrials).Build();
}
/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public static void BindService(grpc::ServiceBinderBase serviceBinder, VizierServiceBase serviceImpl)
{
serviceBinder.AddMethod(__Method_CreateStudy, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.CreateStudyRequest, global::Google.Cloud.AIPlatform.V1.Study>(serviceImpl.CreateStudy));
serviceBinder.AddMethod(__Method_GetStudy, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.GetStudyRequest, global::Google.Cloud.AIPlatform.V1.Study>(serviceImpl.GetStudy));
serviceBinder.AddMethod(__Method_ListStudies, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.ListStudiesRequest, global::Google.Cloud.AIPlatform.V1.ListStudiesResponse>(serviceImpl.ListStudies));
serviceBinder.AddMethod(__Method_DeleteStudy, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.DeleteStudyRequest, global::Google.Protobuf.WellKnownTypes.Empty>(serviceImpl.DeleteStudy));
serviceBinder.AddMethod(__Method_LookupStudy, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.LookupStudyRequest, global::Google.Cloud.AIPlatform.V1.Study>(serviceImpl.LookupStudy));
serviceBinder.AddMethod(__Method_SuggestTrials, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.SuggestTrialsRequest, global::Google.LongRunning.Operation>(serviceImpl.SuggestTrials));
serviceBinder.AddMethod(__Method_CreateTrial, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.CreateTrialRequest, global::Google.Cloud.AIPlatform.V1.Trial>(serviceImpl.CreateTrial));
serviceBinder.AddMethod(__Method_GetTrial, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.GetTrialRequest, global::Google.Cloud.AIPlatform.V1.Trial>(serviceImpl.GetTrial));
serviceBinder.AddMethod(__Method_ListTrials, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.ListTrialsRequest, global::Google.Cloud.AIPlatform.V1.ListTrialsResponse>(serviceImpl.ListTrials));
serviceBinder.AddMethod(__Method_AddTrialMeasurement, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.AddTrialMeasurementRequest, global::Google.Cloud.AIPlatform.V1.Trial>(serviceImpl.AddTrialMeasurement));
serviceBinder.AddMethod(__Method_CompleteTrial, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.CompleteTrialRequest, global::Google.Cloud.AIPlatform.V1.Trial>(serviceImpl.CompleteTrial));
serviceBinder.AddMethod(__Method_DeleteTrial, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.DeleteTrialRequest, global::Google.Protobuf.WellKnownTypes.Empty>(serviceImpl.DeleteTrial));
serviceBinder.AddMethod(__Method_CheckTrialEarlyStoppingState, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.CheckTrialEarlyStoppingStateRequest, global::Google.LongRunning.Operation>(serviceImpl.CheckTrialEarlyStoppingState));
serviceBinder.AddMethod(__Method_StopTrial, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.StopTrialRequest, global::Google.Cloud.AIPlatform.V1.Trial>(serviceImpl.StopTrial));
serviceBinder.AddMethod(__Method_ListOptimalTrials, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsRequest, global::Google.Cloud.AIPlatform.V1.ListOptimalTrialsResponse>(serviceImpl.ListOptimalTrials));
}
}
}
#endregion
| 74.448728 | 384 | 0.730882 | [
"Apache-2.0"
] | Mattlk13/google-cloud-dotnet | apis/Google.Cloud.AIPlatform.V1/Google.Cloud.AIPlatform.V1/VizierServiceGrpc.g.cs | 96,560 | 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 Cake.Common.Tests.Fixtures.Tools;
using Xunit;
namespace Cake.Common.Tests.Unit.Tools.OctopusDeploy
{
public sealed class OctoDeployPromoteTests
{
private const string MinimalParameters = "promote-release --project=\"MyProject\" --from=\"Testing\" --to=\"Staging\" --server http://octopus --apiKey API-12345";
public sealed class TheBaseArgumentBuilder
{
[Fact]
public void Should_Throw_If_Server_Is_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Server = null;
// When
var result = Record.Exception(() => fixture.Run());
// Then
AssertEx.IsArgumentNullException(result, "server");
}
[Fact]
public void Should_Throw_If_Api_Key_Is_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.ApiKey = null;
// When
var result = Record.Exception(() => fixture.Run());
// Then
AssertEx.IsArgumentNullException(result, "apiKey");
}
[Fact]
public void Should_Throw_If_ProjectName_Is_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Project = null;
// When
var result = Record.Exception(() => fixture.Run());
// Then
AssertEx.IsArgumentNullException(result, "projectName");
}
[Fact]
public void Should_Throw_If_DeployFrom_Is_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.DeployFrom = null;
// When
var result = Record.Exception(() => fixture.Run());
// Then
AssertEx.IsArgumentNullException(result, "deployFrom");
}
[Fact]
public void Should_Throw_If_DeployTo_Is_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.DeployTo = null;
// When
var result = Record.Exception(() => fixture.Run());
// Then
AssertEx.IsArgumentNullException(result, "deployTo");
}
[Fact]
public void Should_Throw_If_Settings_Is_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings = null;
// When
var result = Record.Exception(() => fixture.Run());
// Then
AssertEx.IsArgumentNullException(result, "settings");
}
[Fact]
public void Should_Give_Default_Minimal_Parameters()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters, result.Args);
}
[Fact]
public void Should_Add_Username_To_Arguments_If_Not_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.Username = "mike123";
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --user \"mike123\"", result.Args);
}
[Fact]
public void Should_Add_Password_To_Arguments_If_Not_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.Password = "secret";
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --pass \"secret\"", result.Args);
}
[Fact]
public void Should_Add_Configuration_File_To_Arguments_If_Not_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.ConfigurationFile = "configFile.txt";
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --configFile \"/Working/configFile.txt\"", result.Args);
}
[Fact]
public void Should_Add_Debug_Flag_To_Arguments_If_Not_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.EnableDebugLogging = true;
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --debug", result.Args);
}
[Fact]
public void Should_Add_Ignore_Ssl_Errors_Flag_To_Arguments_If_Not_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.IgnoreSslErrors = true;
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --ignoreSslErrors", result.Args);
}
[Fact]
public void Should_Add_Enable_Service_Messages_Flag_To_Arguments_If_Not_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.EnableServiceMessages = true;
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --enableServiceMessages", result.Args);
}
}
public sealed class DeploymentArgumentBuilder
{
[Fact]
public void Should_Add_Progress_To_Arguments_If_Specified()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.ShowProgress = true;
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --progress", result.Args);
}
[Fact]
public void Should_Add_FocePackageDownload_To_Arguments_If_Specified()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.ForcePackageDownload = true;
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --forcepackagedownload", result.Args);
}
[Fact]
public void Should_Add_WaitForDeployment_To_Arguments_If_Specified()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.WaitForDeployment = true;
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --waitfordeployment", result.Args);
}
[Fact]
public void Should_Add_DeploymentTimeout_To_Arguments_If_Not_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.DeploymentTimeout = TimeSpan.FromMinutes(1);
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --deploymenttimeout=\"00:01:00\"", result.Args);
}
[Fact]
public void Should_Add_CancelTimeout_To_Arguments_If_Specified()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.CancelOnTimeout = true;
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --cancelontimeout", result.Args);
}
[Fact]
public void Should_Add_DeploymentChecksLeepCycle_To_Arguments_If_Not_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.DeploymentChecksLeepCycle = TimeSpan.FromMinutes(77);
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --deploymentchecksleepcycle=\"01:17:00\"", result.Args);
}
[Fact]
public void Should_Add_GuidedFailure_To_Arguments_If_True()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.GuidedFailure = true;
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --guidedfailure=True", result.Args);
}
[Fact]
public void Should_Add_GuidedFailure_To_Arguments_If_False()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.GuidedFailure = true;
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --guidedfailure=True", result.Args);
}
[Fact]
public void Should_Add_SpecificMachines_To_Arguments_If_NotNull()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.SpecificMachines = new string[] { "Machine1", "Machine2" };
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --specificmachines=\"Machine1,Machine2\"", result.Args);
}
[Fact]
public void Should_Add_Force_To_Arguments_If_Specified()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.Force = true;
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --force", result.Args);
}
[Fact]
public void Should_Add_SkipSteps_To_Arguments_If_Specified()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.SkipSteps = new[] { "Step1", "Step2" };
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --skip=\"Step1\" --skip=\"Step2\"", result.Args);
}
[Fact]
public void Should_Add_NoRawLog_To_Arguments_If_Specified()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.NoRawLog = true;
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --norawlog", result.Args);
}
[Fact]
public void Should_Add_RawLogFile_To_Arguments_If_Not_Null()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.RawLogFile = "someFile.txt";
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --rawlogfile \"/Working/someFile.txt\"", result.Args);
}
[Fact]
public void Should_Add_Variables_To_Arguments_If_Specified()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.Variables.Add("var1", "value1");
fixture.Settings.Variables.Add("var2", "value2");
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters +
" --variable=\"var1:value1\"" +
" --variable=\"var2:value2\"", result.Args);
}
[Fact]
public void Should_Add_DeployAt_To_Arguments_If_Specified()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.DeployAt = new DateTime(2010, 6, 15).AddMinutes(1);
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters + " --deployat=\"2010-06-15 00:01\"", result.Args);
}
[Fact]
public void Should_Add_Tenants_To_Arguments_If_Specified()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.Tenant = new[] { "Tenant1", "Tenant2" };
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters +
" --tenant=\"Tenant1\"" +
" --tenant=\"Tenant2\"", result.Args);
}
[Fact]
public void Should_Add_TenantTags_To_Arguments_If_Specified()
{
// Given
var fixture = new OctopusDeployReleasePromoterFixture();
fixture.Settings.TenantTags = new[] { "Tag1", "Tag2" };
// When
var result = fixture.Run();
// Then
Assert.Equal(MinimalParameters +
" --tenanttag=\"Tag1\"" +
" --tenanttag=\"Tag2\"", result.Args);
}
}
}
}
| 33.154018 | 170 | 0.498956 | [
"MIT"
] | DeveloperGuo/cake | src/Cake.Common.Tests/Unit/Tools/OctopusDeploy/OctoDeployPromoteTests.cs | 14,855 | C# |
using UnityEngine;
namespace Assets.Scripts {
public class StartScreen : MonoBehaviour {
//private GameObject flappyTextGo;
//private GameObject birdTextGo;
private const float FLAPPY_TEXT_WIDTH = 0.56f;
private const float BIRD_TEXT_WIDTH = 0.38f;
private const float WORD_GAP = 0.01f;
// Use this for initialization
void Start () {
//GameObject[] childObjects = GetComponentsInChildren<GameObject>();
//flappyTextGo = GameObject.Find("FlappyText");
//birdTextGo = GameObject.Find("BirdText");
//center title to the screen
Vector3 pos = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width / 2f, Screen.height * 0.75f, Camera.main.nearClipPlane));
transform.position = pos;
//pos.x -= (FLAPPY_TEXT_WIDTH / 2f) - WORD_GAP;
//flappyTextGo.transform.position = pos;
//pos.x = (pos.x + (FLAPPY_TEXT_WIDTH / 2f) + (BIRD_TEXT_WIDTH / 2f)) + WORD_GAP;
//birdTextGo.transform.position = pos;
}
// Update is called once per frame
void Update()
{
//this is the only way to detect mouse click on child objects
//http://gamedev.stackexchange.com/a/82947
if (Input.GetMouseButtonUp(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit2D hit = Physics2D.Raycast(ray.origin, ray.direction, Mathf.Infinity);
if (hit && "StartButton".Equals(hit.collider.gameObject.name))
{
Application.LoadLevel("ReadyScene");
}
}
}
}
}
| 30.020833 | 130 | 0.699514 | [
"Unlicense"
] | rosdi/flappybird | Assets/Scripts/StartScreen.cs | 1,443 | C# |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using RulesEngine.HelperFunctions;
using RulesEngine.Interfaces;
using RulesEngine.Models;
using RulesEngine.Validators;
using RulesEngine.Exceptions;
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using FluentValidation;
namespace RulesEngine
{
public class RulesEngine : IRulesEngine
{
#region Variables
private readonly ILogger _logger;
private readonly ReSettings _reSettings;
private readonly RulesCache _rulesCache = new RulesCache();
#endregion
#region Constructor
public RulesEngine(string[] jsonConfig, ILogger logger, ReSettings reSettings = null) : this(logger, reSettings)
{
var workflowRules = jsonConfig.Select(item => JsonConvert.DeserializeObject<WorkflowRules>(item)).ToArray();
AddWorkflow(workflowRules);
}
public RulesEngine(WorkflowRules[] workflowRules, ILogger logger, ReSettings reSettings = null) : this(logger, reSettings)
{
AddWorkflow(workflowRules);
}
public RulesEngine(ILogger logger, ReSettings reSettings = null)
{
_logger = logger ?? new NullLogger();
_reSettings = reSettings ?? new ReSettings();
}
#endregion
#region Public Methods
/// <summary>
/// This will execute all the rules of the specified workflow
/// </summary>
/// <typeparam name="T">type of input</typeparam>
/// <param name="input">input</param>
/// <param name="workflowName">Workflow Name</param>
/// <returns>List of Result</returns>
public List<RuleResultTree> ExecuteRule(string workflowName, IEnumerable<dynamic> input, object[] otherInputs)
{
_logger.LogTrace($"Called ExecuteRule for workflow {workflowName} and count of input {input.Count()}");
var result = new List<RuleResultTree>();
foreach (var item in input)
{
var ruleInputs = new List<object>();
ruleInputs.Add(item);
if (otherInputs != null)
ruleInputs.AddRange(otherInputs);
result.AddRange(ExecuteRule(workflowName, ruleInputs.ToArray()));
}
return result;
}
public List<RuleResultTree> ExecuteRule(string workflowName, object[] inputs)
{
var ruleParams = new List<RuleParameter>();
for (int i = 0; i < inputs.Length; i++)
{
var input = inputs[i];
var obj = Utils.GetTypedObject(input);
ruleParams.Add(new RuleParameter($"input{i + 1}", obj));
}
return ExecuteRule(workflowName, ruleParams.ToArray());
}
public List<RuleResultTree> ExecuteRule(string workflowName, object input)
{
var inputs = new[] { input };
return ExecuteRule(workflowName, inputs);
}
public List<RuleResultTree> ExecuteRule(string workflowName, RuleParameter[] ruleParams)
{
return ValidateWorkflowAndExecuteRule(workflowName, ruleParams);
}
#endregion
#region Private Methods
public void AddWorkflow(params WorkflowRules[] workflowRules)
{
try
{
foreach (var workflowRule in workflowRules)
{
var validator = new WorkflowRulesValidator();
validator.ValidateAndThrow(workflowRule);
_rulesCache.AddOrUpdateWorkflowRules(workflowRule.WorkflowName, workflowRule);
}
}
catch (ValidationException ex)
{
throw new RuleValidationException(ex.Message, ex.Errors);
}
}
public void ClearWorkflows()
{
_rulesCache.Clear();
}
public void RemoveWorkflow(params string[] workflowNames)
{
foreach (var workflowName in workflowNames)
{
_rulesCache.Remove(workflowName);
}
}
/// <summary>
/// This will validate workflow rules then call execute method
/// </summary>
/// <typeparam name="T">type of entity</typeparam>
/// <param name="input">input</param>
/// <param name="workflowName">workflow name</param>
/// <returns>list of rule result set</returns>
private List<RuleResultTree> ValidateWorkflowAndExecuteRule(string workflowName, RuleParameter[] ruleParams)
{
List<RuleResultTree> result;
if (RegisterRule(workflowName, ruleParams))
{
result = ExecuteRuleByWorkflow(workflowName, ruleParams);
}
else
{
_logger.LogTrace($"Rule config file is not present for the {workflowName} workflow");
// if rules are not registered with Rules Engine
throw new ArgumentException($"Rule config file is not present for the {workflowName} workflow");
}
return result;
}
/// <summary>
/// This will compile the rules and store them to dictionary
/// </summary>
/// <typeparam name="T">type of entity</typeparam>
/// <param name="workflowName">workflow name</param>
/// <returns>bool result</returns>
private bool RegisterRule(string workflowName, params RuleParameter[] ruleParams)
{
string compileRulesKey = GetCompileRulesKey(workflowName, ruleParams);
if (_rulesCache.ContainsCompiledRules(compileRulesKey))
return true;
var workflowRules = _rulesCache.GetWorkFlowRules(workflowName);
if (workflowRules != null)
{
var lstFunc = new List<Delegate>();
foreach (var rule in _rulesCache.GetRules(workflowName))
{
RuleCompiler ruleCompiler = new RuleCompiler(new RuleExpressionBuilderFactory(_reSettings), _logger);
lstFunc.Add(ruleCompiler.CompileRule(rule, ruleParams));
}
_rulesCache.AddOrUpdateCompiledRule(compileRulesKey, new CompiledRule() { CompiledRules = lstFunc });
_logger.LogTrace($"Rules has been compiled for the {workflowName} workflow and added to dictionary");
return true;
}
else
{
return false;
}
}
private static string GetCompileRulesKey(string workflowName, RuleParameter[] ruleParams)
{
return $"{workflowName}-" + String.Join("-", ruleParams.Select(c => c.Type.Name));
}
/// <summary>
/// This will execute the compiled rules
/// </summary>
/// <param name="workflowName"></param>
/// <param name="ruleParams"></param>
/// <returns>list of rule result set</returns>
private List<RuleResultTree> ExecuteRuleByWorkflow(string workflowName, RuleParameter[] ruleParams)
{
_logger.LogTrace($"Compiled rules found for {workflowName} workflow and executed");
List<RuleResultTree> result = new List<RuleResultTree>();
var compileRulesKey = GetCompileRulesKey(workflowName, ruleParams);
var inputs = ruleParams.Select(c => c.Value);
foreach (var compiledRule in _rulesCache.GetCompiledRules(compileRulesKey).CompiledRules)
{
result.Add(compiledRule.DynamicInvoke(new List<object>(inputs) { new RuleInput() }.ToArray()) as RuleResultTree);
}
return result;
}
#endregion
}
}
| 36.693023 | 130 | 0.59209 | [
"MIT"
] | Marcushawley/RulesEngine | src/RulesEngine/RulesEngine/RulesEngine.cs | 7,891 | C# |
using System;
using NetOffice;
using NetOffice.Attributes;
namespace NetOffice.OutlookApi.Enums
{
/// <summary>
/// SupportByVersion Outlook 12, 14, 15, 16
/// </summary>
///<remarks> MSDN Online Documentation: http://msdn.microsoft.com/en-us/en-us/library/office/ff861336.aspx </remarks>
[SupportByVersion("Outlook", 12,14,15,16)]
[EntityType(EntityType.IsEnum)]
public enum OlStorageIdentifierType
{
/// <summary>
/// SupportByVersion Outlook 12, 14, 15, 16
/// </summary>
/// <remarks>0</remarks>
[SupportByVersion("Outlook", 12,14,15,16)]
olIdentifyBySubject = 0,
/// <summary>
/// SupportByVersion Outlook 12, 14, 15, 16
/// </summary>
/// <remarks>1</remarks>
[SupportByVersion("Outlook", 12,14,15,16)]
olIdentifyByEntryID = 1,
/// <summary>
/// SupportByVersion Outlook 12, 14, 15, 16
/// </summary>
/// <remarks>2</remarks>
[SupportByVersion("Outlook", 12,14,15,16)]
olIdentifyByMessageClass = 2
}
} | 27.914286 | 119 | 0.660184 | [
"MIT"
] | DominikPalo/NetOffice | Source/Outlook/Enums/OlStorageIdentifierType.cs | 979 | C# |
// Copyright (C) 2016-2020 Xtensive LLC.
// This code is distributed under MIT license terms.
// See the License.txt file in the project root for more information.
// Created by: Alexey Kulakov
// Created: 2016.10.19
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using NUnit.Framework;
using Xtensive.Orm.Configuration;
using Xtensive.Orm.Tests.Upgrade.HugeModelUpgrade.RegularModel;
namespace Xtensive.Orm.Tests.Upgrade.HugeModelUpgrade
{
/// <summary>
/// The test takes unnormal count of databases and time.
/// Run it on local machine only!
/// </summary>
[Explicit]
public sealed class DatabasePerNodeTest : HugeModelUpgradeTestBase
{
protected override DomainConfiguration BuildConfiguration()
{
var configuration = base.BuildConfiguration();
configuration.DefaultDatabase = "DO-Tests";
configuration.DefaultSchema = "dbo";
configuration.Types.Register(typeof(TestEntity0).Assembly, typeof(TestEntity0).Namespace);
return configuration;
}
protected override void PopulateData(Domain domain)
{
var nodes = new[] {
WellKnown.DefaultNodeId,
"Node1", "Node2", "Node3", "Node4", "Node5", "Node6",
"Node7", "Node8", "Node9", "Node10", "Node11", "Node12",
};
foreach (var node in nodes) {
var selectedNode = domain.StorageNodeManager.GetNode(node);
using (var session = selectedNode.OpenSession()) {
using (var transaction = session.OpenTransaction()) {
var populator = new ModelPopulator();
populator.Run();
transaction.Complete();
}
}
}
}
protected override void CheckIfQueriesWork(Domain domain)
{
var nodes = new[] {
WellKnown.DefaultNodeId,
"Node1", "Node2", "Node3", "Node4", "Node5", "Node6",
"Node7", "Node8", "Node9", "Node10", "Node11", "Node12",
};
foreach (var node in nodes) {
var selectedNode = domain.StorageNodeManager.GetNode(node);
using (var session = selectedNode.OpenSession()) {
using (var transaction = session.OpenTransaction()) {
var checker = new ModelChecker();
checker.Run(session);
}
}
}
}
protected override IEnumerable<NodeConfiguration> GetAdditionalNodeConfigurations(DomainUpgradeMode upgradeMode)
{
var databases = new[] {
"DO-Tests-1", "DO-Tests-2", "DO-Tests-3", "DO-Tests-4", "DO-Tests-5", "DO-Tests-6",
"DO-Tests-7", "DO-Tests-8", "DO-Tests-9", "DO-Tests-10", "DO-Tests-11", "DO-Tests-12",
};
var index = 0;
foreach (var database in databases) {
index++;
var node = new NodeConfiguration("Node" + index);
node.UpgradeMode = upgradeMode;
node.DatabaseMapping.Add("DO-Tests", database);
yield return node;
}
}
}
}
| 32.775281 | 116 | 0.631814 | [
"MIT"
] | NekrasovSt/dataobjects-net | Orm/Xtensive.Orm.Tests/Upgrade/HugeModelUpgrade/DatabasePerNodeTest.cs | 2,917 | C# |
// Copyright © 2015 onwards, Andrew Whewell
// All rights reserved.
//
// Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
// * Neither the name of the author nor the names of the program's contributors may be used to endorse or promote products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VirtualRadar.Interface.Database;
namespace VirtualRadar.Plugin.DatabaseEditor.Models
{
/// <summary>
/// Returned by a search for a single aircraft.
/// </summary>
public class SingleSearchResultsJson : ResponseJson
{
/// <summary>
/// Gets or sets the aircraft found in the search.
/// </summary>
public BaseStationAircraft Aircraft { get; set; }
}
}
| 68.633333 | 750 | 0.756192 | [
"BSD-3-Clause"
] | AlexAX135/vrs | Plugin.DatabaseEditor/Models/SingleSearchResultsJson.cs | 2,062 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.