content
stringlengths
5
1.04M
avg_line_length
float64
1.75
12.9k
max_line_length
int64
2
244k
alphanum_fraction
float64
0
0.98
licenses
list
repository_name
stringlengths
7
92
path
stringlengths
3
249
size
int64
5
1.04M
lang
stringclasses
2 values
using Parroteer.ViewModels; using System.Windows; namespace Parroteer.Views { /// <summary> /// Interaction logic for NewProjectDialog.xaml /// </summary> public partial class NewProjectDialog : Window { public NewProjectDialogVM ViewModel { get; private set; } public NewProjectDialog() { InitializeComponent(); DataContext = ViewModel = new NewProjectDialogVM(); ViewModel.OnRequestClose += ViewModel_OnRequestClose; } private void ViewModel_OnRequestClose(object sender, System.EventArgs e) { this.Close(); } public static NewProjectDialogVM OpenAsDialog() { NewProjectDialog dialog = new NewProjectDialog(); dialog.ShowDialog(); return dialog.ViewModel; } } }
24.482759
76
0.739437
[ "MIT" ]
Randehh/Parroteer
Parroteer/Views/NewProjectDialog.xaml.cs
712
C#
using SplashScreen; using System.Diagnostics; using System.Reflection; using System.Windows.Controls; namespace ResTB.GUI.View { /// <summary> /// Interaktionslogik für SplashScreen.xaml /// </summary> [SplashScreen(MinimumVisibilityDuration = 2, FadeoutDuration = 1)] //2,1 public partial class MySplashScreen : UserControl { public MySplashScreen() { InitializeComponent(); } /// <summary> /// Gets the file description. /// </summary> public FileVersionInfo FileVersionInfo { get; } = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); } }
24.703704
131
0.652174
[ "Apache-2.0" ]
GEOTEST-AG/MiResiliencia
GUI/View/MySplashScreen.xaml.cs
670
C#
using System.Net; using System.Threading.Tasks; using Bogus; using Camunda.Worker.Client; using Microsoft.Extensions.DependencyInjection; using Moq; using Xunit; namespace Camunda.Worker { public class BpmnErrorResultTest { private readonly ExternalTask _externalTask; private readonly Mock<IExternalTaskClient> _clientMock = new(); private readonly Mock<IExternalTaskContext> _contextMock = new(); public BpmnErrorResultTest() { _externalTask = new Faker<ExternalTask>() .CustomInstantiator(faker => new ExternalTask( faker.Random.Guid().ToString(), faker.Random.Word(), faker.Random.Word()) ) .Generate(); _contextMock.Setup(ctx => ctx.Task).Returns(_externalTask); _contextMock.Setup(ctx => ctx.Client).Returns(_clientMock.Object); _contextMock.SetupGet(c => c.ServiceProvider).Returns(new ServiceCollection().BuildServiceProvider()); } [Fact] public async Task TestExecuteResultAsync() { // Arrange _clientMock .Setup(client => client.ReportBpmnErrorAsync( _externalTask.Id, It.IsAny<BpmnErrorRequest>(), default )) .Returns(Task.CompletedTask) .Verifiable(); var result = new BpmnErrorResult("TEST_CODE", "Test message"); // Act await result.ExecuteResultAsync(_contextMock.Object); // Assert _clientMock.Verify(); _clientMock.VerifyNoOtherCalls(); } [Fact] public async Task TestExecuteResultWithFailedCompletion() { // Arrange _clientMock .Setup(client => client.ReportBpmnErrorAsync( _externalTask.Id, It.IsAny<BpmnErrorRequest>(), default )) .ThrowsAsync(new ClientException(new ErrorResponse { Type = "an error type", Message = "an error message" }, HttpStatusCode.InternalServerError)) .Verifiable(); _clientMock .Setup(client => client.ReportFailureAsync( _externalTask.Id, It.IsAny<ReportFailureRequest>(), default )) .Returns(Task.CompletedTask) .Verifiable(); var result = new BpmnErrorResult("TEST_CODE", "Test message"); // Act await result.ExecuteResultAsync(_contextMock.Object); // Assert _clientMock.Verify(); _clientMock.VerifyNoOtherCalls(); } } }
32.823529
114
0.557348
[ "MIT" ]
AMalininHere/camunda-worker-dotnet
test/Camunda.Worker.Tests/BpmnErrorResultTest.cs
2,790
C#
using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Text; using AssemblyDefender.Common.IO; namespace AssemblyDefender.Net.Metadata { /// <summary> /// Interface implementation descriptors. /// </summary> public class InterfaceImplTable : MetadataTable<InterfaceImplRow> { internal InterfaceImplTable(MetadataTableStream stream) : base(MetadataTableType.InterfaceImpl, stream) { } public override int Get(int rid, int column) { int index = rid - 1; switch (column) { case 0: return _rows[index].Class; case 1: return _rows[index].Interface; default: throw new ArgumentOutOfRangeException("column"); } } public override void Get(int rid, int column, int count, int[] values) { switch (column) { case 0: for (int i = 0, j = rid - 1; i < count; i++, j++) { values[i] = _rows[j].Class; } break; case 1: for (int i = 0, j = rid - 1; i < count; i++, j++) { values[i] = _rows[j].Interface; } break; default: throw new ArgumentOutOfRangeException("column"); } } public override void Update(int rid, int column, int value) { int index = rid - 1; switch (column) { case 0: _rows[index].Class = value; break; case 1: _rows[index].Interface = value; break; default: throw new ArgumentOutOfRangeException("column"); } } public override void Update(int rid, int column, int count, int[] values) { switch (column) { case 0: for (int i = 0, j = rid - 1; i < count; i++, j++) { _rows[j].Class = values[i]; } break; case 1: for (int i = 0, j = rid - 1; i < count; i++, j++) { _rows[j].Interface = values[i]; } break; default: throw new ArgumentOutOfRangeException("column"); } } protected override void FillRow(int[] values, ref InterfaceImplRow row) { row.Class = values[0]; row.Interface = values[1]; } protected override void FillValues(int[] values, ref InterfaceImplRow row) { values[0] = row.Class; values[1] = row.Interface; } protected internal override void Read(IBinaryAccessor accessor, TableCompressionInfo compressionInfo, int count) { if (count == 0) return; var rows = new InterfaceImplRow[count]; for (int i = 0; i < count; i++) { var row = new InterfaceImplRow(); row.Class = accessor.ReadCell(compressionInfo.TableRowIndexSize4[MetadataTableType.TypeDef]); row.Interface = accessor.ReadCell(compressionInfo.CodedTokenDataSize4[0]); rows[i] = row; } _count = count; _rows = rows; } protected internal override void Write(Blob blob, ref int pos, TableCompressionInfo compressionInfo) { for (int i = 0; i < _count; i++) { var row = _rows[i]; blob.WriteCell(ref pos, compressionInfo.TableRowIndexSize4[MetadataTableType.TypeDef], (int)row.Class); blob.WriteCell(ref pos, compressionInfo.CodedTokenDataSize4[0], (int)row.Interface); } } } }
21.324138
114
0.629366
[ "MIT" ]
nickyandreev/AssemblyDefender
src/AssemblyDefender.Net/Metadata/Tables/InterfaceImpl/InterfaceImplTable.cs
3,092
C#
using EngineeringUnits; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Diagnostics; using UnitsNet; using System.Linq; using Newtonsoft.Json; using System.Collections.Generic; using EngineeringUnits.Units; namespace UnitTests { [TestClass] public class MagneticFluxTest { [TestMethod] public void MagneticFluxAutoTest() { var A1 = new UnitsNet.MagneticFlux(1, UnitsNet.Units.MagneticFluxUnit.Weber); var A2 = new EngineeringUnits.MagneticFlux(1, MagneticFluxUnit.Weber); int WorkingCompares = 0; foreach (var EU in Enumeration.ListOf<MagneticFluxUnit>()) { double Error = 1E-5; double RelError = 1E-5; var UNList = UnitsNet.MagneticFlux.Units.Where(x => x.ToString() == EU.QuantityName); if (UNList.Count() == 1) { var UN = UNList.Single(); //if (UN == UnitsNet.Units.MagneticFluxUnit.NanowattPerSquareMeter) Error = 0.0001220703125; Debug.Print($""); Debug.Print($"UnitsNets: {UN} {A1.As(UN)}"); Debug.Print($"EngineeringUnit: {EU.QuantityName} {A2.As(EU)}"); Debug.Print($"ABS: {A2.As(EU) - A1.As(UN):F6}"); Debug.Print($"REF[%]: {HelperClass.Percent(A2.As(EU), A1.As(UN)):P6}"); //All units absolute difference Assert.AreEqual(0, A2.As(EU) - A1.As(UN), Error); //All units relative difference Assert.AreEqual(0, HelperClass.Percent(A2.As(EU), A1.As(UN)), RelError); //All units symbol compare Assert.AreEqual(A2.ToUnit(EU).DisplaySymbol(), A1.ToUnit(UN).ToString("a") ); WorkingCompares++; } } //Number of comparables units Assert.AreEqual(1, WorkingCompares); } } }
29.76
112
0.496416
[ "MIT" ]
MadsKirkFoged/EngineeringUnits
UnitTests/CombinedUnits/MagneticFlux/MagneticFlux.cs
2,232
C#
using System; using Castle.Core.Logging; using Abp.Dependency; using Abp.Timing; namespace TigerAdmin.Migrator { public class Log : ITransientDependency { public ILogger Logger { get; set; } public Log() { Logger = NullLogger.Instance; } public void Write(string text) { Console.WriteLine(Clock.Now.ToString("yyyy-MM-dd HH:mm:ss") + " | " + text); Logger.Info(text); } } }
20
88
0.56875
[ "Apache-2.0" ]
AllenHongjun/ddu
TigerAdminZero/5.8.1/aspnet-core/src/TigerAdmin.Migrator/Log.cs
480
C#
using MassTransit.Util; using StackExchange.Redis; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Threading; using System.Threading.Tasks; using TDASCommon; using TDASDataParser.StdfTypes; using Topshelf; namespace TDASPersistentService { public class OracleSubmit: ServiceControl { DatabaseManager dmgr = new DatabaseManager(); RedisService redis = new RedisService(); LimitedConcurrencyLevelTaskScheduler scheduler = new LimitedConcurrencyLevelTaskScheduler(30); LimitedConcurrencyLevelTaskScheduler ptrScheduler = new LimitedConcurrencyLevelTaskScheduler(5); TaskFactory factory; TaskFactory ptrFactory; Dictionary<string, DateTime> notExistsCheck = new Dictionary<string, DateTime>(); List<Task> taskList = new List<Task>(); public bool Start(HostControl hostControl) { Logs.Info("开启数据持久化服务"); factory = new TaskFactory(scheduler); ptrFactory = new TaskFactory(ptrScheduler); Global.TypePropsInit(); Assembly asse = Assembly.Load("TDASDataParser"); Dictionary<string, object> listType = new Dictionary<string, object>(); foreach (var item in asse.GetTypes()) { if (!item.Name.Contains("PrivateImplementationDetails") && item.FullName.StartsWith("TDASDataParser.StdfTypes.")) { listType.Add(item.Name, asse.CreateInstance(item.FullName)); } } string[] types = Config.SubmitType[0] == "*" ? listType.Keys.ToArray() : Config.SubmitType; // 针对每个类型 启动一个线程,类型取值与appsetting.json中的SubmitType foreach (var type in types) { notExistsCheck[type] = DateTime.Now.AddSeconds(-6); taskList.Add(Task.Run(() => { while (!Global.StopSignal) { if (!notExistsCheck.ContainsKey(type) || (DateTime.Now - notExistsCheck[type]).TotalSeconds > (type == "PRR" ? 1 : 3)) { Woker(type, (dynamic)(listType[type])); Thread.Sleep(100); } else { Thread.Sleep(100); } } })); } Task.Run(() => { RemoveClient(); }); Global.redis.Subscribe("STDFWRITESTOP", (msg) => { Global.StopSignal = true; }); return true; } public bool Stop(HostControl hostControl) { Global.StopSignal = true; Logs.Info("停止数据持久化服务"); Thread.Sleep(10000); Task.WaitAll(taskList.ToArray()); return true; } public void RemoveClient() { DateTime lastRun = DateTime.Now; Logs.Debug("客户端自动清除功能启动"); while (true) { if ((DateTime.Now - lastRun).TotalMinutes > 180) { lastRun = DateTime.Now; try { string strsql = "select IP_CODE from sys_eqp_status where status=2 and EQP_NAME like '%E3200-05%'"; List<dynamic> iplist = dmgr.ExecuteEntities<dynamic>(strsql); foreach (var item in iplist) { Global.redis.Publish("_KILLCLIENT_", item.IP_CODE.ToString()); } } catch (Exception ex) { Logs.Error("移除客户端", ex); } } Task.Delay(1000).Wait(); } } private async void Woker<T>(string type, T entity) where T : BaseEntity, new() { try { long count = redis.db.ListLengthAsync(type).Result; var tmpfactory = type == "PTR" ? ptrFactory : factory; count = Math.Min(count, 30000);//每次最多允许提交数 if (count > 0) { await tmpfactory.StartNew(() => { #region 创建批量读取命令 IBatch batch = redis.db.CreateBatch(); List<Task<RedisValue>> values = new List<Task<RedisValue>>(); for (int i = 0; i < count; i++) { values.Add(batch.ListRightPopAsync(type)); } batch.Execute(); #endregion //泛型数据结构,用于给插库提供数据源支持 Dictionary<int, List<T>> source = new Dictionary<int, List<T>>(); //redis 缓存数据,用于在数据库插入失败的情况下重新持久化到redis中 Dictionary<int, List<byte[]>> redisData = new Dictionary<int, List<byte[]>>(); foreach (var item in values) { byte[] val = item.Result; if (val == null) { continue; } int key = 0; if (!redisData.ContainsKey(key)) { source[key] = new List<T>(); redisData[key] = new List<byte[]>(); } redisData[key].Add(val); //数据格式 |stdfid(4)|partid(4)|data(N) //格式解释 byte[]总计分3段,第一段4个字节为stdfid,第二段8个字节为附加内容,第三段为剩余所有字节,属于stdf格式数据 var t = new T() { StdfId = BitConverter.ToInt32(val, 0) }; t.LoadData(val.Skip(12).ToArray(), val.Skip(4).Take(8).ToArray()); source[key].Add(t); } string sql = Global.DicSQL[type]; if (source.Count < 1) { return; } DataHelper.SubmitEntities(type, source[0].ToArray(), sql, dmgr.ConnectionString, redisData[0]); }); } else { notExistsCheck[type] = DateTime.Now; } } catch (Exception ex) { Logs.Error("", ex); } } } }
33.553922
142
0.440029
[ "Apache-2.0" ]
dingzhengs/TDASFORCORE
TDASPersistentService/OracleSubmit.cs
7,165
C#
using System; namespace RyanJuan.Lahkesis { public static partial class LahkesisExtensions { #if ZH_HANT #else /// <summary> /// /// </summary> /// <param name="random"></param> /// <param name="size"></param> /// <returns></returns> #endif public static byte[] NextByteArray( this Random random, int size) { if (random is null) { throw Error.ArgumentNull(nameof(random)); } if (size < 0) { throw Error.ArgumentOutOfRange( nameof(size), size, Error.Message.SizeSmallerThanZero); } var array = new byte[size]; random.NextBytes(array); return array; } } }
23.378378
57
0.453179
[ "MIT" ]
ryans610/Lahkesis
RyanJuan.Lahkesis/LahkesisExtensions/NextByteArray.cs
867
C#
using System.Collections.Generic; using System.Net.Http; using System.Web.Http; using System.Web.Http.ModelBinding; using Hanabi.Datas; using Hanabi.Datas.RequestResponse.Rooms; using Hanabi.Server.Controllers.Helper; using Hanabi.Server.Models.Datas; namespace Hanabi.Server.Controllers { public class RoomsController : ApiController { private static GameData Data { get; set; } static RoomsController() { Data = GameData.Instance; } [HttpGet] public IEnumerable<Room> List() { return Data.Rooms.Values; } [HttpPost] public HttpResponseMessage Open( [ModelBinder( typeof( JsonNetModelBinder ) )] OpenRoomRequest request ) { if ( Data.HasRoom( request.GameName ) || Data.HasPlayer( request.PlayerId ) ) { var openRoomFailedResponse = new OpenRoomResponse() { Result = false }; return new JsonNetResponseMessage( openRoomFailedResponse ); } var room = new Room() { GameName = request.GameName, GameSetting = request.GameSetting, Players = new List<Player>() }; var player = new Player() { Name = request.PlayerId, RoomName = room.GameName }; room.Players.Add( player ); Data.Rooms.Add( room.GameName, room ); Data.Players.Add( player.Name, player ); var response = new OpenRoomResponse() { Result = true, Room = room }; return new JsonNetResponseMessage( response ); } [HttpPost] public HttpResponseMessage Join( [ModelBinder( typeof( JsonNetModelBinder ) )] JoinRoomRequest request ) { var room = Data.FindRoom( request.GameName ); if ( room == null ) { var joinRoomFailedResponse = new JoinRoomResponse() { Result = false }; return new JsonNetResponseMessage( joinRoomFailedResponse ); } var player = Data.FindPlayer( request.PlayerId ); if ( player == null ) { player = new Player() { Name = request.PlayerId, RoomName = request.GameName }; Data.Players.Add( player.Name, player ); } room.Players.Add( player ); var response = new JoinRoomResponse() { Result = true, Room = room }; return new JsonNetResponseMessage( response ); } [HttpPost] public HttpResponseMessage Leave( [ModelBinder( typeof( JsonNetModelBinder ) )] LeaveRoomRequest request ) { if ( !Data.HasPlayer( request.PlayerId ) ) { var leaveRoomFailedResponse = new LeaveRoomResponse() { Result = false }; return new JsonNetResponseMessage( leaveRoomFailedResponse ); } var player = Data.FindPlayer( request.PlayerId ); if ( player == null ) { var leaveRoomFailedResponse = new LeaveRoomResponse() { Result = false }; return new JsonNetResponseMessage( leaveRoomFailedResponse ); } var roomName = player.RoomName; Room room = null; if ( !Data.Rooms.TryGetValue( roomName, out room ) ) { var leaveRoomFailedResponse = new LeaveRoomResponse() { Result = false }; return new JsonNetResponseMessage( leaveRoomFailedResponse ); } room.Players.Remove( player ); var response = new LeaveRoomResponse() { Result = true }; return new JsonNetResponseMessage( response ); } } }
29.616438
114
0.496531
[ "MIT" ]
LiTsungYi/Hanabi
HanabiServer/Controllers/RoomsController.cs
4,326
C#
// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Generated code. DO NOT EDIT! namespace Testing.Snippets.Snippets { // [START snippets_generated_Snippets_MethodThreeSignatures_sync_flattened2] using Testing.Snippets; public sealed partial class GeneratedSnippetsClientStandaloneSnippets { /// <summary>Snippet for MethodThreeSignatures</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MethodThreeSignatures2() { // Create client SnippetsClient snippetsClient = SnippetsClient.Create(); // Initialize request argument(s) string aString = ""; bool aBool = false; // Make the request Response response = snippetsClient.MethodThreeSignatures(aString, aBool); } } // [END snippets_generated_Snippets_MethodThreeSignatures_sync_flattened2] }
38.095238
89
0.695
[ "Apache-2.0" ]
amanda-tarafa/gapic-generator-csharp
Google.Api.Generator.Tests/ProtoTests/Snippets/Testing.Snippets.StandaloneSnippets/SnippetsClient.MethodThreeSignatures2Snippet.g.cs
1,602
C#
using System; using System.ComponentModel.DataAnnotations; using Newtonsoft.Json; namespace NetModular.Module.Admin.Application.AccountService.ViewModels { public class UpdatePasswordModel { /// <summary> /// 账户编号 /// </summary> [JsonIgnore] public Guid AccountId { get; set; } /// <summary> /// 旧密码 /// </summary> [Required(ErrorMessage = "请输入旧密码")] public string OldPassword { get; set; } /// <summary> /// 新密码 /// </summary> [Required(ErrorMessage = "请输入新密码")] public string NewPassword { get; set; } /// <summary> /// 确认密码 /// </summary> [Required(ErrorMessage = "请输入确认密码")] public string ConfirmPassword { get; set; } } }
23.647059
71
0.547264
[ "MIT" ]
380138129/NetModular
src/Admin/Library/Application/AccountService/ViewModels/UpdatePasswordModel.cs
872
C#
using Xamarin.Forms.Platform.Android; using GoMobile.Controls; using Xamarin.Forms; using System.ComponentModel; using Android.Graphics.Drawables; using Android.Graphics.Drawables.Shapes; using Android.Graphics; using GoMobile.Droid.Renderers; [assembly: ExportRenderer(typeof(GradientButton), typeof(GradientButtonRenderer))] namespace GoMobile.Droid.Renderers { public class GradientButtonRenderer : ButtonRenderer { protected override void OnElementChanged(ElementChangedEventArgs<Button> e) { base.OnElementChanged(e); var model = Element as GradientButton; if (model != null) { var gradient = GetGradientDrawable(model.StartGradientColor.ToAndroid(), model.EndGradientColor.ToAndroid()); Control.SetBackground(gradient); } } protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) { base.OnElementPropertyChanged(sender, e); if (e.PropertyName == "StartGradientColor" || e.PropertyName == "EndGradientColor") { var model = Element as GradientButton; if (model != null) { var gradient = GetGradientDrawable(model.StartGradientColor.ToAndroid(), model.EndGradientColor.ToAndroid()); Control.SetBackground(gradient); } } } private Drawable GetGradientDrawable(Android.Graphics.Color startColor, Android.Graphics.Color endColor) { var layers = new Drawable[1]; var shader = new CustomShaderFactory(startColor, endColor); var drawable = new PaintDrawable(); drawable.Shape = new RectShape(); drawable.SetShaderFactory(shader); layers[0] = drawable; return new LayerDrawable(layers); } private class CustomShaderFactory : ShapeDrawable.ShaderFactory { private Android.Graphics.Color _startColor; private Android.Graphics.Color _endColor; public CustomShaderFactory(Android.Graphics.Color startColor, Android.Graphics.Color endColor) { _startColor = startColor; _endColor = endColor; } public override Shader Resize(int width, int height) { return new LinearGradient(0, 0, 0, height, _startColor, _endColor, Shader.TileMode.Clamp); } } } }
37.115942
129
0.623975
[ "MIT" ]
Bowman74/VSLiveGoMobile
src/GoMobile/GoMobile.Android/Renderers/GradientButtonRenderer.cs
2,563
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Buffers; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.Security.Cryptography; using Microsoft.Win32.SafeHandles; namespace Internal.Cryptography { internal class OpenSslCipher : BasicSymmetricCipher { private readonly bool _encrypting; private SafeEvpCipherCtxHandle _ctx; public OpenSslCipher(IntPtr algorithm, CipherMode cipherMode, int blockSizeInBytes, byte[] key, int effectiveKeyLength, byte[]? iv, bool encrypting) : base(cipherMode.GetCipherIv(iv), blockSizeInBytes) { Debug.Assert(algorithm != IntPtr.Zero); _encrypting = encrypting; OpenKey(algorithm, key, effectiveKeyLength); } protected override void Dispose(bool disposing) { if (disposing) { if (_ctx != null) { _ctx.Dispose(); _ctx = null!; } } base.Dispose(disposing); } public override unsafe int Transform(ReadOnlySpan<byte> input, Span<byte> output) { Debug.Assert(input.Length > 0); Debug.Assert((input.Length % BlockSizeInBytes) == 0); // OpenSSL 1.1 does not allow partial overlap. if (input.Overlaps(output, out int overlapOffset) && overlapOffset != 0) { byte[] tmp = CryptoPool.Rent(input.Length); Span<byte> tmpSpan = tmp; int written = 0; try { written = CipherUpdate(input, tmpSpan); tmpSpan.Slice(0, written).CopyTo(output); return written; } finally { CryptoPool.Return(tmp, written); } } return CipherUpdate(input, output); } public override int TransformFinal(ReadOnlySpan<byte> input, Span<byte> output) { Debug.Assert((input.Length % BlockSizeInBytes) == 0); Debug.Assert(input.Length <= output.Length); int written = ProcessFinalBlock(input, output); Reset(); return written; } private int ProcessFinalBlock(ReadOnlySpan<byte> input, Span<byte> output) { // If input and output overlap but are not the same, we need to use a // temp buffer since openssl doesn't seem to like partial overlaps. if (input.Overlaps(output, out int offset) && offset != 0) { byte[] rented = CryptoPool.Rent(input.Length); int written = 0; try { written = CipherUpdate(input, rented); Span<byte> outputSpan = rented.AsSpan(written); CheckBoolReturn(Interop.Crypto.EvpCipherFinalEx(_ctx, outputSpan, out int finalWritten)); written += finalWritten; rented.AsSpan(0, written).CopyTo(output); return written; } finally { CryptoPool.Return(rented, clearSize: written); } } else { int written = CipherUpdate(input, output); Span<byte> outputSpan = output.Slice(written); CheckBoolReturn(Interop.Crypto.EvpCipherFinalEx(_ctx, outputSpan, out int finalWritten)); written += finalWritten; return written; } } private int CipherUpdate(ReadOnlySpan<byte> input, Span<byte> output) { Interop.Crypto.EvpCipherUpdate( _ctx, output, out int bytesWritten, input); return bytesWritten; } [MemberNotNull(nameof(_ctx))] private void OpenKey(IntPtr algorithm, byte[] key, int effectiveKeyLength) { _ctx = Interop.Crypto.EvpCipherCreate( algorithm, ref MemoryMarshal.GetReference(key.AsSpan()), key.Length * 8, effectiveKeyLength, ref MemoryMarshal.GetReference(IV.AsSpan()), _encrypting ? 1 : 0); Interop.Crypto.CheckValidOpenSslHandle(_ctx); // OpenSSL will happily do PKCS#7 padding for us, but since we support padding modes // that it doesn't (PaddingMode.Zeros) we'll just always pad the blocks ourselves. CheckBoolReturn(Interop.Crypto.EvpCipherCtxSetPadding(_ctx, 0)); } private void Reset() { bool status = Interop.Crypto.EvpCipherReset(_ctx); CheckBoolReturn(status); } private static void CheckBoolReturn(bool returnValue) { if (!returnValue) { throw Interop.Crypto.CreateOpenSslCryptographicException(); } } } }
33.5
156
0.541848
[ "MIT" ]
AustinWise/runtime
src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/OpenSslCipher.cs
5,293
C#
using System.Collections.ObjectModel; using Noterium.Core.DataCarriers; namespace Noterium.Core { public class TagManager { public ObservableCollection<Tag> Tags { get; set; } public void ReloadTags() { } } }
18.214286
59
0.639216
[ "MIT" ]
ekblom/noterium
src/Noterium.Core/TagManager.cs
257
C#
using System.ComponentModel; using System.Web.Http; namespace Swagger_Test.Controllers { /// <summary> /// Testing a controller with param in the Route /// </summary> [RoutePrefix("api/RouteTest")] public class RouteTestController : ApiController { [Route("test/{itemid:int}")] public DTOv2 Get([FromUri] DTOv2 data) { return data; } } public class DTOv2 { /// <summary>Secret ID for your object</summary> /// <example>234</example> [DefaultValue(123)] public int itemid { get; set; } /// <summary>Notes about your object</summary> /// <example>MyNote</example> [DefaultValue("HelloWorld")] public string note { get; set; } } }
23.666667
56
0.578745
[ "BSD-3-Clause" ]
heldersepu/Swagger-Net-Test
Swagger_Test/Controllers/RouteTestController.cs
783
C#
using System; using System.Xml.Serialization; namespace Aop.Api.Domain { /// <summary> /// KoubeiContentContentcountSetModel Data Structure. /// </summary> [Serializable] public class KoubeiContentContentcountSetModel : AopObject { /// <summary> /// 口碑端内容唯一id,必填 /// </summary> [XmlElement("content_id")] public string ContentId { get; set; } /// <summary> /// 数字 /// </summary> [XmlElement("num")] public long Num { get; set; } /// <summary> /// 场景码 /// </summary> [XmlElement("scene_code")] public string SceneCode { get; set; } } }
23.096774
63
0.513966
[ "Apache-2.0" ]
554393109/alipay-sdk-net-all
AlipaySDKNet.Standard/Domain/KoubeiContentContentcountSetModel.cs
746
C#
namespace XRoadLib.Serialization; /// <summary> /// Specifies how string values with special characters should be handled. /// </summary> public enum StringSerializationMode { /// <summary> /// Encodes special characters using HTML encoding. /// </summary> HtmlEncoded, /// <summary> /// Wrap strings containing special characters inside CDATA. /// </summary> [UsedImplicitly] WrappedInCData }
25.176471
74
0.686916
[ "MIT" ]
e-rik/XRoadLib
src/XRoadLib/Serialization/StringSerializationMode.cs
430
C#
#region Copyright (c) 2006-2019 nHydrate.org, All Rights Reserved // -------------------------------------------------------------------------- * // NHYDRATE.ORG * // Copyright (c) 2006-2019 All Rights reserved * // * // * // Permission is hereby granted, free of charge, to any person obtaining a * // copy of this software and associated documentation files (the "Software"), * // to deal in the Software without restriction, including without limitation * // the rights to use, copy, modify, merge, publish, distribute, sublicense, * // and/or sell copies of the Software, and to permit persons to whom the * // Software is furnished to do so, subject to the following conditions: * // * // The above copyright notice and this permission notice shall be included * // in all copies or substantial portions of the Software. * // * // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * // -------------------------------------------------------------------------- * #endregion using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace nHydrate.DataImport { public class Entity : SQLObject { public Entity() : base() { this.FieldList = new List<Field>(); this.RelationshipList = new List<Relationship>(); this.Schema = string.Empty; this.Collate = string.Empty; } public string Schema { get; set; } public string Collate { get; set; } public override List<Field> FieldList { get; internal set; } public override List<Parameter> ParameterList { get; internal set; } public List<Relationship> RelationshipList { get; private set; } public bool AllowCreateAudit { get; set; } public bool AllowModifyAudit { get; set; } public bool AllowTimestamp { get; set; } public bool IsTenant { get; set; } public override string ObjectType { get { return "Entity"; } } public override string ToString() { return this.Name; } public string CorePropertiesHash { get { var schema = this.Schema; if (string.IsNullOrEmpty(schema)) schema = "dbo"; var prehash = this.Name + "|" + schema + " | " + this.Collate + "|" + this.AllowCreateAudit + "|" + this.AllowModifyAudit + "|" + this.AllowTimestamp + "|" + this.IsTenant + "|"; return prehash; } } } }
38.310345
80
0.537054
[ "MIT" ]
mtgibbs/nHydrate
Source/nHydrate.DataImport/Entity.cs
3,333
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Extensions; /// <summary>Update a workspace.</summary> /// <remarks> /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}" /// </remarks> [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzWvdWorkspace_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.IWorkspace))] [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Description(@"Update a workspace.")] [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Generated] public partial class UpdateAzWvdWorkspace_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener { /// <summary>A unique id generatd for the this cmdlet when it is instantiated.</summary> private string __correlationId = System.Guid.NewGuid().ToString(); /// <summary>A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet)</summary> private global::System.Management.Automation.InvocationInfo __invocationInfo; /// <summary>A unique id generatd for the this cmdlet when ProcessRecord() is called.</summary> private string __processRecordId; /// <summary> /// The <see cref="global::System.Threading.CancellationTokenSource" /> for this operation. /// </summary> private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// <summary>List of applicationGroup links.</summary> [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of applicationGroup links.")] [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info( Required = false, ReadOnly = false, Description = @"List of applicationGroup links.", SerializedName = @"applicationGroupReferences", PossibleTypes = new [] { typeof(string) })] public string[] ApplicationGroupReference { get => WorkspaceBody.ApplicationGroupReference ?? null /* arrayOf */; set => WorkspaceBody.ApplicationGroupReference = value; } /// <summary>Wait for .NET debugger to attach</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } /// <summary>The reference to the client API class.</summary> public Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.DesktopVirtualizationClient Client => Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Module.Instance.ClientAPI; /// <summary> /// The credentials, account, tenant, and subscription used for communication with Azure /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } /// <summary>Description of Workspace.</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Description of Workspace.")] [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info( Required = false, ReadOnly = false, Description = @"Description of Workspace.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] public string Description { get => WorkspaceBody.Description ?? null; set => WorkspaceBody.Description = value; } /// <summary>Friendly name of Workspace.</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Friendly name of Workspace.")] [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info( Required = false, ReadOnly = false, Description = @"Friendly name of Workspace.", SerializedName = @"friendlyName", PossibleTypes = new [] { typeof(string) })] public string FriendlyName { get => WorkspaceBody.FriendlyName ?? null; set => WorkspaceBody.FriendlyName = value; } /// <summary>SendAsync Pipeline Steps to be appended to the front of the pipeline</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } /// <summary>SendAsync Pipeline Steps to be prepended to the front of the pipeline</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } /// <summary>Backing field for <see cref="InputObject" /> property.</summary> private Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.IDesktopVirtualizationIdentity _inputObject; /// <summary>Identity Parameter</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.ParameterCategory.Path)] public Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.IDesktopVirtualizationIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } /// <summary>Accessor for our copy of the InvocationInfo.</summary> public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// <summary> /// <see cref="IEventListener" /> cancellation delegate. Stops the cmdlet when called. /// </summary> global::System.Action Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; /// <summary><see cref="IEventListener" /> cancellation token.</summary> global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// <summary> /// The instance of the <see cref="Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.HttpPipeline" /> that the remote call will use. /// </summary> private Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.HttpPipeline Pipeline { get; set; } /// <summary>The URI for the proxy server to use</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.ParameterCategory.Runtime)] public global::System.Uri Proxy { get; set; } /// <summary>Credentials for a proxy server to use for the remote call</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] [global::System.Management.Automation.ValidateNotNull] [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.ParameterCategory.Runtime)] public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } /// <summary>Use the default credentials for the proxy</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } /// <summary>tags to be updated</summary> [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.ExportAs(typeof(global::System.Collections.Hashtable))] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "tags to be updated")] [global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Category(global::Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Info( Required = false, ReadOnly = false, Description = @"tags to be updated", SerializedName = @"tags", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.IWorkspacePatchTags) })] public Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.IWorkspacePatchTags Tag { get => WorkspaceBody.Tag ?? null /* object */; set => WorkspaceBody.Tag = value; } /// <summary>Backing field for <see cref="WorkspaceBody" /> property.</summary> private Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.IWorkspacePatch _workspaceBody= new Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.WorkspacePatch(); /// <summary>Workspace properties that can be patched.</summary> private Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.IWorkspacePatch WorkspaceBody { get => this._workspaceBody; set => this._workspaceBody = value; } /// <summary> /// <c>overrideOnDefault</c> will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.ICloudError" /// /> from the remote call</param> /// <param name="returnNow">/// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing )</param> partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.ICloudError> response, ref global::System.Threading.Tasks.Task<bool> returnNow); /// <summary> /// <c>overrideOnOk</c> will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.IWorkspace" /// /> from the remote call</param> /// <param name="returnNow">/// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing )</param> partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.IWorkspace> response, ref global::System.Threading.Tasks.Task<bool> returnNow); /// <summary> /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) /// </summary> protected override void BeginProcessing() { Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.AttachDebugger.Break(); } ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } /// <summary>Performs clean-up after the command execution</summary> protected override void EndProcessing() { ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } /// <summary>Handles/Dispatches events during the call to the REST service.</summary> /// <param name="id">The message id</param> /// <param name="token">The message cancellation token. When this call is cancelled, this should be <c>true</c></param> /// <param name="messageData">Detailed message data for the message event.</param> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the message is completed. /// </returns> async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func<Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.EventData> messageData) { using( NoSynchronizationContext ) { if (token.IsCancellationRequested) { return ; } switch ( id ) { case Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.Verbose: { WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.Warning: { WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.Information: { var data = messageData(); WriteInformation(data, new[] { data.Message }); return ; } case Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.Debug: { WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.Error: { WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } } await Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; } WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); } } /// <summary>Performs execution of the command.</summary> protected override void ProcessRecord() { ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } __processRecordId = System.Guid.NewGuid().ToString(); try { // work if (ShouldProcess($"Call remote 'WorkspacesUpdate' operation")) { using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Token) ) { asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Token); } } } catch (global::System.AggregateException aggregateException) { // unroll the inner exceptions to get the root cause foreach( var innerException in aggregateException.Flatten().InnerExceptions ) { ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } // Write exception out to error channel. WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); } } catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) { ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } // Write exception out to error channel. WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); } finally { ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.CmdletProcessRecordEnd).Wait(); } } /// <summary>Performs execution of the command, working asynchronously if required.</summary> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed. /// </returns> protected async global::System.Threading.Tasks.Task ProcessRecordAsync() { using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); } if (null != HttpPipelineAppend) { Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance try { await ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { await this.Client.WorkspacesUpdateViaIdentity(InputObject.Id, WorkspaceBody, onOk, onDefault, this, Pipeline); } else { // try to call with PATH parameters from Input Object if (null == InputObject.SubscriptionId) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } if (null == InputObject.ResourceGroupName) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } if (null == InputObject.WorkspaceName) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.WorkspaceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } await this.Client.WorkspacesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.WorkspaceName ?? null, WorkspaceBody, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.UndeclaredResponseException urexception) { WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=WorkspaceBody}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); } finally { await ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.Events.CmdletProcessRecordAsyncEnd); } } } /// <summary>Interrupts currently running code within the command.</summary> protected override void StopProcessing() { ((Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.IEventListener)this).Cancel(); base.StopProcessing(); } /// <summary> /// Intializes a new instance of the <see cref="UpdateAzWvdWorkspace_UpdateViaIdentityExpanded" /> cmdlet class. /// </summary> public UpdateAzWvdWorkspace_UpdateViaIdentityExpanded() { } /// <summary> /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// </summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.ICloudError" /// /> from the remote call</param> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed. /// </returns> private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.ICloudError> response) { using( NoSynchronizationContext ) { var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false); overrideOnDefault(responseMessage, response, ref _returnNow); // if overrideOnDefault has returned true, then return right away. if ((null != _returnNow && await _returnNow)) { return ; } // Error Response : default var code = (await response)?.Code; var message = (await response)?.Message; if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Runtime.RestException<Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.ICloudError>(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=WorkspaceBody }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=WorkspaceBody }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); } } } /// <summary>a delegate that is called when the remote service returns 200 (OK).</summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.IWorkspace" /// /> from the remote call</param> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed. /// </returns> private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.IWorkspace> response) { using( NoSynchronizationContext ) { var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false); overrideOnOk(responseMessage, response, ref _returnNow); // if overrideOnOk has returned true, then return right away. if ((null != _returnNow && await _returnNow)) { return ; } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.DesktopVirtualization.Models.Api20210201Preview.IWorkspace WriteObject((await response)); } } } }
78.252315
515
0.685135
[ "MIT" ]
AndriiKalinichenko/azure-powershell
src/DesktopVirtualization/generated/cmdlets/UpdateAzWvdWorkspace_UpdateViaIdentityExpanded.cs
33,374
C#
using System.Globalization; using OpenQA.Selenium; namespace Tranquire.Selenium.Questions { /// <summary> /// Base class for the UI state /// </summary> /// <typeparam name="T"></typeparam> public abstract class UIState<T> : ITargeted { /// <summary> /// Gets The target of the elemnt /// </summary> public ITarget Target { get; } /// <summary> /// Gets the culture of the value /// </summary> public CultureInfo Culture { get; } /// <summary> /// Creates a new instance of <see cref="UIState{T}"/> /// </summary> /// <param name="target"></param> /// <param name="culture"></param> protected UIState(ITarget target, CultureInfo culture) { Target = target ?? throw new System.ArgumentNullException(nameof(target)); Culture = culture ?? throw new System.ArgumentNullException(nameof(culture)); } /// <summary> /// Resolve the value for the given <see cref="IWebElement"/> /// </summary> /// <param name="element">The element to resolve the value from</param> /// <returns></returns> protected abstract T ResolveFor(IWebElement element); } }
32.589744
89
0.571991
[ "MIT" ]
Galad/tranquire
src/Tranquire.Selenium/Questions/UIState.cs
1,273
C#
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Threading; using System.Threading.Tasks; using Havok; using NLog; using NLog.Fluent; using Sandbox; using Sandbox.Engine.Analytics; using Sandbox.Engine.Multiplayer; using Sandbox.Engine.Networking; using Sandbox.Engine.Platform.VideoMode; using Sandbox.Engine.Utils; using Sandbox.Game; using Sandbox.Game.Gui; using Sandbox.Game.World; using Sandbox.Graphics.GUI; using SpaceEngineers.Game; using SpaceEngineers.Game.GUI; using Torch.Utils; using VRage; using VRage.Audio; using VRage.FileSystem; using VRage.Game; using VRage.Game.ObjectBuilder; using VRage.Game.SessionComponents; using VRage.GameServices; using VRage.Network; using VRage.Plugins; using VRage.Steam; using VRage.Utils; using VRageRender; namespace Torch { public class VRageGame { private static readonly ILogger _log = LogManager.GetCurrentClassLogger(); #pragma warning disable 649 [ReflectedGetter(Name = "m_plugins", Type = typeof(MyPlugins))] private static readonly Func<List<IPlugin>> _getVRagePluginList; [ReflectedGetter(Name = "Static", TypeName = "Sandbox.Game.Audio.MyMusicController, Sandbox.Game")] private static readonly Func<object> _getMusicControllerStatic; [ReflectedSetter(Name = "Static", TypeName = "Sandbox.Game.Audio.MyMusicController, Sandbox.Game")] private static readonly Action<object> _setMusicControllerStatic; [ReflectedMethod(Name = "Unload", TypeName = "Sandbox.Game.Audio.MyMusicController, Sandbox.Game")] private static readonly Action<object> _musicControllerUnload; // [ReflectedGetter(Name = "UpdateLayerDescriptors", Type = typeof(MyReplicationServer))] // private static readonly Func<MyReplicationServer.UpdateLayerDesc[]> _layerSettings; #pragma warning restore 649 private readonly TorchBase _torch; private readonly Action _tweakGameSettings; private readonly string _userDataPath; private readonly string _appName; private readonly uint _appSteamId; private readonly string[] _runArgs; private SpaceEngineersGame _game; private readonly Thread _updateThread; private bool _startGame = false; private readonly AutoResetEvent _commandChanged = new AutoResetEvent(false); private bool _destroyGame = false; private readonly AutoResetEvent _stateChangedEvent = new AutoResetEvent(false); private GameState _state; public enum GameState { Creating, Stopped, Running, Destroyed } internal VRageGame(TorchBase torch, Action tweakGameSettings, string appName, uint appSteamId, string userDataPath, string[] runArgs) { _torch = torch; _tweakGameSettings = tweakGameSettings; _appName = appName; _appSteamId = appSteamId; _userDataPath = userDataPath; _runArgs = runArgs; _updateThread = new Thread(Run); _updateThread.Start(); } private void StateChange(GameState s) { if (_state == s) return; _state = s; _stateChangedEvent.Set(); } private void Run() { StateChange(GameState.Creating); try { Create(); _destroyGame = false; while (!_destroyGame) { StateChange(GameState.Stopped); _commandChanged.WaitOne(); if (_startGame) { _startGame = false; DoStart(); } } } finally { Destroy(); StateChange(GameState.Destroyed); } } private void Create() { bool dedicated = Sandbox.Engine.Platform.Game.IsDedicated; Environment.SetEnvironmentVariable("SteamAppId", _appSteamId.ToString()); MyServiceManager.Instance.AddService<IMyGameService>(new MySteamService(dedicated, _appSteamId)); if (dedicated && !MyGameService.HasGameServer) { _log.Warn("Steam service is not running! Please reinstall dedicated server."); return; } SpaceEngineersGame.SetupBasicGameInfo(); SpaceEngineersGame.SetupPerGameSettings(); MyFinalBuildConstants.APP_VERSION = MyPerGameSettings.BasicGameInfo.GameVersion; MySessionComponentExtDebug.ForceDisable = true; MyPerGameSettings.SendLogToKeen = false; // SpaceEngineersGame.SetupAnalytics(); MyFileSystem.ExePath = Path.GetDirectoryName(typeof(SpaceEngineersGame).Assembly.Location); _tweakGameSettings(); MyFileSystem.Reset(); MyInitializer.InvokeBeforeRun(_appSteamId, _appName, _userDataPath); // MyInitializer.InitCheckSum(); // Hook into the VRage plugin system for updates. _getVRagePluginList().Add(_torch); if (!MySandboxGame.IsReloading) MyFileSystem.InitUserSpecific(dedicated ? null : MyGameService.UserId.ToString()); MySandboxGame.IsReloading = dedicated; // render init { IMyRender renderer = null; if (dedicated) { renderer = new MyNullRender(); } else { MyPerformanceSettings preset = MyGuiScreenOptionsGraphics.GetPreset(MyRenderQualityEnum.NORMAL); MyRenderProxy.Settings.User = MyVideoSettingsManager.GetGraphicsSettingsFromConfig(ref preset) .PerformanceSettings.RenderSettings; MyStringId graphicsRenderer = MySandboxGame.Config.GraphicsRenderer; if (graphicsRenderer == MySandboxGame.DirectX11RendererKey) { renderer = new MyDX11Render(new MyRenderSettings?(MyRenderProxy.Settings)); if (!renderer.IsSupported) { MySandboxGame.Log.WriteLine( "DirectX 11 renderer not supported. No renderer to revert back to."); renderer = null; } } if (renderer == null) { throw new MyRenderException( "The current version of the game requires a Dx11 card. \\n For more information please see : http://blog.marekrosa.org/2016/02/space-engineers-news-full-source-code_26.html", MyRenderExceptionEnum.GpuNotSupported); } MySandboxGame.Config.GraphicsRenderer = graphicsRenderer; } MyRenderProxy.Initialize(renderer); MyRenderProxy.GetRenderProfiler().SetAutocommit(false); MyRenderProxy.GetRenderProfiler().InitMemoryHack("MainEntryPoint"); } // Loads object builder serializers. Intuitive, right? _log.Info("Setting up serializers"); MyPlugins.RegisterGameAssemblyFile(MyPerGameSettings.GameModAssembly); if (MyPerGameSettings.GameModBaseObjBuildersAssembly != null) MyPlugins.RegisterBaseGameObjectBuildersAssemblyFile(MyPerGameSettings.GameModBaseObjBuildersAssembly); MyPlugins.RegisterGameObjectBuildersAssemblyFile(MyPerGameSettings.GameModObjBuildersAssembly); MyPlugins.RegisterSandboxAssemblyFile(MyPerGameSettings.SandboxAssembly); MyPlugins.RegisterSandboxGameAssemblyFile(MyPerGameSettings.SandboxGameAssembly); //typeof(MySandboxGame).GetMethod("Preallocate", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, null); MyGlobalTypeMetadata.Static.Init(false); } private void Destroy() { _game.Dispose(); _game = null; MyGameService.ShutDown(); _getVRagePluginList().Remove(_torch); MyInitializer.InvokeAfterRun(); } private void DoStart() { _game = new SpaceEngineersGame(_runArgs); if (MySandboxGame.FatalErrorDuringInit) { throw new InvalidOperationException("Failed to start sandbox game: fatal error during init"); } try { StateChange(GameState.Running); _game.Run(); } finally { StateChange(GameState.Stopped); } } private void DoDisableAutoload() { if (MySandboxGame.ConfigDedicated is MyConfigDedicated<MyObjectBuilder_SessionSettings> config) { var tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); Directory.CreateDirectory(tempDirectory); config.LoadWorld = null; config.PremadeCheckpointPath = tempDirectory; } } #pragma warning disable 649 [ReflectedMethod(Name = "StartServer")] private static Action<MySession, MyMultiplayerBase> _hostServerForSession; #pragma warning restore 649 private void DoLoadSession(string sessionPath) { if (!Path.IsPathRooted(sessionPath)) sessionPath = Path.Combine(MyFileSystem.SavesPath, sessionPath); if (!Sandbox.Engine.Platform.Game.IsDedicated) { MySessionLoader.LoadSingleplayerSession(sessionPath); return; } ulong checkpointSize; MyObjectBuilder_Checkpoint checkpoint = MyLocalCache.LoadCheckpoint(sessionPath, out checkpointSize); if (MySession.IsCompatibleVersion(checkpoint)) { if (MySteamWorkshop.DownloadWorldModsBlocking(checkpoint.Mods).Success) { // MySpaceAnalytics.Instance.SetEntry(MyGameEntryEnum.Load); MySession.Load(sessionPath, checkpoint, checkpointSize); _hostServerForSession(MySession.Static, MyMultiplayer.Static); } else MyLog.Default.WriteLineAndConsole("Unable to download mods"); } else MyLog.Default.WriteLineAndConsole(MyTexts.Get(MyCommonTexts.DialogTextIncompatibleWorldVersion) .ToString()); } private void DoJoinSession(ulong lobbyId) { MyJoinGameHelper.JoinGame(lobbyId); } private void DoUnloadSession() { if (!Sandbox.Engine.Platform.Game.IsDedicated) { MyScreenManager.CloseAllScreensExcept(null); MyGuiSandbox.Update(16); } if (MySession.Static != null) { MySession.Static.Unload(); MySession.Static = null; } { var musicCtl = _getMusicControllerStatic(); if (musicCtl != null) { _musicControllerUnload(musicCtl); _setMusicControllerStatic(null); MyAudio.Static.MusicAllowed = true; } } if (MyMultiplayer.Static != null) { MyMultiplayer.Static.Dispose(); } if (!Sandbox.Engine.Platform.Game.IsDedicated) { MyGuiSandbox.AddScreen(MyGuiSandbox.CreateScreen(MyPerGameSettings.GUI.MainMenu)); } } private void DoStop() { ParallelTasks.Parallel.Scheduler.WaitForTasksToFinish(TimeSpan.FromSeconds(10.0)); MySandboxGame.Static.Exit(); } /// <summary> /// Signals the game to stop itself. /// </summary> public void SignalStop() { _startGame = false; _game.Invoke(DoStop, $"{nameof(VRageGame)}::{nameof(SignalStop)}"); } /// <summary> /// Signals the game to start itself /// </summary> public void SignalStart() { _startGame = true; _commandChanged.Set(); } /// <summary> /// Signals the game to destroy itself /// </summary> public void SignalDestroy() { _destroyGame = true; SignalStop(); _commandChanged.Set(); } public Task LoadSession(string path) { return _torch.InvokeAsync(()=>DoLoadSession(path)); } public Task JoinSession(ulong lobbyId) { return _torch.InvokeAsync(()=>DoJoinSession(lobbyId)); } public Task UnloadSession() { return _torch.InvokeAsync(DoUnloadSession); } /// <summary> /// Waits for the game to transition to the given state /// </summary> /// <param name="state">State to transition to</param> /// <param name="timeout">Timeout</param> /// <returns></returns> public bool WaitFor(GameState state, TimeSpan? timeout = null) { // Kinda icky, but we can't block the update and expect the state to change. if (Thread.CurrentThread == _updateThread) return _state == state; DateTime? end = timeout.HasValue ? (DateTime?) (DateTime.Now + timeout.Value) : null; while (_state != state && (!end.HasValue || end > DateTime.Now + TimeSpan.FromSeconds(1))) if (end.HasValue) _stateChangedEvent.WaitOne(end.Value - DateTime.Now); else _stateChangedEvent.WaitOne(); return _state == state; } } }
35.97995
202
0.584843
[ "Apache-2.0" ]
SinZ163/Torch
Torch/VRageGame.cs
14,358
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNextGen.Network.V20200301.Inputs { /// <summary> /// Firewall Policy NAT Rule. /// </summary> public sealed class FirewallPolicyNatRuleArgs : Pulumi.ResourceArgs { /// <summary> /// The action type of a Nat rule. /// </summary> [Input("action")] public Input<Inputs.FirewallPolicyNatRuleActionArgs>? Action { get; set; } /// <summary> /// The name of the rule. /// </summary> [Input("name")] public Input<string>? Name { get; set; } /// <summary> /// Priority of the Firewall Policy Rule resource. /// </summary> [Input("priority")] public Input<int>? Priority { get; set; } /// <summary> /// The match conditions for incoming traffic. /// </summary> [Input("ruleCondition")] public Input<object>? RuleCondition { get; set; } /// <summary> /// The type of the rule. /// Expected value is 'FirewallPolicyNatRule'. /// </summary> [Input("ruleType", required: true)] public Input<string> RuleType { get; set; } = null!; /// <summary> /// The translated address for this NAT rule. /// </summary> [Input("translatedAddress")] public Input<string>? TranslatedAddress { get; set; } /// <summary> /// The translated port for this NAT rule. /// </summary> [Input("translatedPort")] public Input<string>? TranslatedPort { get; set; } public FirewallPolicyNatRuleArgs() { } } }
29.272727
82
0.574017
[ "Apache-2.0" ]
pulumi/pulumi-azure-nextgen
sdk/dotnet/Network/V20200301/Inputs/FirewallPolicyNatRuleArgs.cs
1,932
C#
using System; /* * Предположим, что в tmux осталась последняя открытая вкладка. Что произойдет, если вы введете в этой вкладке в командную строку команду exit? */ namespace step_10 { class Program { static void Main(string[] args) { Console.WriteLine("tmux завершит работу"); } } }
18.684211
67
0.6
[ "Unlicense" ]
tshemake/Software-Development
stepik/73/4770/step_10/Program.cs
479
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the s3control-2018-08-20.normal.json service model. */ using System; using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using System.Net; using Amazon.S3Control.Model; using Amazon.S3Control.Model.Internal.MarshallTransformations; using Amazon.S3Control.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.S3Control { /// <summary> /// Implementation for accessing S3Control /// /// AWS S3 Control provides access to Amazon S3 control plane actions. /// </summary> public partial class AmazonS3ControlClient : AmazonServiceClient, IAmazonS3Control { private static IServiceMetadata serviceMetadata = new AmazonS3ControlMetadata(); private IS3ControlPaginatorFactory _paginators; /// <summary> /// Paginators for the service /// </summary> public IS3ControlPaginatorFactory Paginators { get { if (this._paginators == null) { this._paginators = new S3ControlPaginatorFactory(this); } return this._paginators; } } #region Constructors /// <summary> /// Constructs AmazonS3ControlClient 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> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> public AmazonS3ControlClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonS3ControlConfig()) { } /// <summary> /// Constructs AmazonS3ControlClient 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> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> /// <param name="region">The region to connect.</param> public AmazonS3ControlClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonS3ControlConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonS3ControlClient 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> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> /// <param name="config">The AmazonS3ControlClient Configuration Object</param> public AmazonS3ControlClient(AmazonS3ControlConfig config) : base(FallbackCredentialsFactory.GetCredentials(), config) { } /// <summary> /// Constructs AmazonS3ControlClient with AWS Credentials /// </summary> /// <param name="credentials">AWS Credentials</param> public AmazonS3ControlClient(AWSCredentials credentials) : this(credentials, new AmazonS3ControlConfig()) { } /// <summary> /// Constructs AmazonS3ControlClient with AWS Credentials /// </summary> /// <param name="credentials">AWS Credentials</param> /// <param name="region">The region to connect.</param> public AmazonS3ControlClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonS3ControlConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonS3ControlClient with AWS Credentials and an /// AmazonS3ControlClient Configuration object. /// </summary> /// <param name="credentials">AWS Credentials</param> /// <param name="clientConfig">The AmazonS3ControlClient Configuration Object</param> public AmazonS3ControlClient(AWSCredentials credentials, AmazonS3ControlConfig clientConfig) : base(credentials, clientConfig) { } /// <summary> /// Constructs AmazonS3ControlClient 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 AmazonS3ControlClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonS3ControlConfig()) { } /// <summary> /// Constructs AmazonS3ControlClient 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 AmazonS3ControlClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonS3ControlConfig() {RegionEndpoint=region}) { } /// <summary> /// Constructs AmazonS3ControlClient with AWS Access Key ID, AWS Secret Key and an /// AmazonS3ControlClient Configuration object. /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="clientConfig">The AmazonS3ControlClient Configuration Object</param> public AmazonS3ControlClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonS3ControlConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// <summary> /// Constructs AmazonS3ControlClient 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 AmazonS3ControlClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonS3ControlConfig()) { } /// <summary> /// Constructs AmazonS3ControlClient 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 AmazonS3ControlClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonS3ControlConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonS3ControlClient with AWS Access Key ID, AWS Secret Key and an /// AmazonS3ControlClient 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 AmazonS3ControlClient Configuration Object</param> public AmazonS3ControlClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonS3ControlConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig) { } #endregion #region Overrides /// <summary> /// Creates the signer for the service. /// </summary> protected override AbstractAWSSigner CreateSigner() { return new S3Signer(); } /// <summary> /// Customize the pipeline /// </summary> /// <param name="pipeline"></param> protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline) { pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Marshaller>(new Amazon.S3Control.Internal.AmazonS3ControlPreMarshallHandler()); pipeline.AddHandlerAfter<Amazon.Runtime.Internal.Marshaller>(new Amazon.S3Control.Internal.AmazonS3ControlPostMarshallHandler()); pipeline.AddHandlerBefore<Amazon.Runtime.Internal.Unmarshaller>(new Amazon.S3Control.Internal.AmazonS3ControlPostUnmarshallHandler()); pipeline.AddHandlerAfter<Amazon.Runtime.Internal.ErrorCallbackHandler>(new Amazon.S3Control.Internal.AmazonS3ControlExceptionHandler()); } /// <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 CreateAccessPoint /// <summary> /// Creates an access point and associates it with the specified bucket. For more information, /// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html">Managing /// Data Access with Amazon S3 Access Points</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// /// <note> /// <para> /// S3 on Outposts only supports VPC-style Access Points. /// </para> /// /// <para> /// For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html"> /// Accessing Amazon S3 on Outposts using virtual private cloud (VPC) only Access Points</a> /// in the <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// </note> /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPoint.html#API_control_CreateAccessPoint_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>CreateAccessPoint</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html">GetAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPoint.html">DeleteAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPoints.html">ListAccessPoints</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateAccessPoint service method.</param> /// /// <returns>The response from the CreateAccessPoint service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/CreateAccessPoint">REST API Reference for CreateAccessPoint Operation</seealso> public virtual CreateAccessPointResponse CreateAccessPoint(CreateAccessPointRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateAccessPointRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateAccessPointResponseUnmarshaller.Instance; return Invoke<CreateAccessPointResponse>(request, options); } /// <summary> /// Creates an access point and associates it with the specified bucket. For more information, /// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html">Managing /// Data Access with Amazon S3 Access Points</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// /// <note> /// <para> /// S3 on Outposts only supports VPC-style Access Points. /// </para> /// /// <para> /// For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html"> /// Accessing Amazon S3 on Outposts using virtual private cloud (VPC) only Access Points</a> /// in the <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// </note> /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPoint.html#API_control_CreateAccessPoint_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>CreateAccessPoint</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html">GetAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPoint.html">DeleteAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPoints.html">ListAccessPoints</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateAccessPoint service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateAccessPoint service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/CreateAccessPoint">REST API Reference for CreateAccessPoint Operation</seealso> public virtual Task<CreateAccessPointResponse> CreateAccessPointAsync(CreateAccessPointRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateAccessPointRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateAccessPointResponseUnmarshaller.Instance; return InvokeAsync<CreateAccessPointResponse>(request, options, cancellationToken); } #endregion #region CreateAccessPointForObjectLambda /// <summary> /// Creates an Object Lambda Access Point. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html">Transforming /// objects with Object Lambda Access Points</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// /// /// <para> /// The following actions are related to <code>CreateAccessPointForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointForObjectLambda.html">DeleteAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointForObjectLambda.html">GetAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPointsForObjectLambda.html">ListAccessPointsForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateAccessPointForObjectLambda service method.</param> /// /// <returns>The response from the CreateAccessPointForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/CreateAccessPointForObjectLambda">REST API Reference for CreateAccessPointForObjectLambda Operation</seealso> public virtual CreateAccessPointForObjectLambdaResponse CreateAccessPointForObjectLambda(CreateAccessPointForObjectLambdaRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateAccessPointForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateAccessPointForObjectLambdaResponseUnmarshaller.Instance; return Invoke<CreateAccessPointForObjectLambdaResponse>(request, options); } /// <summary> /// Creates an Object Lambda Access Point. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html">Transforming /// objects with Object Lambda Access Points</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// /// /// <para> /// The following actions are related to <code>CreateAccessPointForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointForObjectLambda.html">DeleteAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointForObjectLambda.html">GetAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPointsForObjectLambda.html">ListAccessPointsForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateAccessPointForObjectLambda service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateAccessPointForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/CreateAccessPointForObjectLambda">REST API Reference for CreateAccessPointForObjectLambda Operation</seealso> public virtual Task<CreateAccessPointForObjectLambdaResponse> CreateAccessPointForObjectLambdaAsync(CreateAccessPointForObjectLambdaRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateAccessPointForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateAccessPointForObjectLambdaResponseUnmarshaller.Instance; return InvokeAsync<CreateAccessPointForObjectLambdaResponse>(request, options, cancellationToken); } #endregion #region CreateBucket /// <summary> /// <note> /// <para> /// This action creates an Amazon S3 on Outposts bucket. To create an S3 bucket, see <a /// href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html">Create /// Bucket</a> in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Creates a new Outposts bucket. By creating the bucket, you become the bucket owner. /// To create an Outposts bucket, you must have S3 on Outposts. For more information, /// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// Not every string is an acceptable bucket name. For information on bucket naming restrictions, /// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/BucketRestrictions.html#bucketnamingrules">Working /// with Amazon S3 Buckets</a>. /// </para> /// /// <para> /// S3 on Outposts buckets support: /// </para> /// <ul> <li> /// <para> /// Tags /// </para> /// </li> <li> /// <para> /// LifecycleConfigurations for deleting expired objects /// </para> /// </li> </ul> /// <para> /// For a complete list of restrictions and Amazon S3 feature limitations on S3 on Outposts, /// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OnOutpostsRestrictionsLimitations.html"> /// Amazon S3 on Outposts Restrictions and Limitations</a>. /// </para> /// /// <para> /// For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on /// Outposts endpoint hostname prefix and <code>x-amz-outpost-id</code> in your API request, /// see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html#API_control_CreateBucket_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>CreateBucket</code> for Amazon S3 on Outposts: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html">PutObject</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucket.html">GetBucket</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucket.html">DeleteBucket</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPoint.html">CreateAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicy.html">PutAccessPointPolicy</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateBucket service method.</param> /// /// <returns>The response from the CreateBucket service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.BucketAlreadyExistsException"> /// The requested Outposts bucket name is not available. The bucket namespace is shared /// by all users of the AWS Outposts in this Region. Select a different name and try again. /// </exception> /// <exception cref="Amazon.S3Control.Model.BucketAlreadyOwnedByYouException"> /// The Outposts bucket you tried to create already exists, and you own it. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/CreateBucket">REST API Reference for CreateBucket Operation</seealso> public virtual CreateBucketResponse CreateBucket(CreateBucketRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateBucketRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateBucketResponseUnmarshaller.Instance; return Invoke<CreateBucketResponse>(request, options); } /// <summary> /// <note> /// <para> /// This action creates an Amazon S3 on Outposts bucket. To create an S3 bucket, see <a /// href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html">Create /// Bucket</a> in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Creates a new Outposts bucket. By creating the bucket, you become the bucket owner. /// To create an Outposts bucket, you must have S3 on Outposts. For more information, /// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// Not every string is an acceptable bucket name. For information on bucket naming restrictions, /// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/BucketRestrictions.html#bucketnamingrules">Working /// with Amazon S3 Buckets</a>. /// </para> /// /// <para> /// S3 on Outposts buckets support: /// </para> /// <ul> <li> /// <para> /// Tags /// </para> /// </li> <li> /// <para> /// LifecycleConfigurations for deleting expired objects /// </para> /// </li> </ul> /// <para> /// For a complete list of restrictions and Amazon S3 feature limitations on S3 on Outposts, /// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OnOutpostsRestrictionsLimitations.html"> /// Amazon S3 on Outposts Restrictions and Limitations</a>. /// </para> /// /// <para> /// For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on /// Outposts endpoint hostname prefix and <code>x-amz-outpost-id</code> in your API request, /// see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html#API_control_CreateBucket_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>CreateBucket</code> for Amazon S3 on Outposts: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html">PutObject</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucket.html">GetBucket</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucket.html">DeleteBucket</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPoint.html">CreateAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicy.html">PutAccessPointPolicy</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateBucket service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateBucket service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.BucketAlreadyExistsException"> /// The requested Outposts bucket name is not available. The bucket namespace is shared /// by all users of the AWS Outposts in this Region. Select a different name and try again. /// </exception> /// <exception cref="Amazon.S3Control.Model.BucketAlreadyOwnedByYouException"> /// The Outposts bucket you tried to create already exists, and you own it. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/CreateBucket">REST API Reference for CreateBucket Operation</seealso> public virtual Task<CreateBucketResponse> CreateBucketAsync(CreateBucketRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateBucketRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateBucketResponseUnmarshaller.Instance; return InvokeAsync<CreateBucketResponse>(request, options, cancellationToken); } #endregion #region CreateJob /// <summary> /// You can use S3 Batch Operations to perform large-scale batch actions on Amazon S3 /// objects. Batch Operations can run a single action on lists of Amazon S3 objects that /// you specify. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-basics.html">S3 /// Batch Operations</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// This action creates a S3 Batch Operations job. /// </para> /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html">DescribeJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListJobs.html">ListJobs</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobPriority.html">UpdateJobPriority</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html">UpdateJobStatus</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_JobOperation.html">JobOperation</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateJob service method.</param> /// /// <returns>The response from the CreateJob service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.BadRequestException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.IdempotencyException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyRequestsException"> /// /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/CreateJob">REST API Reference for CreateJob Operation</seealso> public virtual CreateJobResponse CreateJob(CreateJobRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateJobRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateJobResponseUnmarshaller.Instance; return Invoke<CreateJobResponse>(request, options); } /// <summary> /// You can use S3 Batch Operations to perform large-scale batch actions on Amazon S3 /// objects. Batch Operations can run a single action on lists of Amazon S3 objects that /// you specify. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-basics.html">S3 /// Batch Operations</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// This action creates a S3 Batch Operations job. /// </para> /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html">DescribeJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListJobs.html">ListJobs</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobPriority.html">UpdateJobPriority</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html">UpdateJobStatus</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_JobOperation.html">JobOperation</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateJob service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateJob service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.BadRequestException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.IdempotencyException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyRequestsException"> /// /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/CreateJob">REST API Reference for CreateJob Operation</seealso> public virtual Task<CreateJobResponse> CreateJobAsync(CreateJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateJobRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateJobResponseUnmarshaller.Instance; return InvokeAsync<CreateJobResponse>(request, options, cancellationToken); } #endregion #region DeleteAccessPoint /// <summary> /// Deletes the specified access point. /// /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPoint.html#API_control_DeleteAccessPoint_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>DeleteAccessPoint</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPoint.html">CreateAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html">GetAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPoints.html">ListAccessPoints</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteAccessPoint service method.</param> /// /// <returns>The response from the DeleteAccessPoint service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteAccessPoint">REST API Reference for DeleteAccessPoint Operation</seealso> public virtual DeleteAccessPointResponse DeleteAccessPoint(DeleteAccessPointRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteAccessPointRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteAccessPointResponseUnmarshaller.Instance; return Invoke<DeleteAccessPointResponse>(request, options); } /// <summary> /// Deletes the specified access point. /// /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPoint.html#API_control_DeleteAccessPoint_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>DeleteAccessPoint</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPoint.html">CreateAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html">GetAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPoints.html">ListAccessPoints</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteAccessPoint service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteAccessPoint service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteAccessPoint">REST API Reference for DeleteAccessPoint Operation</seealso> public virtual Task<DeleteAccessPointResponse> DeleteAccessPointAsync(DeleteAccessPointRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteAccessPointRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteAccessPointResponseUnmarshaller.Instance; return InvokeAsync<DeleteAccessPointResponse>(request, options, cancellationToken); } #endregion #region DeleteAccessPointForObjectLambda /// <summary> /// Deletes the specified Object Lambda Access Point. /// /// /// <para> /// The following actions are related to <code>DeleteAccessPointForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPointForObjectLambda.html">CreateAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointForObjectLambda.html">GetAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPointsForObjectLambda.html">ListAccessPointsForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteAccessPointForObjectLambda service method.</param> /// /// <returns>The response from the DeleteAccessPointForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteAccessPointForObjectLambda">REST API Reference for DeleteAccessPointForObjectLambda Operation</seealso> public virtual DeleteAccessPointForObjectLambdaResponse DeleteAccessPointForObjectLambda(DeleteAccessPointForObjectLambdaRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteAccessPointForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteAccessPointForObjectLambdaResponseUnmarshaller.Instance; return Invoke<DeleteAccessPointForObjectLambdaResponse>(request, options); } /// <summary> /// Deletes the specified Object Lambda Access Point. /// /// /// <para> /// The following actions are related to <code>DeleteAccessPointForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPointForObjectLambda.html">CreateAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointForObjectLambda.html">GetAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPointsForObjectLambda.html">ListAccessPointsForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteAccessPointForObjectLambda service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteAccessPointForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteAccessPointForObjectLambda">REST API Reference for DeleteAccessPointForObjectLambda Operation</seealso> public virtual Task<DeleteAccessPointForObjectLambdaResponse> DeleteAccessPointForObjectLambdaAsync(DeleteAccessPointForObjectLambdaRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteAccessPointForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteAccessPointForObjectLambdaResponseUnmarshaller.Instance; return InvokeAsync<DeleteAccessPointForObjectLambdaResponse>(request, options, cancellationToken); } #endregion #region DeleteAccessPointPolicy /// <summary> /// Deletes the access point policy for the specified access point. /// /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicy.html#API_control_DeleteAccessPointPolicy_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>DeleteAccessPointPolicy</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicy.html">PutAccessPointPolicy</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointPolicy.html">GetAccessPointPolicy</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteAccessPointPolicy service method.</param> /// /// <returns>The response from the DeleteAccessPointPolicy service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteAccessPointPolicy">REST API Reference for DeleteAccessPointPolicy Operation</seealso> public virtual DeleteAccessPointPolicyResponse DeleteAccessPointPolicy(DeleteAccessPointPolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteAccessPointPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteAccessPointPolicyResponseUnmarshaller.Instance; return Invoke<DeleteAccessPointPolicyResponse>(request, options); } /// <summary> /// Deletes the access point policy for the specified access point. /// /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicy.html#API_control_DeleteAccessPointPolicy_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>DeleteAccessPointPolicy</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicy.html">PutAccessPointPolicy</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointPolicy.html">GetAccessPointPolicy</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteAccessPointPolicy service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteAccessPointPolicy service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteAccessPointPolicy">REST API Reference for DeleteAccessPointPolicy Operation</seealso> public virtual Task<DeleteAccessPointPolicyResponse> DeleteAccessPointPolicyAsync(DeleteAccessPointPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteAccessPointPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteAccessPointPolicyResponseUnmarshaller.Instance; return InvokeAsync<DeleteAccessPointPolicyResponse>(request, options, cancellationToken); } #endregion #region DeleteAccessPointPolicyForObjectLambda /// <summary> /// Removes the resource policy for an Object Lambda Access Point. /// /// /// <para> /// The following actions are related to <code>DeleteAccessPointPolicyForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointPolicyForObjectLambda.html">GetAccessPointPolicyForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicyForObjectLambda.html">PutAccessPointPolicyForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteAccessPointPolicyForObjectLambda service method.</param> /// /// <returns>The response from the DeleteAccessPointPolicyForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteAccessPointPolicyForObjectLambda">REST API Reference for DeleteAccessPointPolicyForObjectLambda Operation</seealso> public virtual DeleteAccessPointPolicyForObjectLambdaResponse DeleteAccessPointPolicyForObjectLambda(DeleteAccessPointPolicyForObjectLambdaRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteAccessPointPolicyForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteAccessPointPolicyForObjectLambdaResponseUnmarshaller.Instance; return Invoke<DeleteAccessPointPolicyForObjectLambdaResponse>(request, options); } /// <summary> /// Removes the resource policy for an Object Lambda Access Point. /// /// /// <para> /// The following actions are related to <code>DeleteAccessPointPolicyForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointPolicyForObjectLambda.html">GetAccessPointPolicyForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicyForObjectLambda.html">PutAccessPointPolicyForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteAccessPointPolicyForObjectLambda service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteAccessPointPolicyForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteAccessPointPolicyForObjectLambda">REST API Reference for DeleteAccessPointPolicyForObjectLambda Operation</seealso> public virtual Task<DeleteAccessPointPolicyForObjectLambdaResponse> DeleteAccessPointPolicyForObjectLambdaAsync(DeleteAccessPointPolicyForObjectLambdaRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteAccessPointPolicyForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteAccessPointPolicyForObjectLambdaResponseUnmarshaller.Instance; return InvokeAsync<DeleteAccessPointPolicyForObjectLambdaResponse>(request, options, cancellationToken); } #endregion #region DeleteBucket /// <summary> /// <note> /// <para> /// This action deletes an Amazon S3 on Outposts bucket. To delete an S3 bucket, see <a /// href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html">DeleteBucket</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Deletes the Amazon S3 on Outposts bucket. All objects (including all object versions /// and delete markers) in the bucket must be deleted before the bucket itself can be /// deleted. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucket.html#API_control_DeleteBucket_Examples">Examples</a> /// section. /// </para> /// <p class="title"> <b>Related Resources</b> /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html">CreateBucket</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucket.html">GetBucket</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html">DeleteObject</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteBucket service method.</param> /// /// <returns>The response from the DeleteBucket service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteBucket">REST API Reference for DeleteBucket Operation</seealso> public virtual DeleteBucketResponse DeleteBucket(DeleteBucketRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteBucketRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteBucketResponseUnmarshaller.Instance; return Invoke<DeleteBucketResponse>(request, options); } /// <summary> /// <note> /// <para> /// This action deletes an Amazon S3 on Outposts bucket. To delete an S3 bucket, see <a /// href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html">DeleteBucket</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Deletes the Amazon S3 on Outposts bucket. All objects (including all object versions /// and delete markers) in the bucket must be deleted before the bucket itself can be /// deleted. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucket.html#API_control_DeleteBucket_Examples">Examples</a> /// section. /// </para> /// <p class="title"> <b>Related Resources</b> /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html">CreateBucket</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucket.html">GetBucket</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html">DeleteObject</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteBucket service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteBucket service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteBucket">REST API Reference for DeleteBucket Operation</seealso> public virtual Task<DeleteBucketResponse> DeleteBucketAsync(DeleteBucketRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteBucketRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteBucketResponseUnmarshaller.Instance; return InvokeAsync<DeleteBucketResponse>(request, options, cancellationToken); } #endregion #region DeleteBucketLifecycleConfiguration /// <summary> /// <note> /// <para> /// This action deletes an Amazon S3 on Outposts bucket's lifecycle configuration. To /// delete an S3 bucket's lifecycle configuration, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html">DeleteBucketLifecycle</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Deletes the lifecycle configuration from the specified Outposts bucket. Amazon S3 /// on Outposts removes all the lifecycle configuration rules in the lifecycle subresource /// associated with the bucket. Your objects never expire, and Amazon S3 on Outposts no /// longer automatically deletes any objects on the basis of rules contained in the deleted /// lifecycle configuration. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// To use this action, you must have permission to perform the <code>s3-outposts:DeleteLifecycleConfiguration</code> /// action. By default, the bucket owner has this permission and the Outposts bucket owner /// can grant this permission to others. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketLifecycleConfiguration.html#API_control_DeleteBucketLifecycleConfiguration_Examples">Examples</a> /// section. /// </para> /// /// <para> /// For more information about object expiration, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#intro-lifecycle-rules-actions">Elements /// to Describe Lifecycle Actions</a>. /// </para> /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketLifecycleConfiguration.html">PutBucketLifecycleConfiguration</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketLifecycleConfiguration.html">GetBucketLifecycleConfiguration</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteBucketLifecycleConfiguration service method.</param> /// /// <returns>The response from the DeleteBucketLifecycleConfiguration service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteBucketLifecycleConfiguration">REST API Reference for DeleteBucketLifecycleConfiguration Operation</seealso> public virtual DeleteBucketLifecycleConfigurationResponse DeleteBucketLifecycleConfiguration(DeleteBucketLifecycleConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteBucketLifecycleConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteBucketLifecycleConfigurationResponseUnmarshaller.Instance; return Invoke<DeleteBucketLifecycleConfigurationResponse>(request, options); } /// <summary> /// <note> /// <para> /// This action deletes an Amazon S3 on Outposts bucket's lifecycle configuration. To /// delete an S3 bucket's lifecycle configuration, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html">DeleteBucketLifecycle</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Deletes the lifecycle configuration from the specified Outposts bucket. Amazon S3 /// on Outposts removes all the lifecycle configuration rules in the lifecycle subresource /// associated with the bucket. Your objects never expire, and Amazon S3 on Outposts no /// longer automatically deletes any objects on the basis of rules contained in the deleted /// lifecycle configuration. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// To use this action, you must have permission to perform the <code>s3-outposts:DeleteLifecycleConfiguration</code> /// action. By default, the bucket owner has this permission and the Outposts bucket owner /// can grant this permission to others. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketLifecycleConfiguration.html#API_control_DeleteBucketLifecycleConfiguration_Examples">Examples</a> /// section. /// </para> /// /// <para> /// For more information about object expiration, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#intro-lifecycle-rules-actions">Elements /// to Describe Lifecycle Actions</a>. /// </para> /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketLifecycleConfiguration.html">PutBucketLifecycleConfiguration</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketLifecycleConfiguration.html">GetBucketLifecycleConfiguration</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteBucketLifecycleConfiguration service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteBucketLifecycleConfiguration service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteBucketLifecycleConfiguration">REST API Reference for DeleteBucketLifecycleConfiguration Operation</seealso> public virtual Task<DeleteBucketLifecycleConfigurationResponse> DeleteBucketLifecycleConfigurationAsync(DeleteBucketLifecycleConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteBucketLifecycleConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteBucketLifecycleConfigurationResponseUnmarshaller.Instance; return InvokeAsync<DeleteBucketLifecycleConfigurationResponse>(request, options, cancellationToken); } #endregion #region DeleteBucketPolicy /// <summary> /// <note> /// <para> /// This action deletes an Amazon S3 on Outposts bucket policy. To delete an S3 bucket /// policy, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketPolicy.html">DeleteBucketPolicy</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// This implementation of the DELETE action uses the policy subresource to delete the /// policy of a specified Amazon S3 on Outposts bucket. If you are using an identity other /// than the root user of the AWS account that owns the bucket, the calling identity must /// have the <code>s3-outposts:DeleteBucketPolicy</code> permissions on the specified /// Outposts bucket and belong to the bucket owner's account to use this action. For more /// information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// If you don't have <code>DeleteBucketPolicy</code> permissions, Amazon S3 returns a /// <code>403 Access Denied</code> error. If you have the correct permissions, but you're /// not using an identity that belongs to the bucket owner's account, Amazon S3 returns /// a <code>405 Method Not Allowed</code> error. /// </para> /// <important> /// <para> /// As a security precaution, the root user of the AWS account that owns a bucket can /// always use this action, even if the policy explicitly denies the root user the ability /// to perform this action. /// </para> /// </important> /// <para> /// For more information about bucket policies, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html">Using /// Bucket Policies and User Policies</a>. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketPolicy.html#API_control_DeleteBucketPolicy_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>DeleteBucketPolicy</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketPolicy.html">GetBucketPolicy</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketPolicy.html">PutBucketPolicy</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteBucketPolicy service method.</param> /// /// <returns>The response from the DeleteBucketPolicy service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteBucketPolicy">REST API Reference for DeleteBucketPolicy Operation</seealso> public virtual DeleteBucketPolicyResponse DeleteBucketPolicy(DeleteBucketPolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteBucketPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteBucketPolicyResponseUnmarshaller.Instance; return Invoke<DeleteBucketPolicyResponse>(request, options); } /// <summary> /// <note> /// <para> /// This action deletes an Amazon S3 on Outposts bucket policy. To delete an S3 bucket /// policy, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketPolicy.html">DeleteBucketPolicy</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// This implementation of the DELETE action uses the policy subresource to delete the /// policy of a specified Amazon S3 on Outposts bucket. If you are using an identity other /// than the root user of the AWS account that owns the bucket, the calling identity must /// have the <code>s3-outposts:DeleteBucketPolicy</code> permissions on the specified /// Outposts bucket and belong to the bucket owner's account to use this action. For more /// information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// If you don't have <code>DeleteBucketPolicy</code> permissions, Amazon S3 returns a /// <code>403 Access Denied</code> error. If you have the correct permissions, but you're /// not using an identity that belongs to the bucket owner's account, Amazon S3 returns /// a <code>405 Method Not Allowed</code> error. /// </para> /// <important> /// <para> /// As a security precaution, the root user of the AWS account that owns a bucket can /// always use this action, even if the policy explicitly denies the root user the ability /// to perform this action. /// </para> /// </important> /// <para> /// For more information about bucket policies, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html">Using /// Bucket Policies and User Policies</a>. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketPolicy.html#API_control_DeleteBucketPolicy_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>DeleteBucketPolicy</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketPolicy.html">GetBucketPolicy</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketPolicy.html">PutBucketPolicy</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteBucketPolicy service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteBucketPolicy service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteBucketPolicy">REST API Reference for DeleteBucketPolicy Operation</seealso> public virtual Task<DeleteBucketPolicyResponse> DeleteBucketPolicyAsync(DeleteBucketPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteBucketPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteBucketPolicyResponseUnmarshaller.Instance; return InvokeAsync<DeleteBucketPolicyResponse>(request, options, cancellationToken); } #endregion #region DeleteBucketTagging /// <summary> /// <note> /// <para> /// This action deletes an Amazon S3 on Outposts bucket's tags. To delete an S3 bucket /// tags, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html">DeleteBucketTagging</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Deletes the tags from the Outposts bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// To use this action, you must have permission to perform the <code>PutBucketTagging</code> /// action. By default, the bucket owner has this permission and can grant this permission /// to others. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketTagging.html#API_control_DeleteBucketTagging_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>DeleteBucketTagging</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketTagging.html">GetBucketTagging</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketTagging.html">PutBucketTagging</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteBucketTagging service method.</param> /// /// <returns>The response from the DeleteBucketTagging service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteBucketTagging">REST API Reference for DeleteBucketTagging Operation</seealso> public virtual DeleteBucketTaggingResponse DeleteBucketTagging(DeleteBucketTaggingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteBucketTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteBucketTaggingResponseUnmarshaller.Instance; return Invoke<DeleteBucketTaggingResponse>(request, options); } /// <summary> /// <note> /// <para> /// This action deletes an Amazon S3 on Outposts bucket's tags. To delete an S3 bucket /// tags, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html">DeleteBucketTagging</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Deletes the tags from the Outposts bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// To use this action, you must have permission to perform the <code>PutBucketTagging</code> /// action. By default, the bucket owner has this permission and can grant this permission /// to others. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketTagging.html#API_control_DeleteBucketTagging_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>DeleteBucketTagging</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketTagging.html">GetBucketTagging</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketTagging.html">PutBucketTagging</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteBucketTagging service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteBucketTagging service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteBucketTagging">REST API Reference for DeleteBucketTagging Operation</seealso> public virtual Task<DeleteBucketTaggingResponse> DeleteBucketTaggingAsync(DeleteBucketTaggingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteBucketTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteBucketTaggingResponseUnmarshaller.Instance; return InvokeAsync<DeleteBucketTaggingResponse>(request, options, cancellationToken); } #endregion #region DeleteJobTagging /// <summary> /// Removes the entire tag set from the specified S3 Batch Operations job. To use this /// operation, you must have permission to perform the <code>s3:DeleteJobTagging</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-managing-jobs.html#batch-ops-job-tags">Controlling /// access and labeling jobs using tags</a> in the <i>Amazon Simple Storage Service User /// Guide</i>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetJobTagging.html">GetJobTagging</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutJobTagging.html">PutJobTagging</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteJobTagging service method.</param> /// /// <returns>The response from the DeleteJobTagging service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.NotFoundException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyRequestsException"> /// /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteJobTagging">REST API Reference for DeleteJobTagging Operation</seealso> public virtual DeleteJobTaggingResponse DeleteJobTagging(DeleteJobTaggingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteJobTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteJobTaggingResponseUnmarshaller.Instance; return Invoke<DeleteJobTaggingResponse>(request, options); } /// <summary> /// Removes the entire tag set from the specified S3 Batch Operations job. To use this /// operation, you must have permission to perform the <code>s3:DeleteJobTagging</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-managing-jobs.html#batch-ops-job-tags">Controlling /// access and labeling jobs using tags</a> in the <i>Amazon Simple Storage Service User /// Guide</i>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetJobTagging.html">GetJobTagging</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutJobTagging.html">PutJobTagging</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteJobTagging service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteJobTagging service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.NotFoundException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyRequestsException"> /// /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteJobTagging">REST API Reference for DeleteJobTagging Operation</seealso> public virtual Task<DeleteJobTaggingResponse> DeleteJobTaggingAsync(DeleteJobTaggingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteJobTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteJobTaggingResponseUnmarshaller.Instance; return InvokeAsync<DeleteJobTaggingResponse>(request, options, cancellationToken); } #endregion #region DeletePublicAccessBlock /// <summary> /// Removes the <code>PublicAccessBlock</code> configuration for an AWS account. For more /// information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html"> /// Using Amazon S3 block public access</a>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetPublicAccessBlock.html">GetPublicAccessBlock</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutPublicAccessBlock.html">PutPublicAccessBlock</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeletePublicAccessBlock service method.</param> /// /// <returns>The response from the DeletePublicAccessBlock service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeletePublicAccessBlock">REST API Reference for DeletePublicAccessBlock Operation</seealso> public virtual DeletePublicAccessBlockResponse DeletePublicAccessBlock(DeletePublicAccessBlockRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeletePublicAccessBlockRequestMarshaller.Instance; options.ResponseUnmarshaller = DeletePublicAccessBlockResponseUnmarshaller.Instance; return Invoke<DeletePublicAccessBlockResponse>(request, options); } /// <summary> /// Removes the <code>PublicAccessBlock</code> configuration for an AWS account. For more /// information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html"> /// Using Amazon S3 block public access</a>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetPublicAccessBlock.html">GetPublicAccessBlock</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutPublicAccessBlock.html">PutPublicAccessBlock</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeletePublicAccessBlock service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeletePublicAccessBlock service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeletePublicAccessBlock">REST API Reference for DeletePublicAccessBlock Operation</seealso> public virtual Task<DeletePublicAccessBlockResponse> DeletePublicAccessBlockAsync(DeletePublicAccessBlockRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeletePublicAccessBlockRequestMarshaller.Instance; options.ResponseUnmarshaller = DeletePublicAccessBlockResponseUnmarshaller.Instance; return InvokeAsync<DeletePublicAccessBlockResponse>(request, options, cancellationToken); } #endregion #region DeleteStorageLensConfiguration /// <summary> /// Deletes the Amazon S3 Storage Lens configuration. For more information about S3 Storage /// Lens, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Assessing /// your storage activity and usage with Amazon S3 Storage Lens </a> in the <i>Amazon /// Simple Storage Service User Guide</i>. /// /// <note> /// <para> /// To use this action, you must have permission to perform the <code>s3:DeleteStorageLensConfiguration</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting /// permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteStorageLensConfiguration service method.</param> /// /// <returns>The response from the DeleteStorageLensConfiguration service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteStorageLensConfiguration">REST API Reference for DeleteStorageLensConfiguration Operation</seealso> public virtual DeleteStorageLensConfigurationResponse DeleteStorageLensConfiguration(DeleteStorageLensConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteStorageLensConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteStorageLensConfigurationResponseUnmarshaller.Instance; return Invoke<DeleteStorageLensConfigurationResponse>(request, options); } /// <summary> /// Deletes the Amazon S3 Storage Lens configuration. For more information about S3 Storage /// Lens, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Assessing /// your storage activity and usage with Amazon S3 Storage Lens </a> in the <i>Amazon /// Simple Storage Service User Guide</i>. /// /// <note> /// <para> /// To use this action, you must have permission to perform the <code>s3:DeleteStorageLensConfiguration</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting /// permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteStorageLensConfiguration service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteStorageLensConfiguration service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteStorageLensConfiguration">REST API Reference for DeleteStorageLensConfiguration Operation</seealso> public virtual Task<DeleteStorageLensConfigurationResponse> DeleteStorageLensConfigurationAsync(DeleteStorageLensConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteStorageLensConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteStorageLensConfigurationResponseUnmarshaller.Instance; return InvokeAsync<DeleteStorageLensConfigurationResponse>(request, options, cancellationToken); } #endregion #region DeleteStorageLensConfigurationTagging /// <summary> /// Deletes the Amazon S3 Storage Lens configuration tags. For more information about /// S3 Storage Lens, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Assessing /// your storage activity and usage with Amazon S3 Storage Lens </a> in the <i>Amazon /// Simple Storage Service User Guide</i>. /// /// <note> /// <para> /// To use this action, you must have permission to perform the <code>s3:DeleteStorageLensConfigurationTagging</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting /// permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteStorageLensConfigurationTagging service method.</param> /// /// <returns>The response from the DeleteStorageLensConfigurationTagging service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteStorageLensConfigurationTagging">REST API Reference for DeleteStorageLensConfigurationTagging Operation</seealso> public virtual DeleteStorageLensConfigurationTaggingResponse DeleteStorageLensConfigurationTagging(DeleteStorageLensConfigurationTaggingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteStorageLensConfigurationTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteStorageLensConfigurationTaggingResponseUnmarshaller.Instance; return Invoke<DeleteStorageLensConfigurationTaggingResponse>(request, options); } /// <summary> /// Deletes the Amazon S3 Storage Lens configuration tags. For more information about /// S3 Storage Lens, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Assessing /// your storage activity and usage with Amazon S3 Storage Lens </a> in the <i>Amazon /// Simple Storage Service User Guide</i>. /// /// <note> /// <para> /// To use this action, you must have permission to perform the <code>s3:DeleteStorageLensConfigurationTagging</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting /// permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteStorageLensConfigurationTagging service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteStorageLensConfigurationTagging service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteStorageLensConfigurationTagging">REST API Reference for DeleteStorageLensConfigurationTagging Operation</seealso> public virtual Task<DeleteStorageLensConfigurationTaggingResponse> DeleteStorageLensConfigurationTaggingAsync(DeleteStorageLensConfigurationTaggingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteStorageLensConfigurationTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteStorageLensConfigurationTaggingResponseUnmarshaller.Instance; return InvokeAsync<DeleteStorageLensConfigurationTaggingResponse>(request, options, cancellationToken); } #endregion #region DescribeJob /// <summary> /// Retrieves the configuration parameters and status for a Batch Operations job. For /// more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-basics.html">S3 /// Batch Operations</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListJobs.html">ListJobs</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobPriority.html">UpdateJobPriority</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html">UpdateJobStatus</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeJob service method.</param> /// /// <returns>The response from the DescribeJob service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.BadRequestException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.NotFoundException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyRequestsException"> /// /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DescribeJob">REST API Reference for DescribeJob Operation</seealso> public virtual DescribeJobResponse DescribeJob(DescribeJobRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeJobRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeJobResponseUnmarshaller.Instance; return Invoke<DescribeJobResponse>(request, options); } /// <summary> /// Retrieves the configuration parameters and status for a Batch Operations job. For /// more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-basics.html">S3 /// Batch Operations</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListJobs.html">ListJobs</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobPriority.html">UpdateJobPriority</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html">UpdateJobStatus</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeJob service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DescribeJob service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.BadRequestException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.NotFoundException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyRequestsException"> /// /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DescribeJob">REST API Reference for DescribeJob Operation</seealso> public virtual Task<DescribeJobResponse> DescribeJobAsync(DescribeJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeJobRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeJobResponseUnmarshaller.Instance; return InvokeAsync<DescribeJobResponse>(request, options, cancellationToken); } #endregion #region GetAccessPoint /// <summary> /// Returns configuration information about the specified access point. /// /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html#API_control_GetAccessPoint_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>GetAccessPoint</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPoint.html">CreateAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPoint.html">DeleteAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPoints.html">ListAccessPoints</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetAccessPoint service method.</param> /// /// <returns>The response from the GetAccessPoint service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPoint">REST API Reference for GetAccessPoint Operation</seealso> public virtual GetAccessPointResponse GetAccessPoint(GetAccessPointRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetAccessPointRequestMarshaller.Instance; options.ResponseUnmarshaller = GetAccessPointResponseUnmarshaller.Instance; return Invoke<GetAccessPointResponse>(request, options); } /// <summary> /// Returns configuration information about the specified access point. /// /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html#API_control_GetAccessPoint_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>GetAccessPoint</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPoint.html">CreateAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPoint.html">DeleteAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPoints.html">ListAccessPoints</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetAccessPoint service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetAccessPoint service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPoint">REST API Reference for GetAccessPoint Operation</seealso> public virtual Task<GetAccessPointResponse> GetAccessPointAsync(GetAccessPointRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetAccessPointRequestMarshaller.Instance; options.ResponseUnmarshaller = GetAccessPointResponseUnmarshaller.Instance; return InvokeAsync<GetAccessPointResponse>(request, options, cancellationToken); } #endregion #region GetAccessPointConfigurationForObjectLambda /// <summary> /// Returns configuration for an Object Lambda Access Point. /// /// /// <para> /// The following actions are related to <code>GetAccessPointConfigurationForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointConfigurationForObjectLambda.html">PutAccessPointConfigurationForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetAccessPointConfigurationForObjectLambda service method.</param> /// /// <returns>The response from the GetAccessPointConfigurationForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointConfigurationForObjectLambda">REST API Reference for GetAccessPointConfigurationForObjectLambda Operation</seealso> public virtual GetAccessPointConfigurationForObjectLambdaResponse GetAccessPointConfigurationForObjectLambda(GetAccessPointConfigurationForObjectLambdaRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetAccessPointConfigurationForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = GetAccessPointConfigurationForObjectLambdaResponseUnmarshaller.Instance; return Invoke<GetAccessPointConfigurationForObjectLambdaResponse>(request, options); } /// <summary> /// Returns configuration for an Object Lambda Access Point. /// /// /// <para> /// The following actions are related to <code>GetAccessPointConfigurationForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointConfigurationForObjectLambda.html">PutAccessPointConfigurationForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetAccessPointConfigurationForObjectLambda service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetAccessPointConfigurationForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointConfigurationForObjectLambda">REST API Reference for GetAccessPointConfigurationForObjectLambda Operation</seealso> public virtual Task<GetAccessPointConfigurationForObjectLambdaResponse> GetAccessPointConfigurationForObjectLambdaAsync(GetAccessPointConfigurationForObjectLambdaRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetAccessPointConfigurationForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = GetAccessPointConfigurationForObjectLambdaResponseUnmarshaller.Instance; return InvokeAsync<GetAccessPointConfigurationForObjectLambdaResponse>(request, options, cancellationToken); } #endregion #region GetAccessPointForObjectLambda /// <summary> /// Returns configuration information about the specified Object Lambda Access Point /// /// /// <para> /// The following actions are related to <code>GetAccessPointForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPointForObjectLambda.html">CreateAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointForObjectLambda.html">DeleteAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPointsForObjectLambda.html">ListAccessPointsForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetAccessPointForObjectLambda service method.</param> /// /// <returns>The response from the GetAccessPointForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointForObjectLambda">REST API Reference for GetAccessPointForObjectLambda Operation</seealso> public virtual GetAccessPointForObjectLambdaResponse GetAccessPointForObjectLambda(GetAccessPointForObjectLambdaRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetAccessPointForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = GetAccessPointForObjectLambdaResponseUnmarshaller.Instance; return Invoke<GetAccessPointForObjectLambdaResponse>(request, options); } /// <summary> /// Returns configuration information about the specified Object Lambda Access Point /// /// /// <para> /// The following actions are related to <code>GetAccessPointForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPointForObjectLambda.html">CreateAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointForObjectLambda.html">DeleteAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPointsForObjectLambda.html">ListAccessPointsForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetAccessPointForObjectLambda service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetAccessPointForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointForObjectLambda">REST API Reference for GetAccessPointForObjectLambda Operation</seealso> public virtual Task<GetAccessPointForObjectLambdaResponse> GetAccessPointForObjectLambdaAsync(GetAccessPointForObjectLambdaRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetAccessPointForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = GetAccessPointForObjectLambdaResponseUnmarshaller.Instance; return InvokeAsync<GetAccessPointForObjectLambdaResponse>(request, options, cancellationToken); } #endregion #region GetAccessPointPolicy /// <summary> /// Returns the access point policy associated with the specified access point. /// /// /// <para> /// The following actions are related to <code>GetAccessPointPolicy</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicy.html">PutAccessPointPolicy</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicy.html">DeleteAccessPointPolicy</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetAccessPointPolicy service method.</param> /// /// <returns>The response from the GetAccessPointPolicy service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointPolicy">REST API Reference for GetAccessPointPolicy Operation</seealso> public virtual GetAccessPointPolicyResponse GetAccessPointPolicy(GetAccessPointPolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetAccessPointPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = GetAccessPointPolicyResponseUnmarshaller.Instance; return Invoke<GetAccessPointPolicyResponse>(request, options); } /// <summary> /// Returns the access point policy associated with the specified access point. /// /// /// <para> /// The following actions are related to <code>GetAccessPointPolicy</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicy.html">PutAccessPointPolicy</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicy.html">DeleteAccessPointPolicy</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetAccessPointPolicy service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetAccessPointPolicy service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointPolicy">REST API Reference for GetAccessPointPolicy Operation</seealso> public virtual Task<GetAccessPointPolicyResponse> GetAccessPointPolicyAsync(GetAccessPointPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetAccessPointPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = GetAccessPointPolicyResponseUnmarshaller.Instance; return InvokeAsync<GetAccessPointPolicyResponse>(request, options, cancellationToken); } #endregion #region GetAccessPointPolicyForObjectLambda /// <summary> /// Returns the resource policy for an Object Lambda Access Point. /// /// /// <para> /// The following actions are related to <code>GetAccessPointPolicyForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicyForObjectLambda.html">DeleteAccessPointPolicyForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicyForObjectLambda.html">PutAccessPointPolicyForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetAccessPointPolicyForObjectLambda service method.</param> /// /// <returns>The response from the GetAccessPointPolicyForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointPolicyForObjectLambda">REST API Reference for GetAccessPointPolicyForObjectLambda Operation</seealso> public virtual GetAccessPointPolicyForObjectLambdaResponse GetAccessPointPolicyForObjectLambda(GetAccessPointPolicyForObjectLambdaRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetAccessPointPolicyForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = GetAccessPointPolicyForObjectLambdaResponseUnmarshaller.Instance; return Invoke<GetAccessPointPolicyForObjectLambdaResponse>(request, options); } /// <summary> /// Returns the resource policy for an Object Lambda Access Point. /// /// /// <para> /// The following actions are related to <code>GetAccessPointPolicyForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicyForObjectLambda.html">DeleteAccessPointPolicyForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicyForObjectLambda.html">PutAccessPointPolicyForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetAccessPointPolicyForObjectLambda service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetAccessPointPolicyForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointPolicyForObjectLambda">REST API Reference for GetAccessPointPolicyForObjectLambda Operation</seealso> public virtual Task<GetAccessPointPolicyForObjectLambdaResponse> GetAccessPointPolicyForObjectLambdaAsync(GetAccessPointPolicyForObjectLambdaRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetAccessPointPolicyForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = GetAccessPointPolicyForObjectLambdaResponseUnmarshaller.Instance; return InvokeAsync<GetAccessPointPolicyForObjectLambdaResponse>(request, options, cancellationToken); } #endregion #region GetAccessPointPolicyStatus /// <summary> /// Indicates whether the specified access point currently has a policy that allows public /// access. For more information about public access through access points, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html">Managing /// Data Access with Amazon S3 Access Points</a> in the <i>Amazon Simple Storage Service /// Developer Guide</i>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetAccessPointPolicyStatus service method.</param> /// /// <returns>The response from the GetAccessPointPolicyStatus service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointPolicyStatus">REST API Reference for GetAccessPointPolicyStatus Operation</seealso> public virtual GetAccessPointPolicyStatusResponse GetAccessPointPolicyStatus(GetAccessPointPolicyStatusRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetAccessPointPolicyStatusRequestMarshaller.Instance; options.ResponseUnmarshaller = GetAccessPointPolicyStatusResponseUnmarshaller.Instance; return Invoke<GetAccessPointPolicyStatusResponse>(request, options); } /// <summary> /// Indicates whether the specified access point currently has a policy that allows public /// access. For more information about public access through access points, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html">Managing /// Data Access with Amazon S3 Access Points</a> in the <i>Amazon Simple Storage Service /// Developer Guide</i>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetAccessPointPolicyStatus service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetAccessPointPolicyStatus service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointPolicyStatus">REST API Reference for GetAccessPointPolicyStatus Operation</seealso> public virtual Task<GetAccessPointPolicyStatusResponse> GetAccessPointPolicyStatusAsync(GetAccessPointPolicyStatusRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetAccessPointPolicyStatusRequestMarshaller.Instance; options.ResponseUnmarshaller = GetAccessPointPolicyStatusResponseUnmarshaller.Instance; return InvokeAsync<GetAccessPointPolicyStatusResponse>(request, options, cancellationToken); } #endregion #region GetAccessPointPolicyStatusForObjectLambda /// <summary> /// Returns the status of the resource policy associated with an Object Lambda Access /// Point. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetAccessPointPolicyStatusForObjectLambda service method.</param> /// /// <returns>The response from the GetAccessPointPolicyStatusForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointPolicyStatusForObjectLambda">REST API Reference for GetAccessPointPolicyStatusForObjectLambda Operation</seealso> public virtual GetAccessPointPolicyStatusForObjectLambdaResponse GetAccessPointPolicyStatusForObjectLambda(GetAccessPointPolicyStatusForObjectLambdaRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetAccessPointPolicyStatusForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = GetAccessPointPolicyStatusForObjectLambdaResponseUnmarshaller.Instance; return Invoke<GetAccessPointPolicyStatusForObjectLambdaResponse>(request, options); } /// <summary> /// Returns the status of the resource policy associated with an Object Lambda Access /// Point. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetAccessPointPolicyStatusForObjectLambda service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetAccessPointPolicyStatusForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointPolicyStatusForObjectLambda">REST API Reference for GetAccessPointPolicyStatusForObjectLambda Operation</seealso> public virtual Task<GetAccessPointPolicyStatusForObjectLambdaResponse> GetAccessPointPolicyStatusForObjectLambdaAsync(GetAccessPointPolicyStatusForObjectLambdaRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetAccessPointPolicyStatusForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = GetAccessPointPolicyStatusForObjectLambdaResponseUnmarshaller.Instance; return InvokeAsync<GetAccessPointPolicyStatusForObjectLambdaResponse>(request, options, cancellationToken); } #endregion #region GetBucket /// <summary> /// Gets an Amazon S3 on Outposts bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html"> /// Using Amazon S3 on Outposts</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// If you are using an identity other than the root user of the AWS account that owns /// the Outposts bucket, the calling identity must have the <code>s3-outposts:GetBucket</code> /// permissions on the specified Outposts bucket and belong to the Outposts bucket owner's /// account in order to use this action. Only users from Outposts bucket owner account /// with the right permissions can perform actions on an Outposts bucket. /// </para> /// /// <para> /// If you don't have <code>s3-outposts:GetBucket</code> permissions or you're not using /// an identity that belongs to the bucket owner's account, Amazon S3 returns a <code>403 /// Access Denied</code> error. /// </para> /// /// <para> /// The following actions are related to <code>GetBucket</code> for Amazon S3 on Outposts: /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucket.html#API_control_GetBucket_Examples">Examples</a> /// section. /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html">PutObject</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html">CreateBucket</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucket.html">DeleteBucket</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetBucket service method.</param> /// /// <returns>The response from the GetBucket service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetBucket">REST API Reference for GetBucket Operation</seealso> public virtual GetBucketResponse GetBucket(GetBucketRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetBucketRequestMarshaller.Instance; options.ResponseUnmarshaller = GetBucketResponseUnmarshaller.Instance; return Invoke<GetBucketResponse>(request, options); } /// <summary> /// Gets an Amazon S3 on Outposts bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html"> /// Using Amazon S3 on Outposts</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// If you are using an identity other than the root user of the AWS account that owns /// the Outposts bucket, the calling identity must have the <code>s3-outposts:GetBucket</code> /// permissions on the specified Outposts bucket and belong to the Outposts bucket owner's /// account in order to use this action. Only users from Outposts bucket owner account /// with the right permissions can perform actions on an Outposts bucket. /// </para> /// /// <para> /// If you don't have <code>s3-outposts:GetBucket</code> permissions or you're not using /// an identity that belongs to the bucket owner's account, Amazon S3 returns a <code>403 /// Access Denied</code> error. /// </para> /// /// <para> /// The following actions are related to <code>GetBucket</code> for Amazon S3 on Outposts: /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucket.html#API_control_GetBucket_Examples">Examples</a> /// section. /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html">PutObject</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html">CreateBucket</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucket.html">DeleteBucket</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetBucket service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetBucket service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetBucket">REST API Reference for GetBucket Operation</seealso> public virtual Task<GetBucketResponse> GetBucketAsync(GetBucketRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetBucketRequestMarshaller.Instance; options.ResponseUnmarshaller = GetBucketResponseUnmarshaller.Instance; return InvokeAsync<GetBucketResponse>(request, options, cancellationToken); } #endregion #region GetBucketLifecycleConfiguration /// <summary> /// <note> /// <para> /// This action gets an Amazon S3 on Outposts bucket's lifecycle configuration. To get /// an S3 bucket's lifecycle configuration, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html">GetBucketLifecycleConfiguration</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Returns the lifecycle configuration information set on the Outposts bucket. For more /// information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> and for information about lifecycle configuration, see <a /// href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html"> /// Object Lifecycle Management</a> in <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// To use this action, you must have permission to perform the <code>s3-outposts:GetLifecycleConfiguration</code> /// action. The Outposts bucket owner has this permission, by default. The bucket owner /// can grant this permission to others. For more information about permissions, see <a /// href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources">Permissions /// Related to Bucket Subresource Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing /// Access Permissions to Your Amazon S3 Resources</a>. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketLifecycleConfiguration.html#API_control_GetBucketLifecycleConfiguration_Examples">Examples</a> /// section. /// </para> /// /// <para> /// <code>GetBucketLifecycleConfiguration</code> has the following special error: /// </para> /// <ul> <li> /// <para> /// Error code: <code>NoSuchLifecycleConfiguration</code> /// </para> /// <ul> <li> /// <para> /// Description: The lifecycle configuration does not exist. /// </para> /// </li> <li> /// <para> /// HTTP Status Code: 404 Not Found /// </para> /// </li> <li> /// <para> /// SOAP Fault Code Prefix: Client /// </para> /// </li> </ul> </li> </ul> /// <para> /// The following actions are related to <code>GetBucketLifecycleConfiguration</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketLifecycleConfiguration.html">PutBucketLifecycleConfiguration</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketLifecycleConfiguration.html">DeleteBucketLifecycleConfiguration</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetBucketLifecycleConfiguration service method.</param> /// /// <returns>The response from the GetBucketLifecycleConfiguration service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetBucketLifecycleConfiguration">REST API Reference for GetBucketLifecycleConfiguration Operation</seealso> public virtual GetBucketLifecycleConfigurationResponse GetBucketLifecycleConfiguration(GetBucketLifecycleConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetBucketLifecycleConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetBucketLifecycleConfigurationResponseUnmarshaller.Instance; return Invoke<GetBucketLifecycleConfigurationResponse>(request, options); } /// <summary> /// <note> /// <para> /// This action gets an Amazon S3 on Outposts bucket's lifecycle configuration. To get /// an S3 bucket's lifecycle configuration, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html">GetBucketLifecycleConfiguration</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Returns the lifecycle configuration information set on the Outposts bucket. For more /// information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> and for information about lifecycle configuration, see <a /// href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html"> /// Object Lifecycle Management</a> in <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// To use this action, you must have permission to perform the <code>s3-outposts:GetLifecycleConfiguration</code> /// action. The Outposts bucket owner has this permission, by default. The bucket owner /// can grant this permission to others. For more information about permissions, see <a /// href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources">Permissions /// Related to Bucket Subresource Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing /// Access Permissions to Your Amazon S3 Resources</a>. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketLifecycleConfiguration.html#API_control_GetBucketLifecycleConfiguration_Examples">Examples</a> /// section. /// </para> /// /// <para> /// <code>GetBucketLifecycleConfiguration</code> has the following special error: /// </para> /// <ul> <li> /// <para> /// Error code: <code>NoSuchLifecycleConfiguration</code> /// </para> /// <ul> <li> /// <para> /// Description: The lifecycle configuration does not exist. /// </para> /// </li> <li> /// <para> /// HTTP Status Code: 404 Not Found /// </para> /// </li> <li> /// <para> /// SOAP Fault Code Prefix: Client /// </para> /// </li> </ul> </li> </ul> /// <para> /// The following actions are related to <code>GetBucketLifecycleConfiguration</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketLifecycleConfiguration.html">PutBucketLifecycleConfiguration</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketLifecycleConfiguration.html">DeleteBucketLifecycleConfiguration</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetBucketLifecycleConfiguration service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetBucketLifecycleConfiguration service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetBucketLifecycleConfiguration">REST API Reference for GetBucketLifecycleConfiguration Operation</seealso> public virtual Task<GetBucketLifecycleConfigurationResponse> GetBucketLifecycleConfigurationAsync(GetBucketLifecycleConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetBucketLifecycleConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetBucketLifecycleConfigurationResponseUnmarshaller.Instance; return InvokeAsync<GetBucketLifecycleConfigurationResponse>(request, options, cancellationToken); } #endregion #region GetBucketPolicy /// <summary> /// <note> /// <para> /// This action gets a bucket policy for an Amazon S3 on Outposts bucket. To get a policy /// for an S3 bucket, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicy.html">GetBucketPolicy</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Returns the policy of a specified Outposts bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// If you are using an identity other than the root user of the AWS account that owns /// the bucket, the calling identity must have the <code>GetBucketPolicy</code> permissions /// on the specified bucket and belong to the bucket owner's account in order to use this /// action. /// </para> /// /// <para> /// Only users from Outposts bucket owner account with the right permissions can perform /// actions on an Outposts bucket. If you don't have <code>s3-outposts:GetBucketPolicy</code> /// permissions or you're not using an identity that belongs to the bucket owner's account, /// Amazon S3 returns a <code>403 Access Denied</code> error. /// </para> /// <important> /// <para> /// As a security precaution, the root user of the AWS account that owns a bucket can /// always use this action, even if the policy explicitly denies the root user the ability /// to perform this action. /// </para> /// </important> /// <para> /// For more information about bucket policies, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html">Using /// Bucket Policies and User Policies</a>. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketPolicy.html#API_control_GetBucketPolicy_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>GetBucketPolicy</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html">GetObject</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketPolicy.html">PutBucketPolicy</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketPolicy.html">DeleteBucketPolicy</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetBucketPolicy service method.</param> /// /// <returns>The response from the GetBucketPolicy service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetBucketPolicy">REST API Reference for GetBucketPolicy Operation</seealso> public virtual GetBucketPolicyResponse GetBucketPolicy(GetBucketPolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetBucketPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = GetBucketPolicyResponseUnmarshaller.Instance; return Invoke<GetBucketPolicyResponse>(request, options); } /// <summary> /// <note> /// <para> /// This action gets a bucket policy for an Amazon S3 on Outposts bucket. To get a policy /// for an S3 bucket, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicy.html">GetBucketPolicy</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Returns the policy of a specified Outposts bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// If you are using an identity other than the root user of the AWS account that owns /// the bucket, the calling identity must have the <code>GetBucketPolicy</code> permissions /// on the specified bucket and belong to the bucket owner's account in order to use this /// action. /// </para> /// /// <para> /// Only users from Outposts bucket owner account with the right permissions can perform /// actions on an Outposts bucket. If you don't have <code>s3-outposts:GetBucketPolicy</code> /// permissions or you're not using an identity that belongs to the bucket owner's account, /// Amazon S3 returns a <code>403 Access Denied</code> error. /// </para> /// <important> /// <para> /// As a security precaution, the root user of the AWS account that owns a bucket can /// always use this action, even if the policy explicitly denies the root user the ability /// to perform this action. /// </para> /// </important> /// <para> /// For more information about bucket policies, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html">Using /// Bucket Policies and User Policies</a>. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketPolicy.html#API_control_GetBucketPolicy_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>GetBucketPolicy</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html">GetObject</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketPolicy.html">PutBucketPolicy</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketPolicy.html">DeleteBucketPolicy</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetBucketPolicy service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetBucketPolicy service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetBucketPolicy">REST API Reference for GetBucketPolicy Operation</seealso> public virtual Task<GetBucketPolicyResponse> GetBucketPolicyAsync(GetBucketPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetBucketPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = GetBucketPolicyResponseUnmarshaller.Instance; return InvokeAsync<GetBucketPolicyResponse>(request, options, cancellationToken); } #endregion #region GetBucketTagging /// <summary> /// <note> /// <para> /// This action gets an Amazon S3 on Outposts bucket's tags. To get an S3 bucket tags, /// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html">GetBucketTagging</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Returns the tag set associated with the Outposts bucket. For more information, see /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// To use this action, you must have permission to perform the <code>GetBucketTagging</code> /// action. By default, the bucket owner has this permission and can grant this permission /// to others. /// </para> /// /// <para> /// <code>GetBucketTagging</code> has the following special error: /// </para> /// <ul> <li> /// <para> /// Error code: <code>NoSuchTagSetError</code> /// </para> /// <ul> <li> /// <para> /// Description: There is no tag set associated with the bucket. /// </para> /// </li> </ul> </li> </ul> /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketTagging.html#API_control_GetBucketTagging_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>GetBucketTagging</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketTagging.html">PutBucketTagging</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketTagging.html">DeleteBucketTagging</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetBucketTagging service method.</param> /// /// <returns>The response from the GetBucketTagging service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetBucketTagging">REST API Reference for GetBucketTagging Operation</seealso> public virtual GetBucketTaggingResponse GetBucketTagging(GetBucketTaggingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetBucketTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = GetBucketTaggingResponseUnmarshaller.Instance; return Invoke<GetBucketTaggingResponse>(request, options); } /// <summary> /// <note> /// <para> /// This action gets an Amazon S3 on Outposts bucket's tags. To get an S3 bucket tags, /// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html">GetBucketTagging</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Returns the tag set associated with the Outposts bucket. For more information, see /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// To use this action, you must have permission to perform the <code>GetBucketTagging</code> /// action. By default, the bucket owner has this permission and can grant this permission /// to others. /// </para> /// /// <para> /// <code>GetBucketTagging</code> has the following special error: /// </para> /// <ul> <li> /// <para> /// Error code: <code>NoSuchTagSetError</code> /// </para> /// <ul> <li> /// <para> /// Description: There is no tag set associated with the bucket. /// </para> /// </li> </ul> </li> </ul> /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketTagging.html#API_control_GetBucketTagging_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>GetBucketTagging</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketTagging.html">PutBucketTagging</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketTagging.html">DeleteBucketTagging</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetBucketTagging service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetBucketTagging service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetBucketTagging">REST API Reference for GetBucketTagging Operation</seealso> public virtual Task<GetBucketTaggingResponse> GetBucketTaggingAsync(GetBucketTaggingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetBucketTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = GetBucketTaggingResponseUnmarshaller.Instance; return InvokeAsync<GetBucketTaggingResponse>(request, options, cancellationToken); } #endregion #region GetJobTagging /// <summary> /// Returns the tags on an S3 Batch Operations job. To use this operation, you must have /// permission to perform the <code>s3:GetJobTagging</code> action. For more information, /// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-managing-jobs.html#batch-ops-job-tags">Controlling /// access and labeling jobs using tags</a> in the <i>Amazon Simple Storage Service User /// Guide</i>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutJobTagging.html">PutJobTagging</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteJobTagging.html">DeleteJobTagging</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetJobTagging service method.</param> /// /// <returns>The response from the GetJobTagging service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.NotFoundException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyRequestsException"> /// /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetJobTagging">REST API Reference for GetJobTagging Operation</seealso> public virtual GetJobTaggingResponse GetJobTagging(GetJobTaggingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetJobTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = GetJobTaggingResponseUnmarshaller.Instance; return Invoke<GetJobTaggingResponse>(request, options); } /// <summary> /// Returns the tags on an S3 Batch Operations job. To use this operation, you must have /// permission to perform the <code>s3:GetJobTagging</code> action. For more information, /// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-managing-jobs.html#batch-ops-job-tags">Controlling /// access and labeling jobs using tags</a> in the <i>Amazon Simple Storage Service User /// Guide</i>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutJobTagging.html">PutJobTagging</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteJobTagging.html">DeleteJobTagging</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetJobTagging service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetJobTagging service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.NotFoundException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyRequestsException"> /// /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetJobTagging">REST API Reference for GetJobTagging Operation</seealso> public virtual Task<GetJobTaggingResponse> GetJobTaggingAsync(GetJobTaggingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetJobTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = GetJobTaggingResponseUnmarshaller.Instance; return InvokeAsync<GetJobTaggingResponse>(request, options, cancellationToken); } #endregion #region GetPublicAccessBlock /// <summary> /// Retrieves the <code>PublicAccessBlock</code> configuration for an AWS account. For /// more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html"> /// Using Amazon S3 block public access</a>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeletePublicAccessBlock.html">DeletePublicAccessBlock</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutPublicAccessBlock.html">PutPublicAccessBlock</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetPublicAccessBlock service method.</param> /// /// <returns>The response from the GetPublicAccessBlock service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.NoSuchPublicAccessBlockConfigurationException"> /// Amazon S3 throws this exception if you make a <code>GetPublicAccessBlock</code> request /// against an account that doesn't have a <code>PublicAccessBlockConfiguration</code> /// set. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetPublicAccessBlock">REST API Reference for GetPublicAccessBlock Operation</seealso> public virtual GetPublicAccessBlockResponse GetPublicAccessBlock(GetPublicAccessBlockRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetPublicAccessBlockRequestMarshaller.Instance; options.ResponseUnmarshaller = GetPublicAccessBlockResponseUnmarshaller.Instance; return Invoke<GetPublicAccessBlockResponse>(request, options); } /// <summary> /// Retrieves the <code>PublicAccessBlock</code> configuration for an AWS account. For /// more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html"> /// Using Amazon S3 block public access</a>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeletePublicAccessBlock.html">DeletePublicAccessBlock</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutPublicAccessBlock.html">PutPublicAccessBlock</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetPublicAccessBlock service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetPublicAccessBlock service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.NoSuchPublicAccessBlockConfigurationException"> /// Amazon S3 throws this exception if you make a <code>GetPublicAccessBlock</code> request /// against an account that doesn't have a <code>PublicAccessBlockConfiguration</code> /// set. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetPublicAccessBlock">REST API Reference for GetPublicAccessBlock Operation</seealso> public virtual Task<GetPublicAccessBlockResponse> GetPublicAccessBlockAsync(GetPublicAccessBlockRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetPublicAccessBlockRequestMarshaller.Instance; options.ResponseUnmarshaller = GetPublicAccessBlockResponseUnmarshaller.Instance; return InvokeAsync<GetPublicAccessBlockResponse>(request, options, cancellationToken); } #endregion #region GetStorageLensConfiguration /// <summary> /// Gets the Amazon S3 Storage Lens configuration. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Assessing /// your storage activity and usage with Amazon S3 Storage Lens </a> in the <i>Amazon /// Simple Storage Service User Guide</i>. /// /// <note> /// <para> /// To use this action, you must have permission to perform the <code>s3:GetStorageLensConfiguration</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting /// permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetStorageLensConfiguration service method.</param> /// /// <returns>The response from the GetStorageLensConfiguration service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetStorageLensConfiguration">REST API Reference for GetStorageLensConfiguration Operation</seealso> public virtual GetStorageLensConfigurationResponse GetStorageLensConfiguration(GetStorageLensConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetStorageLensConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetStorageLensConfigurationResponseUnmarshaller.Instance; return Invoke<GetStorageLensConfigurationResponse>(request, options); } /// <summary> /// Gets the Amazon S3 Storage Lens configuration. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Assessing /// your storage activity and usage with Amazon S3 Storage Lens </a> in the <i>Amazon /// Simple Storage Service User Guide</i>. /// /// <note> /// <para> /// To use this action, you must have permission to perform the <code>s3:GetStorageLensConfiguration</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting /// permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetStorageLensConfiguration service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetStorageLensConfiguration service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetStorageLensConfiguration">REST API Reference for GetStorageLensConfiguration Operation</seealso> public virtual Task<GetStorageLensConfigurationResponse> GetStorageLensConfigurationAsync(GetStorageLensConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetStorageLensConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetStorageLensConfigurationResponseUnmarshaller.Instance; return InvokeAsync<GetStorageLensConfigurationResponse>(request, options, cancellationToken); } #endregion #region GetStorageLensConfigurationTagging /// <summary> /// Gets the tags of Amazon S3 Storage Lens configuration. For more information about /// S3 Storage Lens, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Assessing /// your storage activity and usage with Amazon S3 Storage Lens </a> in the <i>Amazon /// Simple Storage Service User Guide</i>. /// /// <note> /// <para> /// To use this action, you must have permission to perform the <code>s3:GetStorageLensConfigurationTagging</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting /// permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetStorageLensConfigurationTagging service method.</param> /// /// <returns>The response from the GetStorageLensConfigurationTagging service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetStorageLensConfigurationTagging">REST API Reference for GetStorageLensConfigurationTagging Operation</seealso> public virtual GetStorageLensConfigurationTaggingResponse GetStorageLensConfigurationTagging(GetStorageLensConfigurationTaggingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetStorageLensConfigurationTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = GetStorageLensConfigurationTaggingResponseUnmarshaller.Instance; return Invoke<GetStorageLensConfigurationTaggingResponse>(request, options); } /// <summary> /// Gets the tags of Amazon S3 Storage Lens configuration. For more information about /// S3 Storage Lens, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Assessing /// your storage activity and usage with Amazon S3 Storage Lens </a> in the <i>Amazon /// Simple Storage Service User Guide</i>. /// /// <note> /// <para> /// To use this action, you must have permission to perform the <code>s3:GetStorageLensConfigurationTagging</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting /// permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetStorageLensConfigurationTagging service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetStorageLensConfigurationTagging service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetStorageLensConfigurationTagging">REST API Reference for GetStorageLensConfigurationTagging Operation</seealso> public virtual Task<GetStorageLensConfigurationTaggingResponse> GetStorageLensConfigurationTaggingAsync(GetStorageLensConfigurationTaggingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetStorageLensConfigurationTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = GetStorageLensConfigurationTaggingResponseUnmarshaller.Instance; return InvokeAsync<GetStorageLensConfigurationTaggingResponse>(request, options, cancellationToken); } #endregion #region ListAccessPoints /// <summary> /// Returns a list of the access points currently associated with the specified bucket. /// You can retrieve up to 1000 access points per call. If the specified bucket has more /// than 1,000 access points (or the number specified in <code>maxResults</code>, whichever /// is less), the response will include a continuation token that you can use to list /// the additional access points. /// /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html#API_control_GetAccessPoint_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>ListAccessPoints</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPoint.html">CreateAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPoint.html">DeleteAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html">GetAccessPoint</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAccessPoints service method.</param> /// /// <returns>The response from the ListAccessPoints service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListAccessPoints">REST API Reference for ListAccessPoints Operation</seealso> public virtual ListAccessPointsResponse ListAccessPoints(ListAccessPointsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListAccessPointsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAccessPointsResponseUnmarshaller.Instance; return Invoke<ListAccessPointsResponse>(request, options); } /// <summary> /// Returns a list of the access points currently associated with the specified bucket. /// You can retrieve up to 1000 access points per call. If the specified bucket has more /// than 1,000 access points (or the number specified in <code>maxResults</code>, whichever /// is less), the response will include a continuation token that you can use to list /// the additional access points. /// /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html#API_control_GetAccessPoint_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>ListAccessPoints</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPoint.html">CreateAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPoint.html">DeleteAccessPoint</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html">GetAccessPoint</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAccessPoints service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListAccessPoints service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListAccessPoints">REST API Reference for ListAccessPoints Operation</seealso> public virtual Task<ListAccessPointsResponse> ListAccessPointsAsync(ListAccessPointsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListAccessPointsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAccessPointsResponseUnmarshaller.Instance; return InvokeAsync<ListAccessPointsResponse>(request, options, cancellationToken); } #endregion #region ListAccessPointsForObjectLambda /// <summary> /// Returns a list of the access points associated with the Object Lambda Access Point. /// You can retrieve up to 1000 access points per call. If there are more than 1,000 access /// points (or the number specified in <code>maxResults</code>, whichever is less), the /// response will include a continuation token that you can use to list the additional /// access points. /// /// /// <para> /// The following actions are related to <code>ListAccessPointsForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPointForObjectLambda.html">CreateAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointForObjectLambda.html">DeleteAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointForObjectLambda.html">GetAccessPointForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAccessPointsForObjectLambda service method.</param> /// /// <returns>The response from the ListAccessPointsForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListAccessPointsForObjectLambda">REST API Reference for ListAccessPointsForObjectLambda Operation</seealso> public virtual ListAccessPointsForObjectLambdaResponse ListAccessPointsForObjectLambda(ListAccessPointsForObjectLambdaRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListAccessPointsForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAccessPointsForObjectLambdaResponseUnmarshaller.Instance; return Invoke<ListAccessPointsForObjectLambdaResponse>(request, options); } /// <summary> /// Returns a list of the access points associated with the Object Lambda Access Point. /// You can retrieve up to 1000 access points per call. If there are more than 1,000 access /// points (or the number specified in <code>maxResults</code>, whichever is less), the /// response will include a continuation token that you can use to list the additional /// access points. /// /// /// <para> /// The following actions are related to <code>ListAccessPointsForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPointForObjectLambda.html">CreateAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointForObjectLambda.html">DeleteAccessPointForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointForObjectLambda.html">GetAccessPointForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAccessPointsForObjectLambda service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListAccessPointsForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListAccessPointsForObjectLambda">REST API Reference for ListAccessPointsForObjectLambda Operation</seealso> public virtual Task<ListAccessPointsForObjectLambdaResponse> ListAccessPointsForObjectLambdaAsync(ListAccessPointsForObjectLambdaRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListAccessPointsForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAccessPointsForObjectLambdaResponseUnmarshaller.Instance; return InvokeAsync<ListAccessPointsForObjectLambdaResponse>(request, options, cancellationToken); } #endregion #region ListJobs /// <summary> /// Lists current S3 Batch Operations jobs and jobs that have ended within the last 30 /// days for the AWS account making the request. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-basics.html">S3 /// Batch Operations</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html">DescribeJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobPriority.html">UpdateJobPriority</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html">UpdateJobStatus</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListJobs service method.</param> /// /// <returns>The response from the ListJobs service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.InvalidNextTokenException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.InvalidRequestException"> /// /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListJobs">REST API Reference for ListJobs Operation</seealso> public virtual ListJobsResponse ListJobs(ListJobsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListJobsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListJobsResponseUnmarshaller.Instance; return Invoke<ListJobsResponse>(request, options); } /// <summary> /// Lists current S3 Batch Operations jobs and jobs that have ended within the last 30 /// days for the AWS account making the request. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-basics.html">S3 /// Batch Operations</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html">DescribeJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobPriority.html">UpdateJobPriority</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html">UpdateJobStatus</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListJobs service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListJobs service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.InvalidNextTokenException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.InvalidRequestException"> /// /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListJobs">REST API Reference for ListJobs Operation</seealso> public virtual Task<ListJobsResponse> ListJobsAsync(ListJobsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListJobsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListJobsResponseUnmarshaller.Instance; return InvokeAsync<ListJobsResponse>(request, options, cancellationToken); } #endregion #region ListRegionalBuckets /// <summary> /// Returns a list of all Outposts buckets in an Outpost that are owned by the authenticated /// sender of the request. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on /// Outposts endpoint hostname prefix and <code>x-amz-outpost-id</code> in your request, /// see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListRegionalBuckets.html#API_control_ListRegionalBuckets_Examples">Examples</a> /// section. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListRegionalBuckets service method.</param> /// /// <returns>The response from the ListRegionalBuckets service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListRegionalBuckets">REST API Reference for ListRegionalBuckets Operation</seealso> public virtual ListRegionalBucketsResponse ListRegionalBuckets(ListRegionalBucketsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListRegionalBucketsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListRegionalBucketsResponseUnmarshaller.Instance; return Invoke<ListRegionalBucketsResponse>(request, options); } /// <summary> /// Returns a list of all Outposts buckets in an Outpost that are owned by the authenticated /// sender of the request. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on /// Outposts endpoint hostname prefix and <code>x-amz-outpost-id</code> in your request, /// see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListRegionalBuckets.html#API_control_ListRegionalBuckets_Examples">Examples</a> /// section. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListRegionalBuckets service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListRegionalBuckets service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListRegionalBuckets">REST API Reference for ListRegionalBuckets Operation</seealso> public virtual Task<ListRegionalBucketsResponse> ListRegionalBucketsAsync(ListRegionalBucketsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListRegionalBucketsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListRegionalBucketsResponseUnmarshaller.Instance; return InvokeAsync<ListRegionalBucketsResponse>(request, options, cancellationToken); } #endregion #region ListStorageLensConfigurations /// <summary> /// Gets a list of Amazon S3 Storage Lens configurations. For more information about S3 /// Storage Lens, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Assessing /// your storage activity and usage with Amazon S3 Storage Lens </a> in the <i>Amazon /// Simple Storage Service User Guide</i>. /// /// <note> /// <para> /// To use this action, you must have permission to perform the <code>s3:ListStorageLensConfigurations</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting /// permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListStorageLensConfigurations service method.</param> /// /// <returns>The response from the ListStorageLensConfigurations service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListStorageLensConfigurations">REST API Reference for ListStorageLensConfigurations Operation</seealso> public virtual ListStorageLensConfigurationsResponse ListStorageLensConfigurations(ListStorageLensConfigurationsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListStorageLensConfigurationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListStorageLensConfigurationsResponseUnmarshaller.Instance; return Invoke<ListStorageLensConfigurationsResponse>(request, options); } /// <summary> /// Gets a list of Amazon S3 Storage Lens configurations. For more information about S3 /// Storage Lens, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Assessing /// your storage activity and usage with Amazon S3 Storage Lens </a> in the <i>Amazon /// Simple Storage Service User Guide</i>. /// /// <note> /// <para> /// To use this action, you must have permission to perform the <code>s3:ListStorageLensConfigurations</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting /// permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListStorageLensConfigurations service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListStorageLensConfigurations service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListStorageLensConfigurations">REST API Reference for ListStorageLensConfigurations Operation</seealso> public virtual Task<ListStorageLensConfigurationsResponse> ListStorageLensConfigurationsAsync(ListStorageLensConfigurationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListStorageLensConfigurationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListStorageLensConfigurationsResponseUnmarshaller.Instance; return InvokeAsync<ListStorageLensConfigurationsResponse>(request, options, cancellationToken); } #endregion #region PutAccessPointConfigurationForObjectLambda /// <summary> /// Replaces configuration for an Object Lambda Access Point. /// /// /// <para> /// The following actions are related to <code>PutAccessPointConfigurationForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointConfigurationForObjectLambda.html">GetAccessPointConfigurationForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutAccessPointConfigurationForObjectLambda service method.</param> /// /// <returns>The response from the PutAccessPointConfigurationForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutAccessPointConfigurationForObjectLambda">REST API Reference for PutAccessPointConfigurationForObjectLambda Operation</seealso> public virtual PutAccessPointConfigurationForObjectLambdaResponse PutAccessPointConfigurationForObjectLambda(PutAccessPointConfigurationForObjectLambdaRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutAccessPointConfigurationForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = PutAccessPointConfigurationForObjectLambdaResponseUnmarshaller.Instance; return Invoke<PutAccessPointConfigurationForObjectLambdaResponse>(request, options); } /// <summary> /// Replaces configuration for an Object Lambda Access Point. /// /// /// <para> /// The following actions are related to <code>PutAccessPointConfigurationForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointConfigurationForObjectLambda.html">GetAccessPointConfigurationForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutAccessPointConfigurationForObjectLambda service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PutAccessPointConfigurationForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutAccessPointConfigurationForObjectLambda">REST API Reference for PutAccessPointConfigurationForObjectLambda Operation</seealso> public virtual Task<PutAccessPointConfigurationForObjectLambdaResponse> PutAccessPointConfigurationForObjectLambdaAsync(PutAccessPointConfigurationForObjectLambdaRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutAccessPointConfigurationForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = PutAccessPointConfigurationForObjectLambdaResponseUnmarshaller.Instance; return InvokeAsync<PutAccessPointConfigurationForObjectLambdaResponse>(request, options, cancellationToken); } #endregion #region PutAccessPointPolicy /// <summary> /// Associates an access policy with the specified access point. Each access point can /// have only one policy, so a request made to this API replaces any existing policy associated /// with the specified access point. /// /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicy.html#API_control_PutAccessPointPolicy_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>PutAccessPointPolicy</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointPolicy.html">GetAccessPointPolicy</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicy.html">DeleteAccessPointPolicy</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutAccessPointPolicy service method.</param> /// /// <returns>The response from the PutAccessPointPolicy service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutAccessPointPolicy">REST API Reference for PutAccessPointPolicy Operation</seealso> public virtual PutAccessPointPolicyResponse PutAccessPointPolicy(PutAccessPointPolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutAccessPointPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = PutAccessPointPolicyResponseUnmarshaller.Instance; return Invoke<PutAccessPointPolicyResponse>(request, options); } /// <summary> /// Associates an access policy with the specified access point. Each access point can /// have only one policy, so a request made to this API replaces any existing policy associated /// with the specified access point. /// /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicy.html#API_control_PutAccessPointPolicy_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>PutAccessPointPolicy</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointPolicy.html">GetAccessPointPolicy</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicy.html">DeleteAccessPointPolicy</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutAccessPointPolicy service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PutAccessPointPolicy service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutAccessPointPolicy">REST API Reference for PutAccessPointPolicy Operation</seealso> public virtual Task<PutAccessPointPolicyResponse> PutAccessPointPolicyAsync(PutAccessPointPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutAccessPointPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = PutAccessPointPolicyResponseUnmarshaller.Instance; return InvokeAsync<PutAccessPointPolicyResponse>(request, options, cancellationToken); } #endregion #region PutAccessPointPolicyForObjectLambda /// <summary> /// Creates or replaces resource policy for an Object Lambda Access Point. For an example /// policy, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/olap-create.html#olap-create-cli">Creating /// Object Lambda Access Points</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// The following actions are related to <code>PutAccessPointPolicyForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicyForObjectLambda.html">DeleteAccessPointPolicyForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointPolicyForObjectLambda.html">GetAccessPointPolicyForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutAccessPointPolicyForObjectLambda service method.</param> /// /// <returns>The response from the PutAccessPointPolicyForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutAccessPointPolicyForObjectLambda">REST API Reference for PutAccessPointPolicyForObjectLambda Operation</seealso> public virtual PutAccessPointPolicyForObjectLambdaResponse PutAccessPointPolicyForObjectLambda(PutAccessPointPolicyForObjectLambdaRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutAccessPointPolicyForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = PutAccessPointPolicyForObjectLambdaResponseUnmarshaller.Instance; return Invoke<PutAccessPointPolicyForObjectLambdaResponse>(request, options); } /// <summary> /// Creates or replaces resource policy for an Object Lambda Access Point. For an example /// policy, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/olap-create.html#olap-create-cli">Creating /// Object Lambda Access Points</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// The following actions are related to <code>PutAccessPointPolicyForObjectLambda</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicyForObjectLambda.html">DeleteAccessPointPolicyForObjectLambda</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointPolicyForObjectLambda.html">GetAccessPointPolicyForObjectLambda</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutAccessPointPolicyForObjectLambda service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PutAccessPointPolicyForObjectLambda service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutAccessPointPolicyForObjectLambda">REST API Reference for PutAccessPointPolicyForObjectLambda Operation</seealso> public virtual Task<PutAccessPointPolicyForObjectLambdaResponse> PutAccessPointPolicyForObjectLambdaAsync(PutAccessPointPolicyForObjectLambdaRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutAccessPointPolicyForObjectLambdaRequestMarshaller.Instance; options.ResponseUnmarshaller = PutAccessPointPolicyForObjectLambdaResponseUnmarshaller.Instance; return InvokeAsync<PutAccessPointPolicyForObjectLambdaResponse>(request, options, cancellationToken); } #endregion #region PutBucketLifecycleConfiguration /// <summary> /// <note> /// <para> /// This action puts a lifecycle configuration to an Amazon S3 on Outposts bucket. To /// put a lifecycle configuration to an S3 bucket, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html">PutBucketLifecycleConfiguration</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Creates a new lifecycle configuration for the S3 on Outposts bucket or replaces an /// existing lifecycle configuration. Outposts buckets only support lifecycle configurations /// that delete/expire objects after a certain period of time and abort incomplete multipart /// uploads. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketLifecycleConfiguration.html#API_control_PutBucketLifecycleConfiguration_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>PutBucketLifecycleConfiguration</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketLifecycleConfiguration.html">GetBucketLifecycleConfiguration</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketLifecycleConfiguration.html">DeleteBucketLifecycleConfiguration</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutBucketLifecycleConfiguration service method.</param> /// /// <returns>The response from the PutBucketLifecycleConfiguration service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutBucketLifecycleConfiguration">REST API Reference for PutBucketLifecycleConfiguration Operation</seealso> public virtual PutBucketLifecycleConfigurationResponse PutBucketLifecycleConfiguration(PutBucketLifecycleConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutBucketLifecycleConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = PutBucketLifecycleConfigurationResponseUnmarshaller.Instance; return Invoke<PutBucketLifecycleConfigurationResponse>(request, options); } /// <summary> /// <note> /// <para> /// This action puts a lifecycle configuration to an Amazon S3 on Outposts bucket. To /// put a lifecycle configuration to an S3 bucket, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html">PutBucketLifecycleConfiguration</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Creates a new lifecycle configuration for the S3 on Outposts bucket or replaces an /// existing lifecycle configuration. Outposts buckets only support lifecycle configurations /// that delete/expire objects after a certain period of time and abort incomplete multipart /// uploads. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketLifecycleConfiguration.html#API_control_PutBucketLifecycleConfiguration_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>PutBucketLifecycleConfiguration</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketLifecycleConfiguration.html">GetBucketLifecycleConfiguration</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketLifecycleConfiguration.html">DeleteBucketLifecycleConfiguration</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutBucketLifecycleConfiguration service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PutBucketLifecycleConfiguration service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutBucketLifecycleConfiguration">REST API Reference for PutBucketLifecycleConfiguration Operation</seealso> public virtual Task<PutBucketLifecycleConfigurationResponse> PutBucketLifecycleConfigurationAsync(PutBucketLifecycleConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutBucketLifecycleConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = PutBucketLifecycleConfigurationResponseUnmarshaller.Instance; return InvokeAsync<PutBucketLifecycleConfigurationResponse>(request, options, cancellationToken); } #endregion #region PutBucketPolicy /// <summary> /// <note> /// <para> /// This action puts a bucket policy to an Amazon S3 on Outposts bucket. To put a policy /// on an S3 bucket, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketPolicy.html">PutBucketPolicy</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Applies an Amazon S3 bucket policy to an Outposts bucket. For more information, see /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// If you are using an identity other than the root user of the AWS account that owns /// the Outposts bucket, the calling identity must have the <code>PutBucketPolicy</code> /// permissions on the specified Outposts bucket and belong to the bucket owner's account /// in order to use this action. /// </para> /// /// <para> /// If you don't have <code>PutBucketPolicy</code> permissions, Amazon S3 returns a <code>403 /// Access Denied</code> error. If you have the correct permissions, but you're not using /// an identity that belongs to the bucket owner's account, Amazon S3 returns a <code>405 /// Method Not Allowed</code> error. /// </para> /// <important> /// <para> /// As a security precaution, the root user of the AWS account that owns a bucket can /// always use this action, even if the policy explicitly denies the root user the ability /// to perform this action. /// </para> /// </important> /// <para> /// For more information about bucket policies, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html">Using /// Bucket Policies and User Policies</a>. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketPolicy.html#API_control_PutBucketPolicy_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>PutBucketPolicy</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketPolicy.html">GetBucketPolicy</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketPolicy.html">DeleteBucketPolicy</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutBucketPolicy service method.</param> /// /// <returns>The response from the PutBucketPolicy service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutBucketPolicy">REST API Reference for PutBucketPolicy Operation</seealso> public virtual PutBucketPolicyResponse PutBucketPolicy(PutBucketPolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutBucketPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = PutBucketPolicyResponseUnmarshaller.Instance; return Invoke<PutBucketPolicyResponse>(request, options); } /// <summary> /// <note> /// <para> /// This action puts a bucket policy to an Amazon S3 on Outposts bucket. To put a policy /// on an S3 bucket, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketPolicy.html">PutBucketPolicy</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Applies an Amazon S3 bucket policy to an Outposts bucket. For more information, see /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// If you are using an identity other than the root user of the AWS account that owns /// the Outposts bucket, the calling identity must have the <code>PutBucketPolicy</code> /// permissions on the specified Outposts bucket and belong to the bucket owner's account /// in order to use this action. /// </para> /// /// <para> /// If you don't have <code>PutBucketPolicy</code> permissions, Amazon S3 returns a <code>403 /// Access Denied</code> error. If you have the correct permissions, but you're not using /// an identity that belongs to the bucket owner's account, Amazon S3 returns a <code>405 /// Method Not Allowed</code> error. /// </para> /// <important> /// <para> /// As a security precaution, the root user of the AWS account that owns a bucket can /// always use this action, even if the policy explicitly denies the root user the ability /// to perform this action. /// </para> /// </important> /// <para> /// For more information about bucket policies, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html">Using /// Bucket Policies and User Policies</a>. /// </para> /// /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketPolicy.html#API_control_PutBucketPolicy_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>PutBucketPolicy</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketPolicy.html">GetBucketPolicy</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketPolicy.html">DeleteBucketPolicy</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutBucketPolicy service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PutBucketPolicy service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutBucketPolicy">REST API Reference for PutBucketPolicy Operation</seealso> public virtual Task<PutBucketPolicyResponse> PutBucketPolicyAsync(PutBucketPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutBucketPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = PutBucketPolicyResponseUnmarshaller.Instance; return InvokeAsync<PutBucketPolicyResponse>(request, options, cancellationToken); } #endregion #region PutBucketTagging /// <summary> /// <note> /// <para> /// This action puts tags on an Amazon S3 on Outposts bucket. To put tags on an S3 bucket, /// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html">PutBucketTagging</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Sets the tags for an S3 on Outposts bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// Use tags to organize your AWS bill to reflect your own cost structure. To do this, /// sign up to get your AWS account bill with tag key values included. Then, to see the /// cost of combined resources, organize your billing information according to resources /// with the same tag key values. For example, you can tag several resources with a specific /// application name, and then organize your billing information to see the total cost /// of that application across several services. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html">Cost /// allocation and tagging</a>. /// </para> /// <note> /// <para> /// Within a bucket, if you add a tag that has the same key as an existing tag, the new /// value overwrites the old value. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/CostAllocTagging.html"> /// Using cost allocation in Amazon S3 bucket tags</a>. /// </para> /// </note> /// <para> /// To use this action, you must have permissions to perform the <code>s3-outposts:PutBucketTagging</code> /// action. The Outposts bucket owner has this permission by default and can grant this /// permission to others. For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"> /// Permissions Related to Bucket Subresource Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing /// access permissions to your Amazon S3 resources</a>. /// </para> /// /// <para> /// <code>PutBucketTagging</code> has the following special errors: /// </para> /// <ul> <li> /// <para> /// Error code: <code>InvalidTagError</code> /// </para> /// <ul> <li> /// <para> /// Description: The tag provided was not a valid tag. This error can occur if the tag /// did not pass input validation. For information about tag restrictions, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html"> /// User-Defined Tag Restrictions</a> and <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/aws-tag-restrictions.html"> /// AWS-Generated Cost Allocation Tag Restrictions</a>. /// </para> /// </li> </ul> </li> <li> /// <para> /// Error code: <code>MalformedXMLError</code> /// </para> /// <ul> <li> /// <para> /// Description: The XML provided does not match the schema. /// </para> /// </li> </ul> </li> <li> /// <para> /// Error code: <code>OperationAbortedError </code> /// </para> /// <ul> <li> /// <para> /// Description: A conflicting conditional action is currently in progress against this /// resource. Try again. /// </para> /// </li> </ul> </li> <li> /// <para> /// Error code: <code>InternalError</code> /// </para> /// <ul> <li> /// <para> /// Description: The service was unable to apply the provided tag to the bucket. /// </para> /// </li> </ul> </li> </ul> /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketTagging.html#API_control_PutBucketTagging_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>PutBucketTagging</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketTagging.html">GetBucketTagging</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketTagging.html">DeleteBucketTagging</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutBucketTagging service method.</param> /// /// <returns>The response from the PutBucketTagging service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutBucketTagging">REST API Reference for PutBucketTagging Operation</seealso> public virtual PutBucketTaggingResponse PutBucketTagging(PutBucketTaggingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutBucketTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = PutBucketTaggingResponseUnmarshaller.Instance; return Invoke<PutBucketTaggingResponse>(request, options); } /// <summary> /// <note> /// <para> /// This action puts tags on an Amazon S3 on Outposts bucket. To put tags on an S3 bucket, /// see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html">PutBucketTagging</a> /// in the <i>Amazon Simple Storage Service API</i>. /// </para> /// </note> /// <para> /// Sets the tags for an S3 on Outposts bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using /// Amazon S3 on Outposts</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// </para> /// /// <para> /// Use tags to organize your AWS bill to reflect your own cost structure. To do this, /// sign up to get your AWS account bill with tag key values included. Then, to see the /// cost of combined resources, organize your billing information according to resources /// with the same tag key values. For example, you can tag several resources with a specific /// application name, and then organize your billing information to see the total cost /// of that application across several services. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html">Cost /// allocation and tagging</a>. /// </para> /// <note> /// <para> /// Within a bucket, if you add a tag that has the same key as an existing tag, the new /// value overwrites the old value. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/CostAllocTagging.html"> /// Using cost allocation in Amazon S3 bucket tags</a>. /// </para> /// </note> /// <para> /// To use this action, you must have permissions to perform the <code>s3-outposts:PutBucketTagging</code> /// action. The Outposts bucket owner has this permission by default and can grant this /// permission to others. For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources"> /// Permissions Related to Bucket Subresource Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing /// access permissions to your Amazon S3 resources</a>. /// </para> /// /// <para> /// <code>PutBucketTagging</code> has the following special errors: /// </para> /// <ul> <li> /// <para> /// Error code: <code>InvalidTagError</code> /// </para> /// <ul> <li> /// <para> /// Description: The tag provided was not a valid tag. This error can occur if the tag /// did not pass input validation. For information about tag restrictions, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html"> /// User-Defined Tag Restrictions</a> and <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/aws-tag-restrictions.html"> /// AWS-Generated Cost Allocation Tag Restrictions</a>. /// </para> /// </li> </ul> </li> <li> /// <para> /// Error code: <code>MalformedXMLError</code> /// </para> /// <ul> <li> /// <para> /// Description: The XML provided does not match the schema. /// </para> /// </li> </ul> </li> <li> /// <para> /// Error code: <code>OperationAbortedError </code> /// </para> /// <ul> <li> /// <para> /// Description: A conflicting conditional action is currently in progress against this /// resource. Try again. /// </para> /// </li> </ul> </li> <li> /// <para> /// Error code: <code>InternalError</code> /// </para> /// <ul> <li> /// <para> /// Description: The service was unable to apply the provided tag to the bucket. /// </para> /// </li> </ul> </li> </ul> /// <para> /// All Amazon S3 on Outposts REST API requests for this action require an additional /// parameter of <code>x-amz-outpost-id</code> to be passed with the request and an S3 /// on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example /// of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint /// hostname prefix and the <code>x-amz-outpost-id</code> derived using the access point /// ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketTagging.html#API_control_PutBucketTagging_Examples">Examples</a> /// section. /// </para> /// /// <para> /// The following actions are related to <code>PutBucketTagging</code>: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketTagging.html">GetBucketTagging</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketTagging.html">DeleteBucketTagging</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutBucketTagging service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PutBucketTagging service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutBucketTagging">REST API Reference for PutBucketTagging Operation</seealso> public virtual Task<PutBucketTaggingResponse> PutBucketTaggingAsync(PutBucketTaggingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutBucketTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = PutBucketTaggingResponseUnmarshaller.Instance; return InvokeAsync<PutBucketTaggingResponse>(request, options, cancellationToken); } #endregion #region PutJobTagging /// <summary> /// Sets the supplied tag-set on an S3 Batch Operations job. /// /// /// <para> /// A tag is a key-value pair. You can associate S3 Batch Operations tags with any job /// by sending a PUT request against the tagging subresource that is associated with the /// job. To modify the existing tag set, you can either replace the existing tag set entirely, /// or make changes within the existing tag set by retrieving the existing tag set using /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetJobTagging.html">GetJobTagging</a>, /// modify that tag set, and use this action to replace the tag set with the one you modified. /// For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-managing-jobs.html#batch-ops-job-tags">Controlling /// access and labeling jobs using tags</a> in the <i>Amazon Simple Storage Service User /// Guide</i>. /// </para> /// <note> <ul> <li> /// <para> /// If you send this request with an empty tag set, Amazon S3 deletes the existing tag /// set on the Batch Operations job. If you use this method, you are charged for a Tier /// 1 Request (PUT). For more information, see <a href="http://aws.amazon.com/s3/pricing/">Amazon /// S3 pricing</a>. /// </para> /// </li> <li> /// <para> /// For deleting existing tags for your Batch Operations job, a <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteJobTagging.html">DeleteJobTagging</a> /// request is preferred because it achieves the same result without incurring charges. /// </para> /// </li> <li> /// <para> /// A few things to consider about using tags: /// </para> /// <ul> <li> /// <para> /// Amazon S3 limits the maximum number of tags to 50 tags per job. /// </para> /// </li> <li> /// <para> /// You can associate up to 50 tags with a job as long as they have unique tag keys. /// </para> /// </li> <li> /// <para> /// A tag key can be up to 128 Unicode characters in length, and tag values can be up /// to 256 Unicode characters in length. /// </para> /// </li> <li> /// <para> /// The key and values are case sensitive. /// </para> /// </li> <li> /// <para> /// For tagging-related restrictions related to characters and encodings, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html">User-Defined /// Tag Restrictions</a> in the <i>AWS Billing and Cost Management User Guide</i>. /// </para> /// </li> </ul> </li> </ul> </note> /// <para> /// To use this action, you must have permission to perform the <code>s3:PutJobTagging</code> /// action. /// </para> /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreatJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetJobTagging.html">GetJobTagging</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteJobTagging.html">DeleteJobTagging</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutJobTagging service method.</param> /// /// <returns>The response from the PutJobTagging service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.NotFoundException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyRequestsException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyTagsException"> /// Amazon S3 throws this exception if you have too many tags in your tag set. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutJobTagging">REST API Reference for PutJobTagging Operation</seealso> public virtual PutJobTaggingResponse PutJobTagging(PutJobTaggingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutJobTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = PutJobTaggingResponseUnmarshaller.Instance; return Invoke<PutJobTaggingResponse>(request, options); } /// <summary> /// Sets the supplied tag-set on an S3 Batch Operations job. /// /// /// <para> /// A tag is a key-value pair. You can associate S3 Batch Operations tags with any job /// by sending a PUT request against the tagging subresource that is associated with the /// job. To modify the existing tag set, you can either replace the existing tag set entirely, /// or make changes within the existing tag set by retrieving the existing tag set using /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetJobTagging.html">GetJobTagging</a>, /// modify that tag set, and use this action to replace the tag set with the one you modified. /// For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-managing-jobs.html#batch-ops-job-tags">Controlling /// access and labeling jobs using tags</a> in the <i>Amazon Simple Storage Service User /// Guide</i>. /// </para> /// <note> <ul> <li> /// <para> /// If you send this request with an empty tag set, Amazon S3 deletes the existing tag /// set on the Batch Operations job. If you use this method, you are charged for a Tier /// 1 Request (PUT). For more information, see <a href="http://aws.amazon.com/s3/pricing/">Amazon /// S3 pricing</a>. /// </para> /// </li> <li> /// <para> /// For deleting existing tags for your Batch Operations job, a <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteJobTagging.html">DeleteJobTagging</a> /// request is preferred because it achieves the same result without incurring charges. /// </para> /// </li> <li> /// <para> /// A few things to consider about using tags: /// </para> /// <ul> <li> /// <para> /// Amazon S3 limits the maximum number of tags to 50 tags per job. /// </para> /// </li> <li> /// <para> /// You can associate up to 50 tags with a job as long as they have unique tag keys. /// </para> /// </li> <li> /// <para> /// A tag key can be up to 128 Unicode characters in length, and tag values can be up /// to 256 Unicode characters in length. /// </para> /// </li> <li> /// <para> /// The key and values are case sensitive. /// </para> /// </li> <li> /// <para> /// For tagging-related restrictions related to characters and encodings, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html">User-Defined /// Tag Restrictions</a> in the <i>AWS Billing and Cost Management User Guide</i>. /// </para> /// </li> </ul> </li> </ul> </note> /// <para> /// To use this action, you must have permission to perform the <code>s3:PutJobTagging</code> /// action. /// </para> /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreatJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetJobTagging.html">GetJobTagging</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteJobTagging.html">DeleteJobTagging</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutJobTagging service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PutJobTagging service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.NotFoundException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyRequestsException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyTagsException"> /// Amazon S3 throws this exception if you have too many tags in your tag set. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutJobTagging">REST API Reference for PutJobTagging Operation</seealso> public virtual Task<PutJobTaggingResponse> PutJobTaggingAsync(PutJobTaggingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutJobTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = PutJobTaggingResponseUnmarshaller.Instance; return InvokeAsync<PutJobTaggingResponse>(request, options, cancellationToken); } #endregion #region PutPublicAccessBlock /// <summary> /// Creates or modifies the <code>PublicAccessBlock</code> configuration for an AWS account. /// For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html"> /// Using Amazon S3 block public access</a>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetPublicAccessBlock.html">GetPublicAccessBlock</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeletePublicAccessBlock.html">DeletePublicAccessBlock</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutPublicAccessBlock service method.</param> /// /// <returns>The response from the PutPublicAccessBlock service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutPublicAccessBlock">REST API Reference for PutPublicAccessBlock Operation</seealso> public virtual PutPublicAccessBlockResponse PutPublicAccessBlock(PutPublicAccessBlockRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutPublicAccessBlockRequestMarshaller.Instance; options.ResponseUnmarshaller = PutPublicAccessBlockResponseUnmarshaller.Instance; return Invoke<PutPublicAccessBlockResponse>(request, options); } /// <summary> /// Creates or modifies the <code>PublicAccessBlock</code> configuration for an AWS account. /// For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html"> /// Using Amazon S3 block public access</a>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetPublicAccessBlock.html">GetPublicAccessBlock</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeletePublicAccessBlock.html">DeletePublicAccessBlock</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutPublicAccessBlock service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PutPublicAccessBlock service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutPublicAccessBlock">REST API Reference for PutPublicAccessBlock Operation</seealso> public virtual Task<PutPublicAccessBlockResponse> PutPublicAccessBlockAsync(PutPublicAccessBlockRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutPublicAccessBlockRequestMarshaller.Instance; options.ResponseUnmarshaller = PutPublicAccessBlockResponseUnmarshaller.Instance; return InvokeAsync<PutPublicAccessBlockResponse>(request, options, cancellationToken); } #endregion #region PutStorageLensConfiguration /// <summary> /// Puts an Amazon S3 Storage Lens configuration. For more information about S3 Storage /// Lens, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Working /// with Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// <note> /// <para> /// To use this action, you must have permission to perform the <code>s3:PutStorageLensConfiguration</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting /// permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutStorageLensConfiguration service method.</param> /// /// <returns>The response from the PutStorageLensConfiguration service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutStorageLensConfiguration">REST API Reference for PutStorageLensConfiguration Operation</seealso> public virtual PutStorageLensConfigurationResponse PutStorageLensConfiguration(PutStorageLensConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutStorageLensConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = PutStorageLensConfigurationResponseUnmarshaller.Instance; return Invoke<PutStorageLensConfigurationResponse>(request, options); } /// <summary> /// Puts an Amazon S3 Storage Lens configuration. For more information about S3 Storage /// Lens, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Working /// with Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// <note> /// <para> /// To use this action, you must have permission to perform the <code>s3:PutStorageLensConfiguration</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting /// permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutStorageLensConfiguration service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PutStorageLensConfiguration service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutStorageLensConfiguration">REST API Reference for PutStorageLensConfiguration Operation</seealso> public virtual Task<PutStorageLensConfigurationResponse> PutStorageLensConfigurationAsync(PutStorageLensConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutStorageLensConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = PutStorageLensConfigurationResponseUnmarshaller.Instance; return InvokeAsync<PutStorageLensConfigurationResponse>(request, options, cancellationToken); } #endregion #region PutStorageLensConfigurationTagging /// <summary> /// Put or replace tags on an existing Amazon S3 Storage Lens configuration. For more /// information about S3 Storage Lens, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Assessing /// your storage activity and usage with Amazon S3 Storage Lens </a> in the <i>Amazon /// Simple Storage Service User Guide</i>. /// /// <note> /// <para> /// To use this action, you must have permission to perform the <code>s3:PutStorageLensConfigurationTagging</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting /// permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutStorageLensConfigurationTagging service method.</param> /// /// <returns>The response from the PutStorageLensConfigurationTagging service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutStorageLensConfigurationTagging">REST API Reference for PutStorageLensConfigurationTagging Operation</seealso> public virtual PutStorageLensConfigurationTaggingResponse PutStorageLensConfigurationTagging(PutStorageLensConfigurationTaggingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutStorageLensConfigurationTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = PutStorageLensConfigurationTaggingResponseUnmarshaller.Instance; return Invoke<PutStorageLensConfigurationTaggingResponse>(request, options); } /// <summary> /// Put or replace tags on an existing Amazon S3 Storage Lens configuration. For more /// information about S3 Storage Lens, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens.html">Assessing /// your storage activity and usage with Amazon S3 Storage Lens </a> in the <i>Amazon /// Simple Storage Service User Guide</i>. /// /// <note> /// <para> /// To use this action, you must have permission to perform the <code>s3:PutStorageLensConfigurationTagging</code> /// action. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage_lens_iam_permissions.html">Setting /// permissions to use Amazon S3 Storage Lens</a> in the <i>Amazon Simple Storage Service /// User Guide</i>. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutStorageLensConfigurationTagging service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PutStorageLensConfigurationTagging service method, as returned by S3Control.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutStorageLensConfigurationTagging">REST API Reference for PutStorageLensConfigurationTagging Operation</seealso> public virtual Task<PutStorageLensConfigurationTaggingResponse> PutStorageLensConfigurationTaggingAsync(PutStorageLensConfigurationTaggingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutStorageLensConfigurationTaggingRequestMarshaller.Instance; options.ResponseUnmarshaller = PutStorageLensConfigurationTaggingResponseUnmarshaller.Instance; return InvokeAsync<PutStorageLensConfigurationTaggingResponse>(request, options, cancellationToken); } #endregion #region UpdateJobPriority /// <summary> /// Updates an existing S3 Batch Operations job's priority. For more information, see /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-basics.html">S3 /// Batch Operations</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListJobs.html">ListJobs</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html">DescribeJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html">UpdateJobStatus</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateJobPriority service method.</param> /// /// <returns>The response from the UpdateJobPriority service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.BadRequestException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.NotFoundException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyRequestsException"> /// /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/UpdateJobPriority">REST API Reference for UpdateJobPriority Operation</seealso> public virtual UpdateJobPriorityResponse UpdateJobPriority(UpdateJobPriorityRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateJobPriorityRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateJobPriorityResponseUnmarshaller.Instance; return Invoke<UpdateJobPriorityResponse>(request, options); } /// <summary> /// Updates an existing S3 Batch Operations job's priority. For more information, see /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-basics.html">S3 /// Batch Operations</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListJobs.html">ListJobs</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html">DescribeJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html">UpdateJobStatus</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateJobPriority service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateJobPriority service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.BadRequestException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.NotFoundException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyRequestsException"> /// /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/UpdateJobPriority">REST API Reference for UpdateJobPriority Operation</seealso> public virtual Task<UpdateJobPriorityResponse> UpdateJobPriorityAsync(UpdateJobPriorityRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateJobPriorityRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateJobPriorityResponseUnmarshaller.Instance; return InvokeAsync<UpdateJobPriorityResponse>(request, options, cancellationToken); } #endregion #region UpdateJobStatus /// <summary> /// Updates the status for the specified job. Use this action to confirm that you want /// to run a job or to cancel an existing job. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-basics.html">S3 /// Batch Operations</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListJobs.html">ListJobs</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html">DescribeJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html">UpdateJobStatus</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateJobStatus service method.</param> /// /// <returns>The response from the UpdateJobStatus service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.BadRequestException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.JobStatusException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.NotFoundException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyRequestsException"> /// /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/UpdateJobStatus">REST API Reference for UpdateJobStatus Operation</seealso> public virtual UpdateJobStatusResponse UpdateJobStatus(UpdateJobStatusRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateJobStatusRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateJobStatusResponseUnmarshaller.Instance; return Invoke<UpdateJobStatusResponse>(request, options); } /// <summary> /// Updates the status for the specified job. Use this action to confirm that you want /// to run a job or to cancel an existing job. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-basics.html">S3 /// Batch Operations</a> in the <i>Amazon Simple Storage Service User Guide</i>. /// /// /// <para> /// Related actions include: /// </para> /// <ul> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateJob.html">CreateJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListJobs.html">ListJobs</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DescribeJob.html">DescribeJob</a> /// /// </para> /// </li> <li> /// <para> /// <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UpdateJobStatus.html">UpdateJobStatus</a> /// /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateJobStatus service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateJobStatus service method, as returned by S3Control.</returns> /// <exception cref="Amazon.S3Control.Model.BadRequestException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.InternalServiceException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.JobStatusException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.NotFoundException"> /// /// </exception> /// <exception cref="Amazon.S3Control.Model.TooManyRequestsException"> /// /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/UpdateJobStatus">REST API Reference for UpdateJobStatus Operation</seealso> public virtual Task<UpdateJobStatusResponse> UpdateJobStatusAsync(UpdateJobStatusRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateJobStatusRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateJobStatusResponseUnmarshaller.Instance; return InvokeAsync<UpdateJobStatusResponse>(request, options, cancellationToken); } #endregion } }
53.041011
269
0.636291
[ "Apache-2.0" ]
KenHundley/aws-sdk-net
sdk/src/Services/S3Control/Generated/_bcl45/AmazonS3ControlClient.cs
289,710
C#
// <copyright file="Vector.cs" company="Math.NET"> // Math.NET Numerics, part of the Math.NET Project // http://numerics.mathdotnet.com // http://github.com/mathnet/mathnet-numerics // // Copyright (c) 2009-2015 Math.NET // // 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. // </copyright> using System; using MathNet.Numerics.LinearAlgebra.Storage; using MathNet.Numerics.Threading; namespace MathNet.Numerics.LinearAlgebra.Complex32 { using Complex32 = Numerics.Complex32; /// <summary> /// <c>Complex32</c> version of the <see cref="Vector{T}"/> class. /// </summary> [Serializable] public abstract class Vector : Vector<Complex32> { /// <summary> /// Initializes a new instance of the Vector class. /// </summary> protected Vector(VectorStorage<Complex32> storage) : base(storage) { } /// <summary> /// Set all values whose absolute value is smaller than the threshold to zero. /// </summary> public override void CoerceZero(double threshold) { MapInplace(x => x.Magnitude < threshold ? Complex32.Zero : x, Zeros.AllowSkip); } /// <summary> /// Conjugates vector and save result to <paramref name="result"/> /// </summary> /// <param name="result">Target vector</param> protected override void DoConjugate(Vector<Complex32> result) { Map(Complex32.Conjugate, result, Zeros.AllowSkip); } /// <summary> /// Negates vector and saves result to <paramref name="result"/> /// </summary> /// <param name="result">Target vector</param> protected override void DoNegate(Vector<Complex32> result) { Map(Complex32.Negate, result, Zeros.AllowSkip); } /// <summary> /// Adds a scalar to each element of the vector and stores the result in the result vector. /// </summary> /// <param name="scalar"> /// The scalar to add. /// </param> /// <param name="result"> /// The vector to store the result of the addition. /// </param> protected override void DoAdd(Complex32 scalar, Vector<Complex32> result) { Map(x => x + scalar, result, Zeros.Include); } /// <summary> /// Adds another vector to this vector and stores the result into the result vector. /// </summary> /// <param name="other"> /// The vector to add to this one. /// </param> /// <param name="result"> /// The vector to store the result of the addition. /// </param> protected override void DoAdd(Vector<Complex32> other, Vector<Complex32> result) { Map2(Complex32.Add, other, result, Zeros.AllowSkip); } /// <summary> /// Subtracts a scalar from each element of the vector and stores the result in the result vector. /// </summary> /// <param name="scalar"> /// The scalar to subtract. /// </param> /// <param name="result"> /// The vector to store the result of the subtraction. /// </param> protected override void DoSubtract(Complex32 scalar, Vector<Complex32> result) { Map(x => x - scalar, result, Zeros.Include); } /// <summary> /// Subtracts another vector to this vector and stores the result into the result vector. /// </summary> /// <param name="other"> /// The vector to subtract from this one. /// </param> /// <param name="result"> /// The vector to store the result of the subtraction. /// </param> protected override void DoSubtract(Vector<Complex32> other, Vector<Complex32> result) { Map2(Complex32.Subtract, other, result, Zeros.AllowSkip); } /// <summary> /// Multiplies a scalar to each element of the vector and stores the result in the result vector. /// </summary> /// <param name="scalar"> /// The scalar to multiply. /// </param> /// <param name="result"> /// The vector to store the result of the multiplication. /// </param> protected override void DoMultiply(Complex32 scalar, Vector<Complex32> result) { Map(x => x*scalar, result, Zeros.AllowSkip); } /// <summary> /// Divides each element of the vector by a scalar and stores the result in the result vector. /// </summary> /// <param name="divisor"> /// The scalar to divide with. /// </param> /// <param name="result"> /// The vector to store the result of the division. /// </param> protected override void DoDivide(Complex32 divisor, Vector<Complex32> result) { Map(x => x/divisor, result, divisor.IsZero() ? Zeros.Include : Zeros.AllowSkip); } /// <summary> /// Divides a scalar by each element of the vector and stores the result in the result vector. /// </summary> /// <param name="dividend">The scalar to divide.</param> /// <param name="result">The vector to store the result of the division.</param> protected override void DoDivideByThis(Complex32 dividend, Vector<Complex32> result) { Map(x => dividend/x, result, Zeros.Include); } /// <summary> /// Pointwise multiplies this vector with another vector and stores the result into the result vector. /// </summary> /// <param name="other">The vector to pointwise multiply with this one.</param> /// <param name="result">The vector to store the result of the pointwise multiplication.</param> protected override void DoPointwiseMultiply(Vector<Complex32> other, Vector<Complex32> result) { Map2(Complex32.Multiply, other, result, Zeros.AllowSkip); } /// <summary> /// Pointwise divide this vector with another vector and stores the result into the result vector. /// </summary> /// <param name="divisor">The vector to pointwise divide this one by.</param> /// <param name="result">The vector to store the result of the pointwise division.</param> protected override void DoPointwiseDivide(Vector<Complex32> divisor, Vector<Complex32> result) { Map2(Complex32.Divide, divisor, result, Zeros.Include); } /// <summary> /// Pointwise raise this vector to an exponent and store the result into the result vector. /// </summary> /// <param name="exponent">The exponent to raise this vector values to.</param> /// <param name="result">The vector to store the result of the pointwise power.</param> protected override void DoPointwisePower(Complex32 exponent, Vector<Complex32> result) { Map(x => x.Power(exponent), result, Zeros.Include); } /// <summary> /// Pointwise raise this vector to an exponent vector and store the result into the result vector. /// </summary> /// <param name="exponent">The exponent vector to raise this vector values to.</param> /// <param name="result">The vector to store the result of the pointwise power.</param> protected override void DoPointwisePower(Vector<Complex32> exponent, Vector<Complex32> result) { Map2(Complex32.Pow, exponent, result, Zeros.Include); } /// <summary> /// Pointwise canonical modulus, where the result has the sign of the divisor, /// of this vector with another vector and stores the result into the result vector. /// </summary> /// <param name="divisor">The pointwise denominator vector to use.</param> /// <param name="result">The result of the modulus.</param> protected sealed override void DoPointwiseModulus(Vector<Complex32> divisor, Vector<Complex32> result) { throw new NotSupportedException(); } /// <summary> /// Pointwise remainder (% operator), where the result has the sign of the dividend, /// of this vector with another vector and stores the result into the result vector. /// </summary> /// <param name="divisor">The pointwise denominator vector to use.</param> /// <param name="result">The result of the modulus.</param> protected sealed override void DoPointwiseRemainder(Vector<Complex32> divisor, Vector<Complex32> result) { throw new NotSupportedException(); } /// <summary> /// Pointwise applies the exponential function to each value and stores the result into the result vector. /// </summary> /// <param name="result">The vector to store the result.</param> protected override void DoPointwiseExp(Vector<Complex32> result) { Map(Complex32.Exp, result, Zeros.Include); } /// <summary> /// Pointwise applies the natural logarithm function to each value and stores the result into the result vector. /// </summary> /// <param name="result">The vector to store the result.</param> protected override void DoPointwiseLog(Vector<Complex32> result) { Map(Complex32.Log, result, Zeros.Include); } protected override void DoPointwiseAbs(Vector<Complex32> result) { Map(x => (Complex32)Complex32.Abs(x), result, Zeros.AllowSkip); } protected override void DoPointwiseAcos(Vector<Complex32> result) { Map(Complex32.Acos, result, Zeros.Include); } protected override void DoPointwiseAsin(Vector<Complex32> result) { Map(Complex32.Asin, result, Zeros.AllowSkip); } protected override void DoPointwiseAtan(Vector<Complex32> result) { Map(Complex32.Atan, result, Zeros.AllowSkip); } protected override void DoPointwiseAtan2(Vector<Complex32> other, Vector<Complex32> result) { throw new NotSupportedException(); } protected override void DoPointwiseAtan2(Complex32 scalar, Vector<Complex32> result) { throw new NotSupportedException(); } protected override void DoPointwiseCeiling(Vector<Complex32> result) { throw new NotSupportedException(); } protected override void DoPointwiseCos(Vector<Complex32> result) { Map(Complex32.Cos, result, Zeros.Include); } protected override void DoPointwiseCosh(Vector<Complex32> result) { Map(Complex32.Cosh, result, Zeros.Include); } protected override void DoPointwiseFloor(Vector<Complex32> result) { throw new NotSupportedException(); } protected override void DoPointwiseLog10(Vector<Complex32> result) { Map(Complex32.Log10, result, Zeros.Include); } protected override void DoPointwiseRound(Vector<Complex32> result) { throw new NotSupportedException(); } protected override void DoPointwiseSign(Vector<Complex32> result) { throw new NotSupportedException(); } protected override void DoPointwiseSin(Vector<Complex32> result) { Map(Complex32.Sin, result, Zeros.AllowSkip); } protected override void DoPointwiseSinh(Vector<Complex32> result) { Map(Complex32.Sinh, result, Zeros.AllowSkip); } protected override void DoPointwiseSqrt(Vector<Complex32> result) { Map(Complex32.Sqrt, result, Zeros.AllowSkip); } protected override void DoPointwiseTan(Vector<Complex32> result) { Map(Complex32.Tan, result, Zeros.AllowSkip); } protected override void DoPointwiseTanh(Vector<Complex32> result) { Map(Complex32.Tanh, result, Zeros.AllowSkip); } /// <summary> /// Computes the dot product between this vector and another vector. /// </summary> /// <param name="other">The other vector.</param> /// <returns>The sum of a[i]*b[i] for all i.</returns> protected override Complex32 DoDotProduct(Vector<Complex32> other) { var dot = Complex32.Zero; for (var i = 0; i < Count; i++) { dot += At(i) * other.At(i); } return dot; } /// <summary> /// Computes the dot product between the conjugate of this vector and another vector. /// </summary> /// <param name="other">The other vector.</param> /// <returns>The sum of conj(a[i])*b[i] for all i.</returns> protected override Complex32 DoConjugateDotProduct(Vector<Complex32> other) { var dot = Complex32.Zero; for (var i = 0; i < Count; i++) { dot += At(i).Conjugate() * other.At(i); } return dot; } /// <summary> /// Computes the canonical modulus, where the result has the sign of the divisor, /// for each element of the vector for the given divisor. /// </summary> /// <param name="divisor">The scalar denominator to use.</param> /// <param name="result">A vector to store the results in.</param> protected sealed override void DoModulus(Complex32 divisor, Vector<Complex32> result) { throw new NotSupportedException(); } /// <summary> /// Computes the canonical modulus, where the result has the sign of the divisor, /// for the given dividend for each element of the vector. /// </summary> /// <param name="dividend">The scalar numerator to use.</param> /// <param name="result">A vector to store the results in.</param> protected sealed override void DoModulusByThis(Complex32 dividend, Vector<Complex32> result) { throw new NotSupportedException(); } /// <summary> /// Computes the remainder (% operator), where the result has the sign of the dividend, /// for each element of the vector for the given divisor. /// </summary> /// <param name="divisor">The scalar denominator to use.</param> /// <param name="result">A vector to store the results in.</param> protected sealed override void DoRemainder(Complex32 divisor, Vector<Complex32> result) { throw new NotSupportedException(); } /// <summary> /// Computes the remainder (% operator), where the result has the sign of the dividend, /// for the given dividend for each element of the vector. /// </summary> /// <param name="dividend">The scalar numerator to use.</param> /// <param name="result">A vector to store the results in.</param> protected sealed override void DoRemainderByThis(Complex32 dividend, Vector<Complex32> result) { throw new NotSupportedException(); } protected override void DoPointwiseMinimum(Complex32 scalar, Vector<Complex32> result) { throw new NotSupportedException(); } protected override void DoPointwiseMaximum(Complex32 scalar, Vector<Complex32> result) { throw new NotSupportedException(); } protected override void DoPointwiseAbsoluteMinimum(Complex32 scalar, Vector<Complex32> result) { float absolute = scalar.Magnitude; Map(x => Math.Min(absolute, x.Magnitude), result, Zeros.AllowSkip); } protected override void DoPointwiseAbsoluteMaximum(Complex32 scalar, Vector<Complex32> result) { float absolute = scalar.Magnitude; Map(x => Math.Max(absolute, x.Magnitude), result, Zeros.Include); } protected override void DoPointwiseMinimum(Vector<Complex32> other, Vector<Complex32> result) { throw new NotSupportedException(); } protected override void DoPointwiseMaximum(Vector<Complex32> other, Vector<Complex32> result) { throw new NotSupportedException(); } protected override void DoPointwiseAbsoluteMinimum(Vector<Complex32> other, Vector<Complex32> result) { Map2((x, y) => Math.Min(x.Magnitude, y.Magnitude), other, result, Zeros.AllowSkip); } protected override void DoPointwiseAbsoluteMaximum(Vector<Complex32> other, Vector<Complex32> result) { Map2((x, y) => Math.Max(x.Magnitude, y.Magnitude), other, result, Zeros.AllowSkip); } /// <summary> /// Returns the value of the absolute minimum element. /// </summary> /// <returns>The value of the absolute minimum element.</returns> public sealed override Complex32 AbsoluteMinimum() { return At(AbsoluteMinimumIndex()).Magnitude; } /// <summary> /// Returns the index of the absolute minimum element. /// </summary> /// <returns>The index of absolute minimum element.</returns> public override int AbsoluteMinimumIndex() { var index = 0; var min = At(index).Magnitude; for (var i = 1; i < Count; i++) { var test = At(i).Magnitude; if (test < min) { index = i; min = test; } } return index; } /// <summary> /// Returns the value of the absolute maximum element. /// </summary> /// <returns>The value of the absolute maximum element.</returns> public override Complex32 AbsoluteMaximum() { return At(AbsoluteMaximumIndex()).Magnitude; } /// <summary> /// Returns the index of the absolute maximum element. /// </summary> /// <returns>The index of absolute maximum element.</returns> public override int AbsoluteMaximumIndex() { var index = 0; var max = At(index).Magnitude; for (var i = 1; i < Count; i++) { var test = At(i).Magnitude; if (test > max) { index = i; max = test; } } return index; } /// <summary> /// Computes the sum of the vector's elements. /// </summary> /// <returns>The sum of the vector's elements.</returns> public override Complex32 Sum() { var sum = Complex32.Zero; for (var i = 0; i < Count; i++) { sum += At(i); } return sum; } /// <summary> /// Calculates the L1 norm of the vector, also known as Manhattan norm. /// </summary> /// <returns>The sum of the absolute values.</returns> public override double L1Norm() { double sum = 0d; for (var i = 0; i < Count; i++) { sum += At(i).Magnitude; } return sum; } /// <summary> /// Calculates the L2 norm of the vector, also known as Euclidean norm. /// </summary> /// <returns>The square root of the sum of the squared values.</returns> public override double L2Norm() { return DoConjugateDotProduct(this).SquareRoot().Real; } /// <summary> /// Calculates the infinity norm of the vector. /// </summary> /// <returns>The maximum absolute value.</returns> public override double InfinityNorm() { return CommonParallel.Aggregate(0, Count, i => At(i).Magnitude, Math.Max, 0f); } /// <summary> /// Computes the p-Norm. /// </summary> /// <param name="p"> /// The p value. /// </param> /// <returns> /// <c>Scalar ret = ( ∑|At(i)|^p )^(1/p)</c> /// </returns> public override double Norm(double p) { if (p < 0d) throw new ArgumentOutOfRangeException(nameof(p)); if (p == 1d) return L1Norm(); if (p == 2d) return L2Norm(); if (double.IsPositiveInfinity(p)) return InfinityNorm(); double sum = 0d; for (var index = 0; index < Count; index++) { sum += Math.Pow(At(index).Magnitude, p); } return Math.Pow(sum, 1.0/p); } /// <summary> /// Returns the index of the maximum element. /// </summary> /// <returns>The index of maximum element.</returns> public override int MaximumIndex() { throw new NotSupportedException(); } /// <summary> /// Returns the index of the minimum element. /// </summary> /// <returns>The index of minimum element.</returns> public override int MinimumIndex() { throw new NotSupportedException(); } /// <summary> /// Normalizes this vector to a unit vector with respect to the p-norm. /// </summary> /// <param name="p"> /// The p value. /// </param> /// <returns> /// This vector normalized to a unit vector with respect to the p-norm. /// </returns> public override Vector<Complex32> Normalize(double p) { if (p < 0d) { throw new ArgumentOutOfRangeException(nameof(p)); } double norm = Norm(p); var clone = Clone(); if (norm == 0d) { return clone; } clone.Multiply((float)(1d / norm), clone); return clone; } } }
37.765751
120
0.57856
[ "MIT" ]
ABarnabyC/mathnet-numerics
src/Numerics/LinearAlgebra/Complex32/Vector.cs
23,381
C#
using LuduStack.Domain.Core.Attributes; namespace LuduStack.Domain.Core.Enums { public enum GamePlatforms { [UiInfo(Class = "windows")] Windows, [UiInfo(Class = "linux")] Linux, [UiInfo(Class = "xbox")] Xbox, [UiInfo(Class = "playstation")] Playstation, [UiInfo(Class = "nintendo-switch")] NintendoSwitch, [UiInfo(Class = "android")] Android, [UiInfo(Class = "app-store-ios")] Ios, [UiInfo(Class = "steam")] Steam, [UiInfo(Class = "html5")] Html5, [UiInfo(Class = "apple")] Mac, [UiInfo(Class = "gamepad")] NES } }
17.85
43
0.502801
[ "MIT" ]
anteatergames/ludustack
LuduStack.Domain.Core/Enums/GamePlatforms.cs
716
C#
using System; using System.Linq; namespace JsonApiDotNetCore.Internal { public class JsonApiException : Exception { private readonly ErrorCollection _errors = new ErrorCollection(); public JsonApiException(ErrorCollection errorCollection) { _errors = errorCollection; } public JsonApiException(Error error) : base(error.Title) => _errors.Add(error); [Obsolete("Use int statusCode overload instead")] public JsonApiException(string statusCode, string message, string source = null) : base(message) => _errors.Add(new Error(statusCode, message, null, GetMeta(), source)); [Obsolete("Use int statusCode overload instead")] public JsonApiException(string statusCode, string message, string detail, string source = null) : base(message) => _errors.Add(new Error(statusCode, message, detail, GetMeta(), source)); public JsonApiException(int statusCode, string message, string source = null) : base(message) => _errors.Add(new Error(statusCode, message, null, GetMeta(), source)); public JsonApiException(int statusCode, string message, string detail, string source = null) : base(message) => _errors.Add(new Error(statusCode, message, detail, GetMeta(), source)); public JsonApiException(int statusCode, string message, Exception innerException) : base(message, innerException) => _errors.Add(new Error(statusCode, message, innerException.Message, GetMeta(innerException))); public ErrorCollection GetError() => _errors; public int GetStatusCode() { if (_errors.Errors.Select(a => a.StatusCode).Distinct().Count() == 1) return _errors.Errors[0].StatusCode; if (_errors.Errors.FirstOrDefault(e => e.StatusCode >= 500) != null) return 500; if (_errors.Errors.FirstOrDefault(e => e.StatusCode >= 400) != null) return 400; return 500; } private ErrorMeta GetMeta() => ErrorMeta.FromException(this); private ErrorMeta GetMeta(Exception e) => ErrorMeta.FromException(e); } }
37.483333
108
0.641174
[ "MIT" ]
milosloub/JsonApiDotNetCore
src/JsonApiDotNetCore/Internal/JsonApiException.cs
2,249
C#
using System; using WhiteMvvm.Bases; using Xamarin.Forms; namespace WhiteMvvm.Services.Resolve { public interface IReflectionResolve { Type GetTypeFromAssembly(Type typeFrom, string folderNameToBeReplaced, string replacedFolderName, string fileNameToBeReplaced, string replacedFileName); Page GetPageInstance(Type pageType); BaseViewModel CreateViewModel(Type viewModelType); BaseViewModel GetViewModelInstance(Type viewModelType); Page CreatePage(Type viewModelType); } }
31.705882
105
0.751391
[ "MIT" ]
AbuMandour/WhiteMvvm
src/WhiteMvvm/Services/Resolve/IReflectionResolve.cs
541
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.Linq; using Xunit; using Microsoft.Extensions.DependencyModel; namespace Microsoft.DotNet.CoreSetup.Test.HostActivation { public class StartupHooks : IClassFixture<StartupHooks.SharedTestState> { private SharedTestState sharedTestState; private string startupHookVarName = "DOTNET_STARTUP_HOOKS"; public StartupHooks(StartupHooks.SharedTestState fixture) { sharedTestState = fixture; } // Run the app with a startup hook [Fact] public void Muxer_activation_of_StartupHook_Succeeds() { var fixture = sharedTestState.PortableAppFixture.Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var startupHookFixture = sharedTestState.StartupHookFixture.Copy(); var startupHookDll = startupHookFixture.TestProject.AppDll; var startupHookWithNonPublicMethodFixture = sharedTestState.StartupHookWithNonPublicMethodFixture.Copy(); var startupHookWithNonPublicMethodDll = startupHookWithNonPublicMethodFixture.TestProject.AppDll; // Simple startup hook dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookDll) .CaptureStdOut() .CaptureStdErr() .Execute() .Should().Pass() .And.HaveStdOutContaining("Hello from startup hook!") .And.HaveStdOutContaining("Hello World"); // Non-public Initialize method dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookWithNonPublicMethodDll) .CaptureStdOut() .CaptureStdErr() .Execute() .Should().Pass() .And.HaveStdOutContaining("Hello from startup hook with non-public method"); // Ensure startup hook tracing works dotnet.Exec(appDll) .EnvironmentVariable("COREHOST_TRACE", "1") .EnvironmentVariable(startupHookVarName, startupHookDll) .CaptureStdOut() .CaptureStdErr() .Execute() .Should().Pass() .And.HaveStdErrContaining("Property STARTUP_HOOKS = " + startupHookDll) .And.HaveStdOutContaining("Hello from startup hook!") .And.HaveStdOutContaining("Hello World"); // Startup hook in type that has an additional overload of Initialize with a different signature startupHookFixture = sharedTestState.StartupHookWithOverloadFixture.Copy(); startupHookDll = startupHookFixture.TestProject.AppDll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookDll) .CaptureStdOut() .CaptureStdErr() .Execute() .Should().Pass() .And.HaveStdOutContaining("Hello from startup hook with overload! Input: 123") .And.HaveStdOutContaining("Hello World"); } // Run the app with multiple startup hooks [Fact] public void Muxer_activation_of_Multiple_StartupHooks_Succeeds() { var fixture = sharedTestState.PortableAppFixture.Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var startupHookFixture = sharedTestState.StartupHookFixture.Copy(); var startupHookDll = startupHookFixture.TestProject.AppDll; var startupHook2Fixture = sharedTestState.StartupHookWithDependencyFixture.Copy(); var startupHook2Dll = startupHook2Fixture.TestProject.AppDll; // Multiple startup hooks var startupHookVar = startupHookDll + Path.PathSeparator + startupHook2Dll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute() .Should().Pass() .And.HaveStdOutContaining("Hello from startup hook!") .And.HaveStdOutContaining("Hello from startup hook with dependency!") .And.HaveStdOutContaining("Hello World"); } // Empty startup hook variable [Fact] public void Muxer_activation_of_Empty_StartupHook_Variable_Succeeds() { var fixture = sharedTestState.PortableAppFixture.Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var startupHookVar = ""; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute() .Should().Pass() .And.HaveStdOutContaining("Hello World"); } // Run the app with a startup hook assembly that depends on assemblies not on the TPA list [Fact] public void Muxer_activation_of_StartupHook_With_Missing_Dependencies_Fails() { var fixture = sharedTestState.PortableAppWithExceptionFixture.Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var startupHookFixture = sharedTestState.StartupHookWithDependencyFixture.Copy(); var startupHookDll = startupHookFixture.TestProject.AppDll; // Startup hook has a dependency not on the TPA list dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookDll) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining("System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json"); } // Different variants of the startup hook variable format [Fact] public void Muxer_activation_of_StartupHook_VariableVariants() { var fixture = sharedTestState.PortableAppFixture.Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var startupHookFixture = sharedTestState.StartupHookFixture.Copy(); var startupHookDll = startupHookFixture.TestProject.AppDll; var startupHook2Fixture = sharedTestState.StartupHookWithDependencyFixture.Copy(); var startupHook2Dll = startupHook2Fixture.TestProject.AppDll; // Missing entries in the hook var startupHookVar = startupHookDll + Path.PathSeparator + Path.PathSeparator + startupHook2Dll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Pass() .And.HaveStdOutContaining("Hello from startup hook!") .And.HaveStdOutContaining("Hello from startup hook with dependency!") .And.HaveStdOutContaining("Hello World"); // Whitespace is invalid startupHookVar = startupHookDll + Path.PathSeparator + " " + Path.PathSeparator + startupHook2Dll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining("System.ArgumentException: The startup hook simple assembly name ' ' is invalid."); // Leading separator startupHookVar = Path.PathSeparator + startupHookDll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Pass() .And.HaveStdOutContaining("Hello from startup hook!") .And.HaveStdOutContaining("Hello World"); // Trailing separator startupHookVar = startupHookDll + Path.PathSeparator + startupHook2Dll + Path.PathSeparator; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Pass() .And.HaveStdOutContaining("Hello from startup hook!") .And.HaveStdOutContaining("Hello from startup hook with dependency!") .And.HaveStdOutContaining("Hello World"); } [Fact] public void Muxer_activation_of_StartupHook_With_Invalid_Simple_Name_Fails() { var fixture = sharedTestState.PortableAppFixture.Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var startupHookFixture = sharedTestState.StartupHookFixture.Copy(); var startupHookDll = startupHookFixture.TestProject.AppDll; var relativeAssemblyPath = $".{Path.DirectorySeparatorChar}Assembly"; var expectedError = "System.ArgumentException: The startup hook simple assembly name '{0}' is invalid."; // With directory separator var startupHookVar = relativeAssemblyPath; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(string.Format(expectedError, startupHookVar)) .And.NotHaveStdErrContaining("--->"); // With alternative directory separator startupHookVar = $".{Path.AltDirectorySeparatorChar}Assembly"; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(string.Format(expectedError, startupHookVar)) .And.NotHaveStdErrContaining("--->"); // With comma startupHookVar = $"Assembly,version=1.0.0.0"; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(string.Format(expectedError, startupHookVar)) .And.NotHaveStdErrContaining("--->"); // With space startupHookVar = $"Assembly version"; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(string.Format(expectedError, startupHookVar)) .And.NotHaveStdErrContaining("--->"); // With .dll suffix startupHookVar = $".{Path.AltDirectorySeparatorChar}Assembly.DLl"; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(string.Format(expectedError, startupHookVar)) .And.NotHaveStdErrContaining("--->"); // With invalid name startupHookVar = $"Assembly=Name"; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(string.Format(expectedError, startupHookVar)) .And.HaveStdErrContaining("---> System.IO.FileLoadException: The given assembly name or codebase was invalid."); // Relative path error is caught before any hooks run startupHookVar = startupHookDll + Path.PathSeparator + relativeAssemblyPath; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(string.Format(expectedError, relativeAssemblyPath)) .And.NotHaveStdOutContaining("Hello from startup hook!"); } [Fact] public void Muxer_activation_of_StartupHook_With_Missing_Assembly_Fails() { var fixture = sharedTestState.PortableAppFixture.Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var startupHookFixture = sharedTestState.StartupHookFixture.Copy(); var startupHookDll = startupHookFixture.TestProject.AppDll; var expectedError = "System.ArgumentException: Startup hook assembly '{0}' failed to load."; // With file path which doesn't exist var startupHookVar = startupHookDll + ".missing.dll"; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(string.Format(expectedError, startupHookVar)) .And.HaveStdErrContaining($"---> System.IO.FileNotFoundException: Could not load file or assembly '{startupHookVar}'. The system cannot find the file specified."); // With simple name which won't resolve startupHookVar = "MissingAssembly"; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(string.Format(expectedError, startupHookVar)) .And.HaveStdErrContaining($"---> System.IO.FileNotFoundException: Could not load file or assembly '{startupHookVar}"); } [Fact] public void Muxer_activation_of_StartupHook_WithSimpleAssemblyName_Succeeds() { var fixture = sharedTestState.PortableAppFixture.Copy(); var startupHookFixture = sharedTestState.StartupHookFixture.Copy(); var startupHookDll = startupHookFixture.TestProject.AppDll; var startupHookAssemblyName = Path.GetFileNameWithoutExtension(startupHookDll); File.Copy(startupHookDll, Path.Combine(fixture.TestProject.BuiltApp.Location, Path.GetFileName(startupHookDll))); SharedFramework.AddReferenceToDepsJson( fixture.TestProject.DepsJson, $"{fixture.TestProject.AssemblyName}/1.0.0", startupHookAssemblyName, "1.0.0"); fixture.BuiltDotnet.Exec(fixture.TestProject.AppDll) .EnvironmentVariable(startupHookVarName, startupHookAssemblyName) .CaptureStdOut() .CaptureStdErr() .Execute() .Should().Pass() .And.HaveStdOutContaining("Hello from startup hook!") .And.HaveStdOutContaining("Hello World"); } // Run the app with missing startup hook assembly [Fact] public void Muxer_activation_of_Missing_StartupHook_Assembly_Fails() { var fixture = sharedTestState.PortableAppFixture.Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var startupHookFixture = sharedTestState.StartupHookFixture.Copy(); var startupHookDll = startupHookFixture.TestProject.AppDll; var startupHookMissingDll = Path.Combine(Path.GetDirectoryName(startupHookDll), "StartupHookMissing.dll"); var expectedError = "System.IO.FileNotFoundException: Could not load file or assembly '{0}'."; // Missing dll is detected with appropriate error var startupHookVar = startupHookMissingDll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(String.Format(expectedError, Path.GetFullPath(startupHookMissingDll))); // Missing dll is detected after previous hooks run startupHookVar = startupHookDll + Path.PathSeparator + startupHookMissingDll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdOutContaining("Hello from startup hook!") .And.HaveStdErrContaining(String.Format(expectedError, Path.GetFullPath((startupHookMissingDll)))); } // Run the app with an invalid startup hook assembly [Fact] public void Muxer_activation_of_Invalid_StartupHook_Assembly_Fails() { var fixture = sharedTestState.PortableAppFixture.Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var startupHookFixture = sharedTestState.StartupHookFixture.Copy(); var startupHookDll = startupHookFixture.TestProject.AppDll; var startupHookInvalidAssembly = sharedTestState.StartupHookStartupHookInvalidAssemblyFixture.Copy(); var startupHookInvalidAssemblyDll = Path.Combine(Path.GetDirectoryName(startupHookInvalidAssembly.TestProject.AppDll), "StartupHookInvalidAssembly.dll"); var expectedError = "System.BadImageFormatException"; // Dll load gives meaningful error message dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookInvalidAssemblyDll) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(expectedError); // Dll load error happens after previous hooks run var startupHookVar = startupHookDll + Path.PathSeparator + startupHookInvalidAssemblyDll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(expectedError); } // Run the app with the startup hook type missing [Fact] public void Muxer_activation_of_Missing_StartupHook_Type_Fails() { var fixture = sharedTestState.PortableAppFixture.Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var startupHookFixture = sharedTestState.StartupHookFixture.Copy(); var startupHookDll = startupHookFixture.TestProject.AppDll; var startupHookMissingTypeFixture = sharedTestState.StartupHookWithoutStartupHookTypeFixture.Copy(); var startupHookMissingTypeDll = startupHookMissingTypeFixture.TestProject.AppDll; // Missing type is detected dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookMissingTypeDll) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining("System.TypeLoadException: Could not load type 'StartupHook' from assembly 'StartupHook"); // Missing type is detected after previous hooks have run var startupHookVar = startupHookDll + Path.PathSeparator + startupHookMissingTypeDll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdOutContaining("Hello from startup hook!") .And.HaveStdErrContaining("System.TypeLoadException: Could not load type 'StartupHook' from assembly 'StartupHookWithoutStartupHookType"); } // Run the app with a startup hook that doesn't have any Initialize method [Fact] public void Muxer_activation_of_StartupHook_With_Missing_Method_Fails() { var fixture = sharedTestState.PortableAppFixture.Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var startupHookFixture = sharedTestState.StartupHookFixture.Copy(); var startupHookDll = startupHookFixture.TestProject.AppDll; var startupHookMissingMethodFixture = sharedTestState.StartupHookWithoutInitializeMethodFixture.Copy(); var startupHookMissingMethodDll = startupHookMissingMethodFixture.TestProject.AppDll; var expectedError = "System.MissingMethodException: Method 'StartupHook.Initialize' not found."; // No Initialize method dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookMissingMethodDll) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(expectedError); // Missing Initialize method is caught after previous hooks have run var startupHookVar = startupHookDll + Path.PathSeparator + startupHookMissingMethodDll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdOutContaining("Hello from startup hook!") .And.HaveStdErrContaining(expectedError); } // Run the app with startup hook that has no static void Initialize() method [Fact] public void Muxer_activation_of_StartupHook_With_Incorrect_Method_Signature_Fails() { var fixture = sharedTestState.PortableAppFixture.Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var startupHookFixture = sharedTestState.StartupHookFixture.Copy(); var startupHookDll = startupHookFixture.TestProject.AppDll; var expectedError = "System.ArgumentException: The signature of the startup hook 'StartupHook.Initialize' in assembly '{0}' was invalid. It must be 'public static void Initialize()'."; // Initialize is an instance method var startupHookWithInstanceMethodFixture = sharedTestState.StartupHookWithInstanceMethodFixture.Copy(); var startupHookWithInstanceMethodDll = startupHookWithInstanceMethodFixture.TestProject.AppDll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookWithInstanceMethodDll) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(String.Format(expectedError, startupHookWithInstanceMethodDll)); // Initialize method takes parameters var startupHookWithParameterFixture = sharedTestState.StartupHookWithParameterFixture.Copy(); var startupHookWithParameterDll = startupHookWithParameterFixture.TestProject.AppDll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookWithParameterDll) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(String.Format(expectedError, startupHookWithParameterDll)); // Initialize method has non-void return type var startupHookWithReturnTypeFixture = sharedTestState.StartupHookWithReturnTypeFixture.Copy(); var startupHookWithReturnTypeDll = startupHookWithReturnTypeFixture.TestProject.AppDll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookWithReturnTypeDll) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(String.Format(expectedError, startupHookWithReturnTypeDll)); // Initialize method that has multiple methods with an incorrect signature var startupHookWithMultipleIncorrectSignaturesFixture = sharedTestState.StartupHookWithMultipleIncorrectSignaturesFixture.Copy(); var startupHookWithMultipleIncorrectSignaturesDll = startupHookWithMultipleIncorrectSignaturesFixture.TestProject.AppDll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookWithMultipleIncorrectSignaturesDll) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining(String.Format(expectedError, startupHookWithMultipleIncorrectSignaturesDll)); // Signature problem is caught after previous hooks have run var startupHookVar = startupHookDll + Path.PathSeparator + startupHookWithMultipleIncorrectSignaturesDll; dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookVar) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdOutContaining("Hello from startup hook!") .And.HaveStdErrContaining(String.Format(expectedError, startupHookWithMultipleIncorrectSignaturesDll)); } private static void RemoveLibraryFromDepsJson(string depsJsonPath, string libraryName) { DependencyContext context; using (FileStream fileStream = File.Open(depsJsonPath, FileMode.Open)) { using (DependencyContextJsonReader reader = new DependencyContextJsonReader()) { context = reader.Read(fileStream); } } context = new DependencyContext(context.Target, context.CompilationOptions, context.CompileLibraries, context.RuntimeLibraries.Select(lib => new RuntimeLibrary( lib.Type, lib.Name, lib.Version, lib.Hash, lib.RuntimeAssemblyGroups.Select(assemblyGroup => new RuntimeAssetGroup( assemblyGroup.Runtime, assemblyGroup.RuntimeFiles.Where(f => !f.Path.EndsWith("SharedLibrary.dll")))).ToList().AsReadOnly(), lib.NativeLibraryGroups, lib.ResourceAssemblies, lib.Dependencies, lib.Serviceable, lib.Path, lib.HashPath, lib.RuntimeStoreManifestName)), context.RuntimeGraph); using (FileStream fileStream = File.Open(depsJsonPath, FileMode.Truncate, FileAccess.Write)) { DependencyContextWriter writer = new DependencyContextWriter(); writer.Write(context, fileStream); } } // Run startup hook that adds an assembly resolver [Fact] public void Muxer_activation_of_StartupHook_With_Assembly_Resolver() { var fixture = sharedTestState.PortableAppWithMissingRefFixture.Copy(); var dotnet = fixture.BuiltDotnet; var appDll = fixture.TestProject.AppDll; var appDepsJson = Path.Combine(Path.GetDirectoryName(appDll), Path.GetFileNameWithoutExtension(appDll) + ".deps.json"); RemoveLibraryFromDepsJson(appDepsJson, "SharedLibrary.dll"); var startupHookFixture = sharedTestState.StartupHookWithAssemblyResolver.Copy(); var startupHookDll = startupHookFixture.TestProject.AppDll; // No startup hook results in failure due to missing app dependency dotnet.Exec(appDll) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.HaveStdErrContaining("FileNotFoundException: Could not load file or assembly 'SharedLibrary"); // Startup hook with assembly resolver results in use of injected dependency (which has value 2) dotnet.Exec(appDll) .EnvironmentVariable(startupHookVarName, startupHookDll) .CaptureStdOut() .CaptureStdErr() .Execute(fExpectedToFail: true) .Should().Fail() .And.ExitWith(2); } public class SharedTestState : IDisposable { // Entry point projects public TestProjectFixture PortableAppFixture { get; } public TestProjectFixture PortableAppWithExceptionFixture { get; } // Entry point with missing reference assembly public TestProjectFixture PortableAppWithMissingRefFixture { get; } // Correct startup hooks public TestProjectFixture StartupHookFixture { get; } public TestProjectFixture StartupHookWithOverloadFixture { get; } // Missing startup hook type (no StartupHook type defined) public TestProjectFixture StartupHookWithoutStartupHookTypeFixture { get; } // Missing startup hook method (no Initialize method defined) public TestProjectFixture StartupHookWithoutInitializeMethodFixture { get; } // Invalid startup hook assembly public TestProjectFixture StartupHookStartupHookInvalidAssemblyFixture { get; } // Invalid startup hooks (incorrect signatures) public TestProjectFixture StartupHookWithNonPublicMethodFixture { get; } public TestProjectFixture StartupHookWithInstanceMethodFixture { get; } public TestProjectFixture StartupHookWithParameterFixture { get; } public TestProjectFixture StartupHookWithReturnTypeFixture { get; } public TestProjectFixture StartupHookWithMultipleIncorrectSignaturesFixture { get; } // Valid startup hooks with incorrect behavior public TestProjectFixture StartupHookWithDependencyFixture { get; } // Startup hook with an assembly resolver public TestProjectFixture StartupHookWithAssemblyResolver { get; } public RepoDirectoriesProvider RepoDirectories { get; } public SharedTestState() { RepoDirectories = new RepoDirectoriesProvider(); // Entry point projects PortableAppFixture = new TestProjectFixture("PortableApp", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); PortableAppWithExceptionFixture = new TestProjectFixture("PortableAppWithException", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); // Entry point with missing reference assembly PortableAppWithMissingRefFixture = new TestProjectFixture("PortableAppWithMissingRef", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); // Correct startup hooks StartupHookFixture = new TestProjectFixture("StartupHook", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); StartupHookWithOverloadFixture = new TestProjectFixture("StartupHookWithOverload", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); // Missing startup hook type (no StartupHook type defined) StartupHookWithoutStartupHookTypeFixture = new TestProjectFixture("StartupHookWithoutStartupHookType", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); // Missing startup hook method (no Initialize method defined) StartupHookWithoutInitializeMethodFixture = new TestProjectFixture("StartupHookWithoutInitializeMethod", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); // Invalid startup hook assembly StartupHookStartupHookInvalidAssemblyFixture = new TestProjectFixture("StartupHookFake", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); // Invalid startup hooks (incorrect signatures) StartupHookWithNonPublicMethodFixture = new TestProjectFixture("StartupHookWithNonPublicMethod", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); StartupHookWithInstanceMethodFixture = new TestProjectFixture("StartupHookWithInstanceMethod", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); StartupHookWithParameterFixture = new TestProjectFixture("StartupHookWithParameter", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); StartupHookWithReturnTypeFixture = new TestProjectFixture("StartupHookWithReturnType", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); StartupHookWithMultipleIncorrectSignaturesFixture = new TestProjectFixture("StartupHookWithMultipleIncorrectSignatures", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); // Valid startup hooks with incorrect behavior StartupHookWithDependencyFixture = new TestProjectFixture("StartupHookWithDependency", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); // Startup hook with an assembly resolver StartupHookWithAssemblyResolver = new TestProjectFixture("StartupHookWithAssemblyResolver", RepoDirectories) .EnsureRestored(RepoDirectories.CorehostPackages) .PublishProject(); } public void Dispose() { // Entry point projects PortableAppFixture.Dispose(); PortableAppWithExceptionFixture.Dispose(); // Entry point with missing reference assembly PortableAppWithMissingRefFixture.Dispose(); // Correct startup hooks StartupHookFixture.Dispose(); StartupHookWithOverloadFixture.Dispose(); // Missing startup hook type (no StartupHook type defined) StartupHookWithoutStartupHookTypeFixture.Dispose(); // Missing startup hook method (no Initialize method defined) StartupHookWithoutInitializeMethodFixture.Dispose(); // Invalid startup hook assembly StartupHookStartupHookInvalidAssemblyFixture.Dispose(); // Invalid startup hooks (incorrect signatures) StartupHookWithNonPublicMethodFixture.Dispose(); StartupHookWithInstanceMethodFixture.Dispose(); StartupHookWithParameterFixture.Dispose(); StartupHookWithReturnTypeFixture.Dispose(); StartupHookWithMultipleIncorrectSignaturesFixture.Dispose(); // Valid startup hooks with incorrect behavior StartupHookWithDependencyFixture.Dispose(); // Startup hook with an assembly resolver StartupHookWithAssemblyResolver.Dispose(); } } } }
49.53316
196
0.628127
[ "MIT" ]
06needhamt/runtime
src/installer/tests/HostActivation.Tests/StartupHooks.cs
38,091
C#
using Paperless.Shared.Utils; namespace Colaborador.Domain.CasosDeUso.DeletarColaborador { public interface IDeletarColaborador : IHandlerPrimitive<int, bool> { } }
19.888889
71
0.765363
[ "MIT" ]
rafaelbatistaroque/TCC
Paperless/Features/Colaborador/Colaborador.Domain/CasosDeUso/DeletarColaborador/IDeletarColaborador.cs
181
C#
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. namespace Microsoft.Intune.PowerShellGraphSDK.PowerShellCmdlets { using System.Management.Automation; /// <summary> /// <para type="synopsis">Creates a new object which represents a &quot;microsoft.graph.workbookRangeFont&quot; (or one of its derived types).</para> /// <para type="description">Creates a new object which represents a &quot;microsoft.graph.workbookRangeFont&quot; (or one of its derived types).</para> /// </summary> [Cmdlet("New", "WorkbookRangeFontObject", DefaultParameterSetName = @"microsoft.graph.workbookRangeFont")] [ODataType("microsoft.graph.workbookRangeFont")] public class New_WorkbookRangeFontObject : ObjectFactoryCmdletBase { /// <summary> /// <para type="description">The &quot;bold&quot; property, of type &quot;Edm.Boolean&quot;.</para> /// <para type="description">This property is on the &quot;microsoft.graph.workbookRangeFont&quot; type.</para> /// </summary> [ODataType("Edm.Boolean")] [Selectable] [Parameter(ParameterSetName = @"microsoft.graph.workbookRangeFont", HelpMessage = @"The &quot;bold&quot; property, of type &quot;Edm.Boolean&quot;.")] public System.Boolean bold { get; set; } /// <summary> /// <para type="description">The &quot;color&quot; property, of type &quot;Edm.String&quot;.</para> /// <para type="description">This property is on the &quot;microsoft.graph.workbookRangeFont&quot; type.</para> /// </summary> [ODataType("Edm.String")] [Selectable] [Parameter(ParameterSetName = @"microsoft.graph.workbookRangeFont", HelpMessage = @"The &quot;color&quot; property, of type &quot;Edm.String&quot;.")] public System.String color { get; set; } /// <summary> /// <para type="description">The &quot;italic&quot; property, of type &quot;Edm.Boolean&quot;.</para> /// <para type="description">This property is on the &quot;microsoft.graph.workbookRangeFont&quot; type.</para> /// </summary> [ODataType("Edm.Boolean")] [Selectable] [Parameter(ParameterSetName = @"microsoft.graph.workbookRangeFont", HelpMessage = @"The &quot;italic&quot; property, of type &quot;Edm.Boolean&quot;.")] public System.Boolean italic { get; set; } /// <summary> /// <para type="description">The &quot;name&quot; property, of type &quot;Edm.String&quot;.</para> /// <para type="description">This property is on the &quot;microsoft.graph.workbookRangeFont&quot; type.</para> /// </summary> [ODataType("Edm.String")] [Selectable] [Parameter(ParameterSetName = @"microsoft.graph.workbookRangeFont", HelpMessage = @"The &quot;name&quot; property, of type &quot;Edm.String&quot;.")] public System.String name { get; set; } /// <summary> /// <para type="description">The &quot;size&quot; property, of type &quot;Edm.Double&quot;.</para> /// <para type="description">This property is on the &quot;microsoft.graph.workbookRangeFont&quot; type.</para> /// </summary> [ODataType("Edm.Double")] [Selectable] [Parameter(ParameterSetName = @"microsoft.graph.workbookRangeFont", HelpMessage = @"The &quot;size&quot; property, of type &quot;Edm.Double&quot;.")] public System.Double size { get; set; } /// <summary> /// <para type="description">The &quot;underline&quot; property, of type &quot;Edm.String&quot;.</para> /// <para type="description">This property is on the &quot;microsoft.graph.workbookRangeFont&quot; type.</para> /// </summary> [ODataType("Edm.String")] [Selectable] [Parameter(ParameterSetName = @"microsoft.graph.workbookRangeFont", HelpMessage = @"The &quot;underline&quot; property, of type &quot;Edm.String&quot;.")] public System.String underline { get; set; } } }
60.115942
162
0.649952
[ "MIT" ]
365Academic/Intune-PowerShell-SDK
PowerShellCmdlets/Generated/ObjectFactories/WorkbookRangeFontObject.cs
4,148
C#
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Collections.Generic; namespace BuildXL.Utilities.Configuration.Resolvers { /// <summary> /// Settings for resolvers which allow configurable untracking /// </summary> public interface IUntrackingSettings { /// <summary> /// Cones to flag as untracked /// </summary> IReadOnlyList<DirectoryArtifact> UntrackedDirectoryScopes { get; } /// <summary> /// Files to flag as untracked /// </summary> IReadOnlyList<FileArtifact> UntrackedFiles { get; } /// <summary> /// Directories to flag as untracked /// </summary> IReadOnlyList<DirectoryArtifact> UntrackedDirectories { get; } } }
28.275862
75
0.607317
[ "MIT" ]
Bhaskers-Blu-Org2/BuildXL
Public/Src/Utilities/Configuration/Resolvers/IUntrackingSettings.cs
822
C#
// UI Pointer|UI|80020 namespace VRTK { using UnityEngine; using UnityEngine.EventSystems; /// <summary> /// Event Payload /// </summary> /// <param name="controllerIndex">The index of the controller that was used.</param> /// <param name="isActive">The state of whether the UI Pointer is currently active or not.</param> /// <param name="currentTarget">The current UI element that the pointer is colliding with.</param> /// <param name="previousTarget">The previous UI element that the pointer was colliding with.</param> /// <param name="raycastResult">The raw raycast result of the UI ray collision.</param> public struct UIPointerEventArgs { public uint controllerIndex; public bool isActive; public GameObject currentTarget; public GameObject previousTarget; public RaycastResult raycastResult; } /// <summary> /// Event Payload /// </summary> /// <param name="sender">this object</param> /// <param name="e"><see cref="UIPointerEventArgs"/></param> public delegate void UIPointerEventHandler(object sender, UIPointerEventArgs e); /// <summary> /// The UI Pointer provides a mechanism for interacting with Unity UI elements on a world canvas. The UI Pointer can be attached to any game object the same way in which a Base Pointer can be and the UI Pointer also requires a controller to initiate the pointer activation and pointer click states. /// </summary> /// <remarks> /// The simplest way to use the UI Pointer is to attach the script to a game controller along with a Simple Pointer as this provides visual feedback as to where the UI ray is pointing. /// /// The UI pointer is activated via the `Pointer` alias on the `Controller Events` and the UI pointer click state is triggered via the `UI Click` alias on the `Controller Events`. /// </remarks> /// <example> /// `VRTK/Examples/034_Controls_InteractingWithUnityUI` uses the `VRTK_UIPointer` script on the right Controller to allow for the interaction with Unity UI elements using a Simple Pointer beam. The left Controller controls a Simple Pointer on the headset to demonstrate gaze interaction with Unity UI elements. /// </example> public class VRTK_UIPointer : MonoBehaviour { /// <summary> /// Methods of activation. /// </summary> /// <param name="HoldButton">Only activates the UI Pointer when the Pointer button on the controller is pressed and held down.</param> /// <param name="ToggleButton">Activates the UI Pointer on the first click of the Pointer button on the controller and it stays active until the Pointer button is clicked again.</param> /// <param name="AlwaysOn">The UI Pointer is always active regardless of whether the Pointer button on the controller is pressed or not.</param> public enum ActivationMethods { HoldButton, ToggleButton, AlwaysOn } /// <summary> /// Methods of when to consider a UI Click action /// </summary> /// <param name="ClickOnButtonUp">Consider a UI Click action has happened when the UI Click alias button is released.</param> /// <param name="ClickOnButtonDown">Consider a UI Click action has happened when the UI Click alias button is pressed.</param> public enum ClickMethods { ClickOnButtonUp, ClickOnButtonDown } [Header("Activation Settings")] [Tooltip("The button used to activate/deactivate the UI raycast for the pointer.")] public VRTK_ControllerEvents.ButtonAlias activationButton = VRTK_ControllerEvents.ButtonAlias.TouchpadPress; [Tooltip("Determines when the UI pointer should be active.")] public ActivationMethods activationMode = ActivationMethods.HoldButton; [Header("Selection Settings")] [Tooltip("The button used to execute the select action at the pointer's target position.")] public VRTK_ControllerEvents.ButtonAlias selectionButton = VRTK_ControllerEvents.ButtonAlias.TriggerPress; [Tooltip("Determines when the UI Click event action should happen.")] public ClickMethods clickMethod = ClickMethods.ClickOnButtonUp; [Tooltip("Determines whether the UI click action should be triggered when the pointer is deactivated. If the pointer is hovering over a clickable element then it will invoke the click action on that element. Note: Only works with `Click Method = Click_On_Button_Up`")] public bool attemptClickOnDeactivate = false; [Tooltip("The amount of time the pointer can be over the same UI element before it automatically attempts to click it. 0f means no click attempt will be made.")] public float clickAfterHoverDuration = 0f; [Header("Customisation Settings")] [Tooltip("The controller that will be used to toggle the pointer. If the script is being applied onto a controller then this parameter can be left blank as it will be auto populated by the controller the script is on at runtime.")] public VRTK_ControllerEvents controller; [Tooltip("A custom transform to use as the origin of the pointer. If no pointer origin transform is provided then the transform the script is attached to is used.")] public Transform pointerOriginTransform = null; // custom - begin [Header("Custom")] public VRTK_BasePointerRenderer pointerRenderer; // custom - end [HideInInspector] public PointerEventData pointerEventData; [HideInInspector] public GameObject hoveringElement; [HideInInspector] public GameObject controllerRenderModel; [HideInInspector] public float hoverDurationTimer = 0f; [HideInInspector] public bool canClickOnHover = false; /// <summary> /// The GameObject of the front trigger activator of the canvas currently being activated by this pointer. /// </summary> [HideInInspector] public GameObject autoActivatingCanvas = null; /// <summary> /// Determines if the UI Pointer has collided with a valid canvas that has collision click turned on. /// </summary> [HideInInspector] public bool collisionClick = false; /// <summary> /// Emitted when the UI activation button is pressed. /// </summary> public event ControllerInteractionEventHandler ActivationButtonPressed; /// <summary> /// Emitted when the UI activation button is released. /// </summary> public event ControllerInteractionEventHandler ActivationButtonReleased; /// <summary> /// Emitted when the UI selection button is pressed. /// </summary> public event ControllerInteractionEventHandler SelectionButtonPressed; /// <summary> /// Emitted when the UI selection button is released. /// </summary> public event ControllerInteractionEventHandler SelectionButtonReleased; /// <summary> /// Emitted when the UI Pointer is colliding with a valid UI element. /// </summary> public event UIPointerEventHandler UIPointerElementEnter; /// <summary> /// Emitted when the UI Pointer is no longer colliding with any valid UI elements. /// </summary> public event UIPointerEventHandler UIPointerElementExit; /// <summary> /// Emitted when the UI Pointer has clicked the currently collided UI element. /// </summary> public event UIPointerEventHandler UIPointerElementClick; /// <summary> /// Emitted when the UI Pointer begins dragging a valid UI element. /// </summary> public event UIPointerEventHandler UIPointerElementDragStart; /// <summary> /// Emitted when the UI Pointer stops dragging a valid UI element. /// </summary> public event UIPointerEventHandler UIPointerElementDragEnd; protected bool pointerClicked = false; protected bool beamEnabledState = false; protected bool lastPointerPressState = false; protected bool lastPointerClickState = false; protected GameObject currentTarget; protected EventSystem cachedEventSystem; protected VRTK_VRInputModule cachedVRInputModule; public virtual void OnUIPointerElementEnter(UIPointerEventArgs e) { if (e.currentTarget != currentTarget) { ResetHoverTimer(); } if (clickAfterHoverDuration > 0f && hoverDurationTimer <= 0f) { canClickOnHover = true; hoverDurationTimer = clickAfterHoverDuration; } currentTarget = e.currentTarget; if (UIPointerElementEnter != null) { UIPointerElementEnter(this, e); } } public virtual void OnUIPointerElementExit(UIPointerEventArgs e) { if (e.previousTarget == currentTarget) { ResetHoverTimer(); } if (UIPointerElementExit != null) { UIPointerElementExit(this, e); if (attemptClickOnDeactivate && !e.isActive && e.previousTarget) { pointerEventData.pointerPress = e.previousTarget; } } } public virtual void OnUIPointerElementClick(UIPointerEventArgs e) { if (e.currentTarget == currentTarget) { ResetHoverTimer(); } if (UIPointerElementClick != null) { UIPointerElementClick(this, e); } } public virtual void OnUIPointerElementDragStart(UIPointerEventArgs e) { if (UIPointerElementDragStart != null) { UIPointerElementDragStart(this, e); } } public virtual void OnUIPointerElementDragEnd(UIPointerEventArgs e) { if (UIPointerElementDragEnd != null) { UIPointerElementDragEnd(this, e); } } public virtual void OnActivationButtonPressed(ControllerInteractionEventArgs e) { if (ActivationButtonPressed != null) { ActivationButtonPressed(this, e); } } public virtual void OnActivationButtonReleased(ControllerInteractionEventArgs e) { if (ActivationButtonReleased != null) { ActivationButtonReleased(this, e); } } public virtual void OnSelectionButtonPressed(ControllerInteractionEventArgs e) { if (SelectionButtonPressed != null) { SelectionButtonPressed(this, e); } } public virtual void OnSelectionButtonReleased(ControllerInteractionEventArgs e) { if (SelectionButtonReleased != null) { SelectionButtonReleased(this, e); } } public virtual UIPointerEventArgs SetUIPointerEvent(RaycastResult currentRaycastResult, GameObject currentTarget, GameObject lastTarget = null) { UIPointerEventArgs e; e.controllerIndex = (controller != null ? VRTK_DeviceFinder.GetControllerIndex(controller.gameObject) : uint.MaxValue); e.isActive = PointerActive(); e.currentTarget = currentTarget; e.previousTarget = lastTarget; e.raycastResult = currentRaycastResult; return e; } /// <summary> /// The SetEventSystem method is used to set up the global Unity event system for the UI pointer. It also handles disabling the existing Standalone Input Module that exists on the EventSystem and adds a custom VRTK Event System VR Input component that is required for interacting with the UI with VR inputs. /// </summary> /// <param name="eventSystem">The global Unity event system to be used by the UI pointers.</param> /// <returns>A custom input module that is used to detect input from VR pointers.</returns> public virtual VRTK_VRInputModule SetEventSystem(EventSystem eventSystem) { if (!eventSystem) { VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_SCENE, "VRTK_UIPointer", "EventSystem")); return null; } if (!(eventSystem is VRTK_EventSystem)) { eventSystem = eventSystem.gameObject.AddComponent<VRTK_EventSystem>(); } return eventSystem.GetComponent<VRTK_VRInputModule>(); } /// <summary> /// The RemoveEventSystem resets the Unity EventSystem back to the original state before the VRTK_VRInputModule was swapped for it. /// </summary> public virtual void RemoveEventSystem() { var vrtkEventSystem = FindObjectOfType<VRTK_EventSystem>(); if (!vrtkEventSystem) { VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_SCENE, "VRTK_UIPointer", "EventSystem")); return; } Destroy(vrtkEventSystem); } /// <summary> /// The PointerActive method determines if the ui pointer beam should be active based on whether the pointer alias is being held and whether the Hold Button To Use parameter is checked. /// </summary> /// <returns>Returns true if the ui pointer should be currently active.</returns> public virtual bool PointerActive() { if (activationMode == ActivationMethods.AlwaysOn || autoActivatingCanvas != null) { return true; } else if (activationMode == ActivationMethods.HoldButton) { return IsActivationButtonPressed(); } else { pointerClicked = false; if (IsActivationButtonPressed() && !lastPointerPressState) { pointerClicked = true; } lastPointerPressState = (controller != null ? controller.IsButtonPressed(activationButton) : false); if (pointerClicked) { beamEnabledState = !beamEnabledState; } return beamEnabledState; } } /// <summary> /// The IsActivationButtonPressed method is used to determine if the configured activation button is currently in the active state. /// </summary> /// <returns>Returns true if the activation button is active.</returns> public virtual bool IsActivationButtonPressed() { return (controller != null ? controller.IsButtonPressed(activationButton) : false); } /// <summary> /// The IsSelectionButtonPressed method is used to determine if the configured selection button is currently in the active state. /// </summary> /// <returns>Returns true if the selection button is active.</returns> public virtual bool IsSelectionButtonPressed() { return (controller != null ? controller.IsButtonPressed(selectionButton) : false); } /// <summary> /// The ValidClick method determines if the UI Click button is in a valid state to register a click action. /// </summary> /// <param name="checkLastClick">If this is true then the last frame's state of the UI Click button is also checked to see if a valid click has happened.</param> /// <param name="lastClickState">This determines what the last frame's state of the UI Click button should be in for it to be a valid click.</param> /// <returns>Returns true if the UI Click button is in a valid state to action a click, returns false if it is not in a valid state.</returns> public virtual bool ValidClick(bool checkLastClick, bool lastClickState = false) { var controllerClicked = (collisionClick ? collisionClick : IsSelectionButtonPressed()); var result = (checkLastClick ? controllerClicked && lastPointerClickState == lastClickState : controllerClicked); lastPointerClickState = controllerClicked; return result; } /// <summary> /// The GetOriginPosition method returns the relevant transform position for the pointer based on whether the pointerOriginTransform variable is valid. /// </summary> /// <returns>A Vector3 of the pointer transform position</returns> public virtual Vector3 GetOriginPosition() { return (pointerOriginTransform ? pointerOriginTransform.position : transform.position); } /// <summary> /// The GetOriginPosition method returns the relevant transform forward for the pointer based on whether the pointerOriginTransform variable is valid. /// </summary> /// <returns>A Vector3 of the pointer transform forward</returns> public virtual Vector3 GetOriginForward() { return (pointerOriginTransform ? pointerOriginTransform.forward : transform.forward); } protected virtual void OnEnable() { pointerOriginTransform = (pointerOriginTransform == null ? VRTK_SDK_Bridge.GenerateControllerPointerOrigin(gameObject) : pointerOriginTransform); controller = (controller != null ? controller : GetComponent<VRTK_ControllerEvents>()); ConfigureEventSystem(); pointerClicked = false; lastPointerPressState = false; lastPointerClickState = false; beamEnabledState = false; if (controller != null) { controllerRenderModel = VRTK_SDK_Bridge.GetControllerRenderModel(controller.gameObject); controller.SubscribeToButtonAliasEvent(activationButton, true, DoActivationButtonPressed); controller.SubscribeToButtonAliasEvent(activationButton, false, DoActivationButtonReleased); controller.SubscribeToButtonAliasEvent(selectionButton, true, DoSelectionButtonPressed); controller.SubscribeToButtonAliasEvent(selectionButton, false, DoSelectionButtonReleased); } } protected virtual void OnDisable() { if (cachedVRInputModule && cachedVRInputModule.pointers.Contains(this)) { cachedVRInputModule.pointers.Remove(this); } if (controller != null) { controller.UnsubscribeToButtonAliasEvent(activationButton, true, DoActivationButtonPressed); controller.UnsubscribeToButtonAliasEvent(activationButton, false, DoActivationButtonReleased); controller.UnsubscribeToButtonAliasEvent(selectionButton, true, DoSelectionButtonPressed); controller.UnsubscribeToButtonAliasEvent(selectionButton, false, DoSelectionButtonReleased); } } protected virtual void LateUpdate() { if (controller != null) { pointerEventData.pointerId = (int)VRTK_DeviceFinder.GetControllerIndex(controller.gameObject); } } protected virtual void DoActivationButtonPressed(object sender, ControllerInteractionEventArgs e) { OnActivationButtonPressed(controller.SetControllerEvent()); } protected virtual void DoActivationButtonReleased(object sender, ControllerInteractionEventArgs e) { OnActivationButtonReleased(controller.SetControllerEvent()); } protected virtual void DoSelectionButtonPressed(object sender, ControllerInteractionEventArgs e) { OnSelectionButtonPressed(controller.SetControllerEvent()); } protected virtual void DoSelectionButtonReleased(object sender, ControllerInteractionEventArgs e) { OnSelectionButtonReleased(controller.SetControllerEvent()); } protected virtual void ResetHoverTimer() { hoverDurationTimer = 0f; canClickOnHover = false; } protected virtual void ConfigureEventSystem() { if (!cachedEventSystem) { cachedEventSystem = FindObjectOfType<EventSystem>(); } if (!cachedVRInputModule) { cachedVRInputModule = SetEventSystem(cachedEventSystem); } if (cachedEventSystem && cachedVRInputModule) { if (pointerEventData == null) { pointerEventData = new PointerEventData(cachedEventSystem); } if (!cachedVRInputModule.pointers.Contains(this)) { cachedVRInputModule.pointers.Add(this); } } } } }
43.725051
315
0.637198
[ "MIT" ]
Mufifnman/5P
PartyTime/Assets/VRTK/Scripts/UI/VRTK_UIPointer.cs
21,471
C#
using System; using System.Collections.Generic; using System.Text; namespace KLib { public class KRPCBatchRequest { public int requestId; public KRPCRequest[] list_request; } }
14.0625
43
0.631111
[ "MIT" ]
linchenrr/kakaTools
donetCore/KLib/KLib/net/rpc/KRPCBatchRequest.cs
227
C#
using Homebank.Core.Repositories; using Homebank.Web.Models; using Homebank.Core.Helpers; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Homebank.Core.Interfaces.Repositories; namespace Homebank.Web.Controllers { [Authorize] public class UserController : BaseController { private readonly IUserRepository _userRepository; public UserController(IUserRepository userRepository) : base(userRepository) { _userRepository = userRepository; } public ActionResult Settings() { var model = new SettingsModel {Name = HomebankUser.Name, OriginalName = HomebankUser.Name}; return View(model); } [ValidateAntiForgeryToken] [HttpPost] public ActionResult Settings(SettingsModel model) { if (ModelState.IsValid) { var user = HomebankUser; user.Name = model.Name; if (!string.IsNullOrEmpty(model.NewPassword)) { user.Salt = StringHelpers.RandomString(25); user.Password = StringHelpers.Hash(model.NewPassword + user.Salt); } _userRepository.Update(user); _userRepository.SaveChanges(); return RedirectToAction("Index", "Home"); } return View(model); } } }
24.134615
94
0.688446
[ "MIT" ]
curcas/Homebank
src/Homebank.Web/Controllers/UserController.cs
1,257
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the resourcegroupstaggingapi-2017-01-26.normal.json service model. */ using System; using System.Collections.Generic; using System.Text; using System.Collections; using System.Threading; using System.Threading.Tasks; using Amazon.Runtime; namespace Amazon.ResourceGroupsTaggingAPI.Model { /// <summary> /// Base class for GetResources paginators. /// </summary> internal sealed partial class GetResourcesPaginator : IPaginator<GetResourcesResponse>, IGetResourcesPaginator { private readonly IAmazonResourceGroupsTaggingAPI _client; private readonly GetResourcesRequest _request; private int _isPaginatorInUse = 0; /// <summary> /// Enumerable containing all full responses for the operation /// </summary> public IPaginatedEnumerable<GetResourcesResponse> Responses => new PaginatedResponse<GetResourcesResponse>(this); /// <summary> /// Enumerable containing all of the ResourceTagMappingList /// </summary> public IPaginatedEnumerable<ResourceTagMapping> ResourceTagMappingList => new PaginatedResultKeyResponse<GetResourcesResponse, ResourceTagMapping>(this, (i) => i.ResourceTagMappingList); internal GetResourcesPaginator(IAmazonResourceGroupsTaggingAPI client, GetResourcesRequest request) { this._client = client; this._request = request; } #if BCL IEnumerable<GetResourcesResponse> IPaginator<GetResourcesResponse>.Paginate() { if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0) { throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance."); } PaginatorUtils.SetUserAgentAdditionOnRequest(_request); var paginationToken = _request.PaginationToken; GetResourcesResponse response; do { _request.PaginationToken = paginationToken; response = _client.GetResources(_request); paginationToken = response.PaginationToken; yield return response; } while (!string.IsNullOrEmpty(paginationToken)); } #endif #if AWS_ASYNC_ENUMERABLES_API async IAsyncEnumerable<GetResourcesResponse> IPaginator<GetResourcesResponse>.PaginateAsync(CancellationToken cancellationToken = default) { if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0) { throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance."); } PaginatorUtils.SetUserAgentAdditionOnRequest(_request); var paginationToken = _request.PaginationToken; GetResourcesResponse response; do { _request.PaginationToken = paginationToken; response = await _client.GetResourcesAsync(_request, cancellationToken).ConfigureAwait(false); paginationToken = response.PaginationToken; cancellationToken.ThrowIfCancellationRequested(); yield return response; } while (!string.IsNullOrEmpty(paginationToken)); } #endif } }
41.247423
150
0.676831
[ "Apache-2.0" ]
ChristopherButtars/aws-sdk-net
sdk/src/Services/ResourceGroupsTaggingAPI/Generated/Model/_bcl45+netstandard/GetResourcesPaginator.cs
4,001
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.Ecs.Model.V20140526; namespace Aliyun.Acs.Ecs.Transform.V20140526 { public class DescribePrefixListAttributesResponseUnmarshaller { public static DescribePrefixListAttributesResponse Unmarshall(UnmarshallerContext _ctx) { DescribePrefixListAttributesResponse describePrefixListAttributesResponse = new DescribePrefixListAttributesResponse(); describePrefixListAttributesResponse.HttpResponse = _ctx.HttpResponse; describePrefixListAttributesResponse.RequestId = _ctx.StringValue("DescribePrefixListAttributes.RequestId"); describePrefixListAttributesResponse.PrefixListId = _ctx.StringValue("DescribePrefixListAttributes.PrefixListId"); describePrefixListAttributesResponse.PrefixListName = _ctx.StringValue("DescribePrefixListAttributes.PrefixListName"); describePrefixListAttributesResponse.AddressFamily = _ctx.StringValue("DescribePrefixListAttributes.AddressFamily"); describePrefixListAttributesResponse.MaxEntries = _ctx.IntegerValue("DescribePrefixListAttributes.MaxEntries"); describePrefixListAttributesResponse.Description = _ctx.StringValue("DescribePrefixListAttributes.Description"); describePrefixListAttributesResponse.CreationTime = _ctx.StringValue("DescribePrefixListAttributes.CreationTime"); List<DescribePrefixListAttributesResponse.DescribePrefixListAttributes_Entry> describePrefixListAttributesResponse_entries = new List<DescribePrefixListAttributesResponse.DescribePrefixListAttributes_Entry>(); for (int i = 0; i < _ctx.Length("DescribePrefixListAttributes.Entries.Length"); i++) { DescribePrefixListAttributesResponse.DescribePrefixListAttributes_Entry entry = new DescribePrefixListAttributesResponse.DescribePrefixListAttributes_Entry(); entry.Cidr = _ctx.StringValue("DescribePrefixListAttributes.Entries["+ i +"].Cidr"); entry.Description = _ctx.StringValue("DescribePrefixListAttributes.Entries["+ i +"].Description"); describePrefixListAttributesResponse_entries.Add(entry); } describePrefixListAttributesResponse.Entries = describePrefixListAttributesResponse_entries; return describePrefixListAttributesResponse; } } }
55.214286
213
0.809185
[ "Apache-2.0" ]
doublnt/aliyun-openapi-net-sdk
aliyun-net-sdk-ecs/Ecs/Transform/V20140526/DescribePrefixListAttributesResponseUnmarshaller.cs
3,092
C#
/******************************************************************************/ /* Project - Unity CJ Lib https://github.com/TheAllenChou/unity-cj-lib Author - Ming-Lun "Allen" Chou Web - http://AllenChou.net Twitter - @TheAllenChou */ /******************************************************************************/ using UnityEngine; using CjLib; namespace TurbulentRainbowGpuParticles { public class Main : MonoBehaviour { public ComputeShader m_shader; private const int kNumParticles = 10000; /* private struct Particle { // 4 floats Vector3 m_position; float m_damping; // 4 floats Quaternion m_rotation; // 4 floats Vector3 m_linearVelocity; float m_scale; // 4 floats Quaternion m_angularVelocity; // 4 floats Vector4 m_lifetime; // 4 floats Color m_color; }; */ private ComputeBuffer m_computeBuffer; private ComputeBuffer m_instanceArgsBuffer; //private Particle[] m_debugBuffer; private Mesh m_mesh; private Material m_material; private MaterialPropertyBlock m_materialProperties; private int m_csInitKernelId; private int m_csStepKernelId; private int m_csParticleBufferId; private int m_csScaleId; private int m_csDampingId; private int m_csSpeedId; private int m_csLifetimeId; private int m_csNumParticlesId; private int m_csTimeId; void OnEnable() { m_mesh = new Mesh(); m_mesh = PrimitiveMeshFactory.BoxFlatShaded(); int particleStride = sizeof(float) * 24; m_computeBuffer = new ComputeBuffer(kNumParticles, particleStride); uint[] instanceArgs = new uint[] { 0, 0, 0, 0, 0 }; m_instanceArgsBuffer = new ComputeBuffer(1, instanceArgs.Length * sizeof(uint), ComputeBufferType.IndirectArguments); instanceArgs[0] = (uint) m_mesh.GetIndexCount(0); instanceArgs[1] = (uint) kNumParticles; instanceArgs[2] = (uint) m_mesh.GetIndexStart(0); instanceArgs[3] = (uint) m_mesh.GetBaseVertex(0); m_instanceArgsBuffer.SetData(instanceArgs); //m_debugBuffer = new Particle[kNumParticles]; m_csInitKernelId = m_shader.FindKernel("Init"); m_csStepKernelId = m_shader.FindKernel("Step"); m_csParticleBufferId = Shader.PropertyToID("particleBuffer"); m_csScaleId = Shader.PropertyToID("scale"); m_csDampingId = Shader.PropertyToID("damping"); m_csSpeedId = Shader.PropertyToID("speed"); m_csLifetimeId = Shader.PropertyToID("lifetime"); m_csNumParticlesId = Shader.PropertyToID("numParticles"); m_csTimeId = Shader.PropertyToID("time"); m_material = new Material(Shader.Find("CjLib/Example/TurbulentRainbowGpuParticles")); m_material.enableInstancing = true; m_material.SetBuffer(m_csParticleBufferId, m_computeBuffer); m_materialProperties = new MaterialPropertyBlock(); m_shader.SetFloats(m_csScaleId, new float[] { 0.15f, 0.3f }); m_shader.SetFloat(m_csDampingId, 6.0f); m_shader.SetFloats(m_csSpeedId, new float[] { 3.0f, 4.0f, 1.0f, 6.0f }); m_shader.SetFloats(m_csLifetimeId, new float[] { 0.1f, 0.5f, 0.5f, 0.1f }); m_shader.SetInt(m_csNumParticlesId, kNumParticles); m_shader.SetBuffer(m_csInitKernelId, m_csParticleBufferId, m_computeBuffer); m_shader.SetBuffer(m_csStepKernelId, m_csParticleBufferId, m_computeBuffer); m_shader.Dispatch(m_csInitKernelId, kNumParticles, 1, 1); //m_computeBuffer.GetData(m_debugBuffer); } void Update() { m_shader.SetFloats(m_csTimeId, new float[] { Time.time, Time.fixedDeltaTime }); m_shader.Dispatch(m_csStepKernelId, kNumParticles, 1, 1); //m_computeBuffer.GetData(m_debugBuffer); Graphics.DrawMeshInstancedIndirect(m_mesh, 0, m_material, new Bounds(Vector3.zero, 20.0f * Vector3.one), m_instanceArgsBuffer, 0, m_materialProperties, UnityEngine.Rendering.ShadowCastingMode.On); } void OnDisable() { if (m_computeBuffer != null) { m_computeBuffer.Dispose(); m_computeBuffer = null; } if (m_instanceArgsBuffer != null) { m_instanceArgsBuffer.Dispose(); m_instanceArgsBuffer = null; } } } }
30.104895
202
0.658769
[ "MIT" ]
Harrison-Dev/unity-cj-lib
Unity CJ Lib/Assets/Example/Turbulent Rainbow GPU Particles/Main.cs
4,307
C#
#region license // Copyright (c) 2005 - 2007 Ayende Rahien (ayende@ayende.com) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // * Neither the name of Ayende Rahien nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion using System; using Xunit; namespace Rhino.Mocks.Tests.FieldsProblem { /// <summary> /// Summary description for Bug_45. /// </summary> public class ClassThatImplementsGetHashCodeAndEquals { [Fact] public void InitClass() { EmployeeInfo info = (EmployeeInfo)MockRepository.GenerateStrictMock(typeof(EmployeeInfo), null, "ID001"); Assert.NotNull(info); } [Serializable] public class EmployeeInfo { public EmployeeInfo(string employeeId) { if (employeeId == null || employeeId.Length == 0) { throw new ArgumentNullException("employeeId"); } } #region Object Members /// <summary> /// Returns a string representation of this instance. /// </summary> public override string ToString() { return null; } /// <summary> /// Gets the hash code for this instance. /// </summary> public override int GetHashCode() { return this.ToString().GetHashCode(); } /// <summary> /// Determines whether the specified instance is equal to this instance. /// </summary> public override bool Equals(object obj) { EmployeeInfo objToCompare = obj as EmployeeInfo; if (objToCompare == null) { return false; } return (this.GetHashCode() == objToCompare.GetHashCode()); } #endregion } } }
32.284211
110
0.685686
[ "BSD-3-Clause" ]
alaendle/rhino-mocks
Rhino.Mocks.Tests/FieldsProblem/ClassThatImplementsGetHashCodeAndEquals.cs
3,069
C#
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ using System.Collections.Generic; using Aliyun.Acs.Core; namespace Aliyun.Acs.linkedmall.Model.V20180116 { public class QueryItemInventoryResponse : AcsResponse { private string requestId; private string code; private string message; private string subCode; private string subMessage; private bool? success; private List<QueryItemInventory_Item> itemList; public string RequestId { get { return requestId; } set { requestId = value; } } public string Code { get { return code; } set { code = value; } } public string Message { get { return message; } set { message = value; } } public string SubCode { get { return subCode; } set { subCode = value; } } public string SubMessage { get { return subMessage; } set { subMessage = value; } } public bool? Success { get { return success; } set { success = value; } } public List<QueryItemInventory_Item> ItemList { get { return itemList; } set { itemList = value; } } public class QueryItemInventory_Item { private long? itemId; private string lmItemId; private List<QueryItemInventory_Sku> skuList; public long? ItemId { get { return itemId; } set { itemId = value; } } public string LmItemId { get { return lmItemId; } set { lmItemId = value; } } public List<QueryItemInventory_Sku> SkuList { get { return skuList; } set { skuList = value; } } public class QueryItemInventory_Sku { private long? skuId; private QueryItemInventory_Inventory inventory; public long? SkuId { get { return skuId; } set { skuId = value; } } public QueryItemInventory_Inventory Inventory { get { return inventory; } set { inventory = value; } } public class QueryItemInventory_Inventory { private long? quantity; public long? Quantity { get { return quantity; } set { quantity = value; } } } } } } }
15.089686
63
0.560475
[ "Apache-2.0" ]
AxiosCros/aliyun-openapi-net-sdk
aliyun-net-sdk-linkedmall/Linkedmall/Model/V20180116/QueryItemInventoryResponse.cs
3,365
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using FlubuCore.Context.FluentInterface.Interfaces; using FlubuCore.Context.FluentInterface.TaskExtensions; using FlubuCore.Targeting; using FlubuCore.Tasks; namespace FlubuCore.Context.FluentInterface { public class TargetFluentInterface : TargetBaseFluentInterface<ITarget>, ITarget { public ITarget DependsOn(params string[] targetNames) { LastTargetAction = TargetAction.AddDependency; ActionCount = targetNames.Length; Target.DependsOn(targetNames); return this; } public ITarget DependsOn(params ITargetInternal[] targets) { LastTargetAction = TargetAction.AddDependency; ActionCount = targets.Length; Target.DependsOn(targets); return this; } public ITarget DependsOn(params ITarget[] targets) { LastTargetAction = TargetAction.AddDependency; ActionCount = targets.Length; foreach (var t in targets) { var target = (TargetFluentInterface)t; Target.DependsOn(target.Target); } return this; } public ITarget DependsOnAsync(params ITargetInternal[] targets) { LastTargetAction = TargetAction.AddDependency; ActionCount = targets.Length; Target.DependsOnAsync(targets); return this; } public ITarget DependsOnAsync(params ITarget[] targets) { LastTargetAction = TargetAction.AddDependency; ActionCount = targets.Length; foreach (var t in targets) { var target = (TargetFluentInterface)t; Target.DependsOnAsync(target.Target); } return this; } public ITarget SetAsDefault() { LastTargetAction = TargetAction.Other; ActionCount = 0; Target.SetAsDefault(); return this; } public ITarget SetDescription(string description) { LastTargetAction = TargetAction.Other; ActionCount = 0; Target.SetDescription(description); return this; } public ITarget SetAsHidden() { LastTargetAction = TargetAction.Other; ActionCount = 0; Target.SetAsHidden(); return this; } public ITarget Group(Action<ITargetBaseFluentInterfaceOfT<ITarget>> targetAction, Action<ITaskContext> onFinally = null, Action<ITaskContext, Exception> onError = null, Func<ITaskContext, bool> when = null, bool cleanupOnCancel = false) { LastTargetAction = TargetAction.Other; ActionCount = 0; TaskGroup = new TaskGroup { GroupId = Guid.NewGuid().ToString(), OnErrorAction = onError, FinallyAction = onFinally, CleanupOnCancel = cleanupOnCancel }; var conditionMeet = when?.Invoke(Context); if (conditionMeet.HasValue == false || conditionMeet.Value) { targetAction.Invoke(this); } TaskGroup = null; return this; } public ITarget AddTasks(Action<ITarget> action) { action?.Invoke(this); return this; } public ITarget AddTasks<T>(Action<ITarget, T> action, T param) { action?.Invoke(this, param); return this; } public ITarget AddTasks<T, T2>(Action<ITarget, T, T2> action, T param, T2 param2) { action?.Invoke(this, param, param2); return this; } public ITarget AddTasks<T, T2, T3>(Action<ITarget, T, T2, T3> action, T param, T2 param2, T3 param3) { action?.Invoke(this, param, param2, param3); return this; } public ITarget AddTasks<T, T2, T3, T4>(Action<ITarget, T, T2, T3, T4> action, T param, T2 param2, T3 param3, T4 param4) { action?.Invoke(this, param, param2, param3, param4); return this; } public ITarget AddTasks<T, T2, T3, T4, T5>(Action<ITarget, T, T2, T3, T4, T5> action, T param, T2 param2, T3 param3, T4 param4, T5 param5) { action?.Invoke(this, param, param2, param3, param4, param5); return this; } public ITarget AddTasks<T, T2, T3, T4, T5, T6>(Action<ITarget, T, T2, T3, T4, T5, T6> action, T param, T2 param2, T3 param3, T4 param4, T5 param5, T6 param6) { action?.Invoke(this, param, param2, param3, param4, param5, param6); return this; } public ITarget AddTasks<T, T2, T3, T4, T5, T6, T7>( Action<ITarget, T, T2, T3, T4, T5, T6, T7> action, T param, T2 param2, T3 param3, T4 param4, T5 param5, T6 param6, T7 param7) { action?.Invoke(this, param, param2, param3, param4, param5, param6, param7); return this; } public ITarget AddTasks<T, T2, T3, T4, T5, T6, T7, T8>( Action<ITarget, T, T2, T3, T4, T5, T6, T7, T8> action, T param, T2 param2, T3 param3, T4 param4, T5 param5, T6 param6, T7 param7, T8 param8) { action?.Invoke(this, param, param2, param3, param4, param5, param6, param7, param8); return this; } } }
32.689655
244
0.56083
[ "BSD-2-Clause" ]
0xflotus/FlubuCore
FlubuCore/Context/FluentInterface/TargetFluentInterface.cs
5,690
C#
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; public class QueryClientEvaluationWarningDataContext : DbContext { #region QueryClientEvaluationWarning protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.ConfigureWarnings( warnings => { warnings.Throw(RelationalEventId.QueryClientEvaluationWarning); }); } #endregion }
25.684211
81
0.711066
[ "MIT" ]
schernyh/GraphQL.EntityFramework
src/Snippets/QueryClientEvaluationWarningDataContext.cs
490
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; namespace UnityAudioFramework { public class AudioBin : MonoBehaviour { // Use this for initialization void Start () { } } }
13.75
40
0.727273
[ "MIT" ]
tarcisiotm/UnityAudioFramework
Assets/Scripts/managers/AudioBin.cs
222
C#
using MatterHackers.VectorMath; namespace MatterHackers.Agg.VertexSource { internal class ContourGenerator : IGenerator { private StrokeMath m_stroker; private double m_width; private VertexSequence m_src_vertices; private Vector2Container m_out_vertices; private StrokeMath.status_e m_status; private int m_src_vertex; private int m_out_vertex; private bool m_closed; private ShapePath.FlagsAndCommand m_orientation; private bool m_auto_detect; private double m_shorten; public ContourGenerator() { m_stroker = new StrokeMath(); m_width = 1; m_src_vertices = new VertexSequence(); m_out_vertices = new Vector2Container(); m_status = StrokeMath.status_e.initial; m_src_vertex = 0; m_closed = false; m_orientation = 0; m_auto_detect = false; } public void line_cap(LineCap lc) { m_stroker.line_cap(lc); } public void line_join(LineJoin lj) { m_stroker.line_join(lj); } public void inner_join(InnerJoin ij) { m_stroker.inner_join(ij); } public LineCap line_cap() { return m_stroker.line_cap(); } public LineJoin line_join() { return m_stroker.line_join(); } public InnerJoin inner_join() { return m_stroker.inner_join(); } public void width(double w) { m_stroker.width(w); } public void miter_limit(double ml) { m_stroker.miter_limit(ml); } public void miter_limit_theta(double t) { m_stroker.miter_limit_theta(t); } public void inner_miter_limit(double ml) { m_stroker.inner_miter_limit(ml); } public void approximation_scale(double approx_scale) { m_stroker.approximation_scale(approx_scale); } public double width() { return m_stroker.width(); } public double miter_limit() { return m_stroker.miter_limit(); } public double inner_miter_limit() { return m_stroker.inner_miter_limit(); } public double approximation_scale() { return m_stroker.approximation_scale(); } public void shorten(double s) { m_shorten = s; } public double shorten() { return m_shorten; } public void auto_detect_orientation(bool v) { m_auto_detect = v; } public bool auto_detect_orientation() { return m_auto_detect; } // Generator interface public void RemoveAll() { m_src_vertices.remove_all(); m_closed = false; m_status = StrokeMath.status_e.initial; } public void AddVertex(double x, double y, ShapePath.FlagsAndCommand cmd) { m_status = StrokeMath.status_e.initial; if (ShapePath.is_move_to(cmd)) { m_src_vertices.modify_last(new VertexDistance(x, y)); } else { if (ShapePath.is_vertex(cmd)) { m_src_vertices.add(new VertexDistance(x, y)); } else { if (ShapePath.is_end_poly(cmd)) { m_closed = (ShapePath.get_close_flag(cmd) == ShapePath.FlagsAndCommand.FlagClose); if (m_orientation == ShapePath.FlagsAndCommand.FlagNone) { m_orientation = ShapePath.get_orientation(cmd); } } } } } // Vertex Source Interface public void Rewind(int idx) { if (m_status == StrokeMath.status_e.initial) { m_src_vertices.close(true); if (m_auto_detect) { if (!ShapePath.is_oriented(m_orientation)) { m_orientation = (agg_math.calc_polygon_area(m_src_vertices) > 0.0) ? ShapePath.FlagsAndCommand.FlagCCW : ShapePath.FlagsAndCommand.FlagCW; } } if (ShapePath.is_oriented(m_orientation)) { m_stroker.width(ShapePath.is_ccw(m_orientation) ? m_width : -m_width); } } m_status = StrokeMath.status_e.ready; m_src_vertex = 0; } public ShapePath.FlagsAndCommand Vertex(ref double x, ref double y) { ShapePath.FlagsAndCommand cmd = ShapePath.FlagsAndCommand.LineTo; while (!ShapePath.is_stop(cmd)) { switch (m_status) { case StrokeMath.status_e.initial: Rewind(0); goto case StrokeMath.status_e.ready; case StrokeMath.status_e.ready: if (m_src_vertices.size() < 2 + (m_closed ? 1 : 0)) { cmd = ShapePath.FlagsAndCommand.Stop; break; } m_status = StrokeMath.status_e.outline1; cmd = ShapePath.FlagsAndCommand.MoveTo; m_src_vertex = 0; m_out_vertex = 0; goto case StrokeMath.status_e.outline1; case StrokeMath.status_e.outline1: if (m_src_vertex >= m_src_vertices.size()) { m_status = StrokeMath.status_e.end_poly1; break; } m_stroker.calc_join(m_out_vertices, m_src_vertices.prev(m_src_vertex), m_src_vertices.curr(m_src_vertex), m_src_vertices.next(m_src_vertex), m_src_vertices.prev(m_src_vertex).dist, m_src_vertices.curr(m_src_vertex).dist); ++m_src_vertex; m_status = StrokeMath.status_e.out_vertices; m_out_vertex = 0; goto case StrokeMath.status_e.out_vertices; case StrokeMath.status_e.out_vertices: if (m_out_vertex >= m_out_vertices.size()) { m_status = StrokeMath.status_e.outline1; } else { Vector2 c = m_out_vertices[m_out_vertex++]; x = c.X; y = c.Y; return cmd; } break; case StrokeMath.status_e.end_poly1: if (!m_closed) return ShapePath.FlagsAndCommand.Stop; m_status = StrokeMath.status_e.stop; return ShapePath.FlagsAndCommand.EndPoly | ShapePath.FlagsAndCommand.FlagClose | ShapePath.FlagsAndCommand.FlagCCW; case StrokeMath.status_e.stop: return ShapePath.FlagsAndCommand.Stop; } } return cmd; } } }
22.242063
121
0.6719
[ "BSD-2-Clause" ]
0000duck/agg-sharp
agg/VertexSource/ContourGenerator.cs
5,607
C#
//------------------------------------------------------------------------------ // <copyright file="IIS7Runtime.cs" company="Microsoft"> // Copyright (c) Microsoft Corporation. All rights reserved. // </copyright> //------------------------------------------------------------------------------ /* * The ASP.NET/IIS 7 integrated pipeline runtime service host * * Copyright (c) 2004 Microsoft Corporation */ namespace System.Web.Hosting { using System.Collections; using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; using System.Security.Permissions; using System.Security.Principal; using System.Text; using System.Threading; using System.Web.Util; using System.Web; using System.Web.Management; using System.IO; using IIS = UnsafeIISMethods; delegate void AsyncCompletionDelegate( IntPtr rootedObjectsPointer, int bytesRead, int hresult, IntPtr pAsyncCompletionContext); delegate void AsyncDisconnectNotificationDelegate( IntPtr pManagedRootedObjects); // this delegate is called from native code // each time a native-managed // transition is made to process a request state delegate int ExecuteFunctionDelegate( IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, int flags); delegate IntPtr PrincipalFunctionDelegate( IntPtr rootedObjectsPointer, int requestingAppDomainId); delegate int RoleFunctionDelegate( IntPtr pRootedObjects, IntPtr pszRole, int cchRole, out bool isInRole); // this delegate is called from native code when the request is complete // to free any managed resources associated with the request delegate void DisposeFunctionDelegate( [In] IntPtr rootedObjectsPointer ); [ComImport, Guid("c96cb854-aec2-4208-9ada-a86a96860cb6"), System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] internal interface IPipelineRuntime { void StartProcessing(); void StopProcessing(); void InitializeApplication([In] IntPtr appContext); IntPtr GetAsyncCompletionDelegate(); IntPtr GetAsyncDisconnectNotificationDelegate(); IntPtr GetExecuteDelegate(); IntPtr GetDisposeDelegate(); IntPtr GetRoleDelegate(); IntPtr GetPrincipalDelegate(); } /// <include file='doc\ISAPIRuntime.uex' path='docs/doc[@for="ISAPIRuntime"]/*' /> /// <devdoc> /// <para>[To be supplied.]</para> /// </devdoc> /// <internalonly/> internal sealed class PipelineRuntime : MarshalByRefObject, IPipelineRuntime, IRegisteredObject { // initialization error handling internal const string InitExceptionModuleName = "AspNetInitializationExceptionModule"; private const string s_InitExceptionModulePrecondition = ""; // to control removal from unmanaged table (to it only once) private static int s_isThisAppDomainRemovedFromUnmanagedTable; private static IntPtr s_ApplicationContext; private static string s_thisAppDomainsIsapiAppId; // when GL_APPLICATION_STOP fires, this is set to true to indicate that we can unload the AppDomain private static bool s_StopProcessingCalled; private static bool s_InitializationCompleted; // keep rooted through the app domain lifetime private static object _delegatelock = new object(); private static int _inIndicateCompletionCount; private static IntPtr _asyncCompletionDelegatePointer = IntPtr.Zero; private static AsyncCompletionDelegate _asyncCompletionDelegate = null; private static IntPtr _asyncDisconnectNotificationDelegatePointer = IntPtr.Zero; private static AsyncDisconnectNotificationDelegate _asyncDisconnectNotificationDelegate = null; private static IntPtr _executeDelegatePointer = IntPtr.Zero; private static ExecuteFunctionDelegate _executeDelegate = null; private static IntPtr _disposeDelegatePointer = IntPtr.Zero; private static DisposeFunctionDelegate _disposeDelegate = null; private static IntPtr _roleDelegatePointer = IntPtr.Zero; private static RoleFunctionDelegate _roleDelegate = null; private static IntPtr _principalDelegatePointer = IntPtr.Zero; private static PrincipalFunctionDelegate _principalDelegate = null; public IntPtr GetAsyncCompletionDelegate() { if (IntPtr.Zero == _asyncCompletionDelegatePointer) { lock (_delegatelock) { if (IntPtr.Zero == _asyncCompletionDelegatePointer) { AsyncCompletionDelegate d = new AsyncCompletionDelegate(AsyncCompletionHandler); if (null != d) { IntPtr p = Marshal.GetFunctionPointerForDelegate(d); if (IntPtr.Zero != p) { _asyncCompletionDelegate = d; _asyncCompletionDelegatePointer = p; } } } } } return _asyncCompletionDelegatePointer; } public IntPtr GetAsyncDisconnectNotificationDelegate() { if (IntPtr.Zero == _asyncDisconnectNotificationDelegatePointer) { lock (_delegatelock) { if (IntPtr.Zero == _asyncDisconnectNotificationDelegatePointer) { AsyncDisconnectNotificationDelegate d = new AsyncDisconnectNotificationDelegate(AsyncDisconnectNotificationHandler); if (null != d) { IntPtr p = Marshal.GetFunctionPointerForDelegate(d); if (IntPtr.Zero != p) { _asyncDisconnectNotificationDelegate = d; _asyncDisconnectNotificationDelegatePointer = p; } } } } } return _asyncDisconnectNotificationDelegatePointer; } public IntPtr GetExecuteDelegate() { if (IntPtr.Zero == _executeDelegatePointer) { lock (_delegatelock) { if (IntPtr.Zero == _executeDelegatePointer) { ExecuteFunctionDelegate d = new ExecuteFunctionDelegate(ProcessRequestNotification); if (null != d) { IntPtr p = Marshal.GetFunctionPointerForDelegate(d); if (IntPtr.Zero != p) { Thread.MemoryBarrier(); _executeDelegate = d; _executeDelegatePointer = p; } } } } } return _executeDelegatePointer; } public IntPtr GetDisposeDelegate() { if (IntPtr.Zero == _disposeDelegatePointer) { lock (_delegatelock) { if (IntPtr.Zero == _disposeDelegatePointer) { DisposeFunctionDelegate d = new DisposeFunctionDelegate(DisposeHandler); if (null != d) { IntPtr p = Marshal.GetFunctionPointerForDelegate(d); if (IntPtr.Zero != p) { Thread.MemoryBarrier(); _disposeDelegate = d; _disposeDelegatePointer = p; } } } } } return _disposeDelegatePointer; } public IntPtr GetRoleDelegate() { if (IntPtr.Zero == _roleDelegatePointer) { lock (_delegatelock) { if (IntPtr.Zero == _roleDelegatePointer) { RoleFunctionDelegate d = new RoleFunctionDelegate(RoleHandler); if (null != d) { IntPtr p = Marshal.GetFunctionPointerForDelegate(d); if (IntPtr.Zero != p) { Thread.MemoryBarrier(); _roleDelegate = d; _roleDelegatePointer = p; } } } } } return _roleDelegatePointer; } public IntPtr GetPrincipalDelegate() { if (IntPtr.Zero == _principalDelegatePointer) { lock (_delegatelock) { if (IntPtr.Zero == _principalDelegatePointer) { PrincipalFunctionDelegate d = new PrincipalFunctionDelegate(GetManagedPrincipalHandler); if (null != d) { IntPtr p = Marshal.GetFunctionPointerForDelegate(d); if (IntPtr.Zero != p) { Thread.MemoryBarrier(); _principalDelegate = d; _principalDelegatePointer = p; } } } } } return _principalDelegatePointer; } [SecurityPermission(SecurityAction.Demand, UnmanagedCode=true)] public PipelineRuntime() { HostingEnvironment.RegisterObject(this); Debug.Trace("PipelineDomain", "RegisterObject(this) called"); } [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.Infrastructure)] public override Object InitializeLifetimeService() { return null; // never expire lease } public void StartProcessing() { Debug.Trace("PipelineDomain", "StartProcessing AppId = " + s_thisAppDomainsIsapiAppId); HostingEnvironment.SetupStopListeningHandler(); } [EnvironmentPermission(SecurityAction.Assert, Unrestricted = true)] public void StopProcessing() { Debug.Trace("PipelineDomain", "StopProcessing with stack = " + Environment.StackTrace + " for AppId= " + s_thisAppDomainsIsapiAppId); if (!HostingEnvironment.StopListeningWasCalled && !HostingEnvironment.ShutdownInitiated) { // If GL_STOP_LISTENING wasn't triggered, the reset is likely due to a configuration change. HttpRuntime.SetShutdownReason(ApplicationShutdownReason.ConfigurationChange, "IIS configuration change"); } s_StopProcessingCalled = true; // inititate shutdown and // require the native callback for Stop HostingEnvironment.InitiateShutdownWithoutDemand(); } internal static void WaitForRequestsToDrain() { if (s_ApplicationContext == IntPtr.Zero) { // If InitializeApplication was never called, then no requests ever came in and StopProcessing will never be called. // We can just short-circuit this method. return; } while (!s_StopProcessingCalled || _inIndicateCompletionCount > 0) { Thread.Sleep(250); } } private StringBuilder FormatExceptionMessage(Exception e, string[] strings) { StringBuilder sb = new StringBuilder(4096); if (null != strings) { for (int i = 0; i < strings.Length; i++) { sb.Append(strings[i]); } } for (Exception current = e; current != null; current = current.InnerException) { if (current == e) sb.Append("\r\n\r\nException: "); else sb.Append("\r\n\r\nInnerException: "); sb.Append(current.GetType().FullName); sb.Append("\r\nMessage: "); sb.Append(current.Message); sb.Append("\r\nStackTrace: "); sb.Append(current.StackTrace); } return sb; } public void InitializeApplication(IntPtr appContext) { s_ApplicationContext = appContext; // DevDiv #381425 - webengine4!RegisterModule runs *after* HostingEnvironment.Initialize (and thus the // HttpRuntime static ctor) when application preload is active. This means that any global state set // by RegisterModule (like the IIS version information, whether we're in integrated mode, misc server // info, etc.) will be unavailable to PreAppStart / preload code when the preload feature is active. // But since RegisterModule runs before InitializeApplication, we have one last chance here to collect // the information before the main part of the application starts, and the pipeline can depend on it // to be accurate. HttpRuntime.PopulateIISVersionInformation(); HttpApplication app = null; try { // if HttpRuntime.HostingInit failed, do not attempt to create the application (WOS #1653963) if (!HttpRuntime.HostingInitFailed) { // // On IIS7, application initialization does not provide an http context. Theoretically, // no one should be using the context during application initialization, but people do. // Create a dummy context that is used during application initialization // to prevent breakage (ISAPI mode always provides a context) // HttpWorkerRequest initWorkerRequest = new SimpleWorkerRequest("" /*page*/, "" /*query*/, new StringWriter(CultureInfo.InvariantCulture)); MimeMapping.SetIntegratedApplicationContext(appContext); HttpContext initHttpContext = new HttpContext(initWorkerRequest); app = HttpApplicationFactory.GetPipelineApplicationInstance(appContext, initHttpContext); } } catch(Exception e) { if (HttpRuntime.InitializationException == null) { HttpRuntime.InitializationException = e; } } finally { s_InitializationCompleted = true; if (HttpRuntime.InitializationException != null) { // at least one module must be registered so that we // call ProcessRequestNotification later and send the formatted // InitializationException to the client. int hresult = UnsafeIISMethods.MgdRegisterEventSubscription( appContext, InitExceptionModuleName, RequestNotification.BeginRequest, 0 /*postRequestNotifications*/, InitExceptionModuleName, s_InitExceptionModulePrecondition, new IntPtr(-1), false /*useHighPriority*/); if (hresult < 0) { throw new COMException( SR.GetString(SR.Failed_Pipeline_Subscription, InitExceptionModuleName), hresult ); } // Always register a managed handler: // WOS 1990290: VS F5 Debugging: "AspNetInitializationExceptionModule" is registered for RQ_BEGIN_REQUEST, // but the DEBUG verb skips notifications until post RQ_AUTHENTICATE_REQUEST. hresult = UnsafeIISMethods.MgdRegisterEventSubscription( appContext, HttpApplication.IMPLICIT_HANDLER, RequestNotification.ExecuteRequestHandler /*requestNotifications*/, 0 /*postRequestNotifications*/, String.Empty /*type*/, HttpApplication.MANAGED_PRECONDITION /*precondition*/, new IntPtr(-1), false /*useHighPriority*/); if (hresult < 0) { throw new COMException( SR.GetString(SR.Failed_Pipeline_Subscription, HttpApplication.IMPLICIT_HANDLER), hresult ); } } if (app != null) { HttpApplicationFactory.RecyclePipelineApplicationInstance(app); } } } private static HttpContext UnwrapContext(IntPtr rootedObjectsPointer) { RootedObjects objects = RootedObjects.FromPointer(rootedObjectsPointer); return objects.HttpContext; } internal bool HostingShutdownInitiated { get { return HostingEnvironment.ShutdownInitiated; } } // called from native code when the IHttpContext is disposed internal static void AsyncCompletionHandler(IntPtr rootedObjectsPointer, int bytesCompleted, int hresult, IntPtr pAsyncCompletionContext) { HttpContext context = UnwrapContext(rootedObjectsPointer); IIS7WorkerRequest wr = context.WorkerRequest as IIS7WorkerRequest; wr.OnAsyncCompletion(bytesCompleted, hresult, pAsyncCompletionContext); } // called from native code when the IHttpConnection is disconnected internal static void AsyncDisconnectNotificationHandler(IntPtr pManagedRootedObjects) { // Every object we're about to call into should be live / non-disposed, // but since we're paranoid we should put guard clauses everywhere. Debug.Assert(pManagedRootedObjects != IntPtr.Zero); if (pManagedRootedObjects != IntPtr.Zero) { RootedObjects rootObj = RootedObjects.FromPointer(pManagedRootedObjects); Debug.Assert(rootObj != null); if (rootObj != null) { IIS7WorkerRequest workerRequest = rootObj.WorkerRequest; Debug.Assert(workerRequest != null); if (workerRequest != null) { workerRequest.NotifyOfAsyncDisconnect(); } } } } // Called from native code to see if a principal is in a given role internal static int RoleHandler(IntPtr pRootedObjects, IntPtr pszRole, int cchRole, out bool isInRole) { isInRole = false; IPrincipal principal = RootedObjects.FromPointer(pRootedObjects).Principal; if (principal != null) { try { isInRole = principal.IsInRole(StringUtil.StringFromWCharPtr(pszRole, cchRole)); } catch (Exception e) { return Marshal.GetHRForException(e); } } return HResults.S_OK; } // Called from native code to get the managed principal for a given request // If the return value is non-zero, the caller must free the returned GCHandle internal static IntPtr GetManagedPrincipalHandler(IntPtr pRootedObjects, int requestingAppDomainId) { // DevDiv 375079: Server.TransferRequest can be used to transfer requests to different applications, // which means that we might be trying to pass a GCHandle to the IPrincipal object to a different // AppDomain, which is disallowed. If this happens, we just tell our caller that we can't give him // a managed IPrincipal object. if (requestingAppDomainId != AppDomain.CurrentDomain.Id) { return IntPtr.Zero; } IPrincipal principal = RootedObjects.FromPointer(pRootedObjects).Principal; return GCUtil.RootObject(principal); } // called from native code when the IHttpContext is disposed internal static void DisposeHandler(IntPtr rootedObjectsPointer) { RootedObjects root = RootedObjects.FromPointer(rootedObjectsPointer); root.Destroy(); } // called from managed code as a perf optimization to avoid calling back later internal static void DisposeHandler(HttpContext context, IntPtr nativeRequestContext, RequestNotificationStatus status) { if (IIS.MgdCanDisposeManagedContext(nativeRequestContext, status)) { context.RootedObjects.Destroy(); } } // // This is the managed entry point for processing request notifications. // Although this method is wrapped in try/catch, it is not supposed to // cause an exception. If it does throw, the application, httpwriter, etc // may not be initialized, and it might not be possible to process the rest // of the request. I would prefer to let this method throw and crash the // process, but for now we will consume the exception, report the error to // IIS, and continue. // // Code that might throw belongs in HttpRuntime::ProcessRequestNotificationPrivate. // internal static int ProcessRequestNotification( IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, int flags) { try { return ProcessRequestNotificationHelper(rootedObjectsPointer, nativeRequestContext, moduleData, flags); } catch(Exception e) { ApplicationManager.RecordFatalException(e); throw; } } internal static int ProcessRequestNotificationHelper( IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, int flags) { IIS7WorkerRequest wr = null; HttpContext context = null; RequestNotificationStatus status = RequestNotificationStatus.Continue; RootedObjects root; bool workerRequestWasJustCreated = false; if (rootedObjectsPointer == IntPtr.Zero) { InitializeRequestContext(nativeRequestContext, flags, out wr, out context); workerRequestWasJustCreated = true; if (context == null) { return (int)RequestNotificationStatus.FinishRequest; } root = RootedObjects.Create(); root.HttpContext = context; root.WorkerRequest = wr; root.WriteTransferEventIfNecessary(); context.RootedObjects = root; IIS.MgdSetManagedHttpContext(nativeRequestContext, root.Pointer); } else { root = RootedObjects.FromPointer(rootedObjectsPointer); context = root.HttpContext; wr = root.WorkerRequest as IIS7WorkerRequest; } Debug.Assert(root != null, "We should have a RootedObjects instance by this point."); Debug.Assert(wr != null, "We should have an IIS7WorkerRequest instance by this point."); using (root.WithinTraceBlock()) { if (workerRequestWasJustCreated) { AspNetEventSource.Instance.RequestStarted(wr); } int currentModuleIndex; bool isPostNotification; int currentNotification; IIS.MgdGetCurrentNotificationInfo(nativeRequestContext, out currentModuleIndex, out isPostNotification, out currentNotification); // If the HttpContext is null at this point, then we've already transitioned this request to a WebSockets request. // The WebSockets module should already be running, and asynchronous module-level events (like SendResponse) are // ineligible to be hooked by managed code. if (context == null || context.HasWebSocketRequestTransitionStarted) { return (int)RequestNotificationStatus.Continue; } // It is possible for a notification to complete asynchronously while we're in // a call to IndicateCompletion, in which case a new IIS thread might enter before // the call to IndicateCompletion returns. If this happens, block the thread until // IndicateCompletion returns. But never block a SendResponse notification, because // that can cause the request to hang (DevDiv Bugs 187441). if (context.InIndicateCompletion && context.ThreadInsideIndicateCompletion != Thread.CurrentThread && RequestNotification.SendResponse != (RequestNotification)currentNotification) { while (context.InIndicateCompletion) { Thread.Sleep(10); } } // RQ_SEND_RESPONSE fires out of band and completes synchronously only. // The pipeline must be reentrant to support this, so the notification // context for the previous notification must be saved and restored. NotificationContext savedNotificationContext = context.NotificationContext; bool cancellable = context.IsInCancellablePeriod; bool locked = false; try { if (cancellable) { context.EndCancellablePeriod(); } bool isReEntry = (savedNotificationContext != null); if (isReEntry) { context.ApplicationInstance.AcquireNotifcationContextLock(ref locked); } context.NotificationContext = new NotificationContext(flags /*CurrentNotificationFlags*/, isReEntry); status = HttpRuntime.ProcessRequestNotification(wr, context); } finally { if (status != RequestNotificationStatus.Pending) { // if we completed the notification, pop the notification context stack // if this is an asynchronous unwind, then the completion will clear the context context.NotificationContext = savedNotificationContext; // DevDiv 112755 restore cancellable state if its changed if (cancellable && !context.IsInCancellablePeriod) { context.BeginCancellablePeriod(); } else if (!cancellable && context.IsInCancellablePeriod) { context.EndCancellablePeriod(); } } if (locked) { context.ApplicationInstance.ReleaseNotifcationContextLock(); } } if (status != RequestNotificationStatus.Pending) { // The current notification may have changed due to the HttpApplication progressing the IIS state machine, so retrieve the info again. IIS.MgdGetCurrentNotificationInfo(nativeRequestContext, out currentModuleIndex, out isPostNotification, out currentNotification); // WOS 1785741: (Perf) In profiles, 8% of HelloWorld is transitioning from native to managed. // The fix is to keep managed code on the stack so that the AppDomain context remains on the // thread, and we can re-enter managed code without setting up the AppDomain context. // If this optimization is possible, MgdIndicateCompletion will execute one or more notifications // and return PENDING as the status. ThreadContext threadContext = context.IndicateCompletionContext; // DevDiv 482614: // Don't use local copy to detect if we can call MgdIndicateCompletion because another thread // unwinding from MgdIndicateCompletion may be changing context.IndicateCompletionContext at the same time. if (!context.InIndicateCompletion && context.IndicateCompletionContext != null) { if (status == RequestNotificationStatus.Continue) { try { context.InIndicateCompletion = true; Interlocked.Increment(ref _inIndicateCompletionCount); context.ThreadInsideIndicateCompletion = Thread.CurrentThread; IIS.MgdIndicateCompletion(nativeRequestContext, ref status); } finally { context.ThreadInsideIndicateCompletion = null; Interlocked.Decrement(ref _inIndicateCompletionCount); // Leave will have been called already if the last notification is returning pending // DTS267762: Make sure InIndicateCompletion is released, not based on the thread context state // Otherwise the next request notification may deadlock if (!threadContext.HasBeenDisassociatedFromThread || context.InIndicateCompletion) { lock (threadContext) { if (!threadContext.HasBeenDisassociatedFromThread) { threadContext.DisassociateFromCurrentThread(); } context.IndicateCompletionContext = null; context.InIndicateCompletion = false; } } } } else { if (!threadContext.HasBeenDisassociatedFromThread || context.InIndicateCompletion) { lock (threadContext) { if (!threadContext.HasBeenDisassociatedFromThread) { threadContext.DisassociateFromCurrentThread(); } context.IndicateCompletionContext = null; context.InIndicateCompletion = false; } } } } } if (context.HasWebSocketRequestTransitionStarted && status == RequestNotificationStatus.Pending) { // At this point, the WebSocket module event (PostEndRequest) has executed and set up the appropriate contexts for us. // However, there is a race condition that we need to avoid. It is possible that one thread has kicked off some async // work, e.g. via an IHttpAsyncHandler, and that thread is unwinding and has reached this line of execution. // Meanwhile, the IHttpAsyncHandler completed quickly (but asynchronously) and invoked MgdPostCompletion, which // resulted in a new thread calling ProcessRequestNotification. If this second thread starts the WebSocket transition, // then there's the risk that *both* threads might attempt to call WebSocketPipeline.ProcessRequest, which could AV // the process. // // We protect against this by allowing only the thread which started the transition to complete the transition, so in // the above scenario the original thread (which invoked the IHttpAsyncHandler) no-ops at this point and just returns // Pending to its caller. if (context.DidCurrentThreadStartWebSocketTransition) { // We'll mark the HttpContext as complete, call the continuation to kick off the socket send / receive loop, and return // Pending to IIS so that it doesn't advance the state machine until the WebSocket loop completes. root.ReleaseHttpContext(); root.WebSocketPipeline.ProcessRequest(); } } return (int)status; } } private static void InitializeRequestContext(IntPtr nativeRequestContext, int flags, out IIS7WorkerRequest wr, out HttpContext context) { wr = null; context = null; try { bool etwEnabled = ((flags & HttpContext.FLAG_ETW_PROVIDER_ENABLED) == HttpContext.FLAG_ETW_PROVIDER_ENABLED); // this may throw, e.g. if the request Content-Length header has a value greater than Int32.MaxValue wr = IIS7WorkerRequest.CreateWorkerRequest(nativeRequestContext, etwEnabled); // this may throw, e.g. see WOS 1724573: ASP.Net v2.0: wrong error code returned when ? is used in the URL context = new HttpContext(wr, false); } catch { // treat as "400 Bad Request" since that's the only reason the HttpContext.ctor should throw IIS.MgdSetBadRequestStatus(nativeRequestContext); } } /// <include file='doc\ISAPIRuntime.uex' path='docs/doc[@for="ISAPIRuntime.IRegisteredObject.Stop"]/*' /> /// <internalonly/> void IRegisteredObject.Stop(bool immediate) { Debug.Trace("PipelineDomain", "IRegisteredObject.Stop appId = " + s_thisAppDomainsIsapiAppId); while (!s_InitializationCompleted && !s_StopProcessingCalled) { // the native W3_MGD_APP_CONTEXT is not ready for us to unload Thread.Sleep(250); } RemoveThisAppDomainFromUnmanagedTable(); HostingEnvironment.UnregisterObject(this); } internal void SetThisAppDomainsIsapiAppId(String appId) { Debug.Trace("PipelineDomain", "SetThisAppDomainsPipelineAppId appId=" + appId); s_thisAppDomainsIsapiAppId = appId; } internal static void RemoveThisAppDomainFromUnmanagedTable() { if (Interlocked.Exchange(ref s_isThisAppDomainRemovedFromUnmanagedTable, 1) != 0) { return; } // // only notify mgdeng of this shutdown if we went through // Initialize from the there // We can also have PipelineRuntime in app domains with only // other protocols // try { if (s_thisAppDomainsIsapiAppId != null && s_ApplicationContext != IntPtr.Zero) { Debug.Trace("PipelineDomain", "Calling MgdAppDomainShutdown appId=" + s_thisAppDomainsIsapiAppId + " (AppDomainAppId=" + HttpRuntime.AppDomainAppId + ")"); UnsafeIISMethods.MgdAppDomainShutdown(s_ApplicationContext); } HttpRuntime.AddAppDomainTraceMessage(SR.GetString(SR.App_Domain_Restart)); } catch(Exception e) { if (ShouldRethrowException(e)) { throw; } } } internal static bool ShouldRethrowException(Exception ex) { return ex is NullReferenceException || ex is AccessViolationException || ex is StackOverflowException || ex is OutOfMemoryException || ex is System.Threading.ThreadAbortException; } } }
48.87234
185
0.569302
[ "Apache-2.0" ]
Distrotech/mono
external/referencesource/System.Web/Hosting/IPipelineRuntime.cs
36,752
C#
using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Collections.Generic; using System.Text; using System.Text.Encodings.Web; using System.Linq; using System.Threading.Tasks; using Infrastructure.Identity.Models; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Logging; namespace WebUI.Areas.Identity.Pages.Account.Manage { public class EnableAuthenticatorModel : PageModel { private readonly UserManager<ApplicationUser> _userManager; private readonly ILogger<EnableAuthenticatorModel> _logger; private readonly UrlEncoder _urlEncoder; private const string AuthenticatorUriFormat = "otpauth://totp/{0}:{1}?secret={2}&issuer={0}&digits=6"; public EnableAuthenticatorModel( UserManager<ApplicationUser> userManager, ILogger<EnableAuthenticatorModel> logger, UrlEncoder urlEncoder) { _userManager = userManager; _logger = logger; _urlEncoder = urlEncoder; } public string SharedKey { get; set; } public string AuthenticatorUri { get; set; } [TempData] public string[] RecoveryCodes { get; set; } [TempData] public string StatusMessage { get; set; } [BindProperty] public InputModel Input { get; set; } public class InputModel { [Required] [StringLength(7, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] [DataType(DataType.Text)] [Display(Name = "Verification Code")] public string Code { get; set; } } public async Task<IActionResult> OnGetAsync() { var user = await _userManager.GetUserAsync(User); if (user == null) { return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'."); } await LoadSharedKeyAndQrCodeUriAsync(user); return Page(); } public async Task<IActionResult> OnPostAsync() { var user = await _userManager.GetUserAsync(User); if (user == null) { return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'."); } if (!ModelState.IsValid) { await LoadSharedKeyAndQrCodeUriAsync(user); return Page(); } // Strip spaces and hypens var verificationCode = Input.Code.Replace(" ", string.Empty).Replace("-", string.Empty); var is2faTokenValid = await _userManager.VerifyTwoFactorTokenAsync( user, _userManager.Options.Tokens.AuthenticatorTokenProvider, verificationCode); if (!is2faTokenValid) { ModelState.AddModelError("Input.Code", "Verification code is invalid."); await LoadSharedKeyAndQrCodeUriAsync(user); return Page(); } await _userManager.SetTwoFactorEnabledAsync(user, true); var userId = await _userManager.GetUserIdAsync(user); _logger.LogInformation("User with ID '{UserId}' has enabled 2FA with an authenticator app.", userId); StatusMessage = "Your authenticator app has been verified."; if (await _userManager.CountRecoveryCodesAsync(user) == 0) { var recoveryCodes = await _userManager.GenerateNewTwoFactorRecoveryCodesAsync(user, 10); RecoveryCodes = recoveryCodes.ToArray(); return RedirectToPage("./ShowRecoveryCodes"); } else { return RedirectToPage("./TwoFactorAuthentication"); } } private async Task LoadSharedKeyAndQrCodeUriAsync(ApplicationUser user) { // Load the authenticator key & QR code URI to display on the form var unformattedKey = await _userManager.GetAuthenticatorKeyAsync(user); if (string.IsNullOrEmpty(unformattedKey)) { await _userManager.ResetAuthenticatorKeyAsync(user); unformattedKey = await _userManager.GetAuthenticatorKeyAsync(user); } SharedKey = FormatKey(unformattedKey); var email = await _userManager.GetEmailAsync(user); AuthenticatorUri = GenerateQrCodeUri(email, unformattedKey); } private string FormatKey(string unformattedKey) { var result = new StringBuilder(); int currentPosition = 0; while (currentPosition + 4 < unformattedKey.Length) { result.Append(unformattedKey.Substring(currentPosition, 4)).Append(" "); currentPosition += 4; } if (currentPosition < unformattedKey.Length) { result.Append(unformattedKey.Substring(currentPosition)); } return result.ToString().ToLowerInvariant(); } private string GenerateQrCodeUri(string email, string unformattedKey) { return string.Format( AuthenticatorUriFormat, _urlEncoder.Encode("WebUI"), _urlEncoder.Encode(email), unformattedKey); } } }
34.974684
127
0.602425
[ "MIT" ]
DurkaTechnologies/AdminPanel
WebUI/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml.cs
5,528
C#
// Copyright (c) 2018 Jon P Smith, GitHub: JonPSmith, web: http://www.thereformedprogrammer.net/ // Licensed under MIT licence. See License.txt in the project root for license information. using System.Threading.Tasks; using TestBizLayer.BizDTOs; namespace TestBizLayer.ActionsTransactional.Concrete { public class BizTranActionFinalAsync : BizTranActionBase, IBizTranActionFinalAsync { public BizTranActionFinalAsync() : base(3) { } public async Task<BizDataGuid> BizActionAsync(BizDataGuid input) { return BizAction(input); } } }
28.181818
97
0.690323
[ "MIT" ]
Anapher/EfCore.GenericBizRunner
TestBizLayer/ActionsTransactional/Concrete/BizTranActionFinalAsync.cs
622
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace InventarioAPI.Models { public class TelefonoClienteCreacionDTO { [Required] public string Numero { get; set; } public string Descripcion { get; set; } public string Nit { get; set; } } }
22.647059
47
0.693506
[ "Apache-2.0" ]
johnsvill/almacen-api
Models/TelefonoClienteCreacionDTO.cs
387
C#
using System.Collections.Generic; using System.Linq; namespace Gribble.Model { public class Index { public Index(string name, bool clustered, bool unique, bool primaryKey, ColumnSet columns) { Name = name; Clustered = clustered; Unique = unique; PrimaryKey = primaryKey; Columns = columns; } public string Name { get; private set; } public bool Clustered { get; private set; } public bool Unique { get; private set; } public bool PrimaryKey { get; private set; } public ColumnSet Columns { get; private set; } public bool IsEquivalent(Index index) { var columns = Columns.Join(index.Columns, x => x.Name, x => x.Name, (a, b) => new {a, b}).ToList(); return Clustered == index.Clustered && Unique == index.Unique && PrimaryKey == index.PrimaryKey && columns.Count == Columns.Count && columns.All(x => x.a.Descending == x.b.Descending); } public override string ToString() { return string.Format("Name: {0}, Clustered: {1}, Unique: {2}, Primary Key: {3}, Columns: {4}", Name, Clustered, Unique, PrimaryKey, Columns.Select(x => string.Format("[Name: {0}, Descending: {1}]", x.Name, x.Descending)).Aggregate((a, i) => a + ", " + i)); } public class ColumnSet : List<Column> { public ColumnSet() {} public ColumnSet(IEnumerable<Column> columns) { AddRange(columns); } public ColumnSet Add(string name, bool descending = false) { Add(new Column(name, descending)); return this; } } public class Column { public Column(string name, bool descending = false) { Name = name; Descending = descending; } public string Name { get; private set; } public bool Descending { get; private set; } } } }
33.313433
145
0.502688
[ "MIT" ]
mikeobrien/Gribble
src/Gribble/Model/Index.cs
2,234
C#
using System; public class NgEnum { public enum AXIS { X, Y, Z } public enum TRANSFORM { POSITION, ROTATION, SCALE } public enum PREFAB_TYPE { All, ParticleSystem, LegacyParticle, NcSpriteFactory } public static string[] m_TextureSizeStrings = new string[] { "32", "64", "128", "256", "512", "1024", "2048", "4096" }; public static int[] m_TextureSizeIntters = new int[] { 32, 64, 128, 256, 512, 1024, 2048, 4096 }; }
9.607843
59
0.591837
[ "MIT" ]
moto2002/kaituo_src
src/NgEnum.cs
490
C#
// Copyright © .NET Foundation and Contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace PInvoke { using System; using System.Buffers; using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; /// <content> /// Contains the nested <see cref="WinUsbOverlapped"/> type. /// </content> public static partial class WinUsb { /// <summary> /// A managed implementation of the <see cref="Kernel32.OVERLAPPED"/> structure, used to support overlapped WinUSB I/O. /// </summary> private class WinUsbOverlapped : Overlapped { private readonly SafeUsbHandle handle; private readonly byte pipeID; private readonly CancellationToken cancellationToken; /// <summary> /// The source for completing the <see cref="Completion"/> property. /// </summary> private readonly TaskCompletionSource<int> completion = new TaskCompletionSource<int>(); private unsafe NativeOverlapped* native; private CancellationTokenRegistration cancellationTokenRegistration; /// <summary> /// Initializes a new instance of the <see cref="WinUsbOverlapped"/> class. /// </summary> /// <param name="handle"> /// A handle to the WinUSB device on which the I/O is being performed. /// </param> /// <param name="pipeID"> /// The ID of the pipe on which the I/O is being performed. /// </param> /// <param name="bufferHandle"> /// A handle to the buffer which is used by the I/O operation. This buffer will be pinned for the duration of /// the operation. /// </param> /// <param name="cancellationToken"> /// A <see cref="CancellationToken"/> which can be used to cancel the overlapped I/O. /// </param> public WinUsbOverlapped(SafeUsbHandle handle, byte pipeID, MemoryHandle bufferHandle, CancellationToken cancellationToken) { this.handle = handle ?? throw new ArgumentNullException(nameof(handle)); this.pipeID = pipeID; this.BufferHandle = bufferHandle; this.cancellationToken = cancellationToken; } /// <summary> /// Gets a <see cref="MemoryHandle"/> to the transfer buffer. /// </summary> internal MemoryHandle BufferHandle { get; private set; } /// <summary> /// Gets the amount of bytes transferred. /// </summary> internal uint BytesTransferred { get; private set; } /// <summary> /// Gets the error code returned by the device driver. /// </summary> internal uint ErrorCode { get; private set; } /// <summary> /// Gets a task whose result is the number of bytes transferred, or faults with the <see cref="Win32Exception"/> describing the failure. /// </summary> internal Task<int> Completion => this.completion.Task; /// <summary> /// Packs the current <see cref="WinUsbOverlapped"/> into a <see cref="NativeOverlapped"/> structure. /// </summary> /// <returns> /// An unmanaged pointer to a <see cref="NativeOverlapped"/> structure. /// </returns> internal unsafe NativeOverlapped* Pack() { this.native = this.Pack( this.DeviceIOControlCompletionCallback, null); this.cancellationTokenRegistration = this.cancellationToken.Register(this.Cancel); return this.native; } /// <summary> /// Unpacks the unmanaged <see cref="NativeOverlapped"/> structure into /// a managed <see cref="WinUsbOverlapped"/> object. /// </summary> internal unsafe void Unpack() { Overlapped.Unpack(this.native); Overlapped.Free(this.native); this.native = null; this.cancellationTokenRegistration.Dispose(); this.BufferHandle.Dispose(); } /// <summary> /// Cancels the asynchronous I/O operation. /// </summary> internal unsafe void Cancel() { if (!WinUsb_AbortPipe( this.handle, this.pipeID)) { throw new Win32Exception(Marshal.GetLastWin32Error()); } } private unsafe void DeviceIOControlCompletionCallback(uint errorCode, uint numberOfBytesTransferred, NativeOverlapped* nativeOverlapped) { this.Unpack(); this.BytesTransferred = numberOfBytesTransferred; this.ErrorCode = errorCode; if (this.ErrorCode != 0) { this.completion.SetException( new Win32Exception((int)this.ErrorCode)); } else { this.completion.SetResult((int)numberOfBytesTransferred); } } } } }
38.852113
148
0.547036
[ "MIT" ]
AArnott/pinvoke
src/WinUsb/WinUsb+WinUsbOverlapped.cs
5,520
C#
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------ namespace Microsoft.Azure.Cosmos.Telemetry { using System; using System.Net.Http; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Core.Trace; using Microsoft.Azure.Documents; using Newtonsoft.Json; using Newtonsoft.Json.Linq; internal class ClientTelemetryOptions { internal const String RequestKey = "telemetry"; internal const long HistogramPrecisionFactor = 100; internal const int BytesToMb = 1024 * 1024; internal const int OneKbToBytes = 1024; internal const int RequestLatencyMax = Int32.MaxValue; internal const int RequestLatencyPrecision = 5; internal const string RequestLatencyName = "RequestLatency"; internal const string RequestLatencyUnit = "MilliSecond"; internal const int RequestChargePrecision = 5; internal const string RequestChargeName = "RequestCharge"; internal const string RequestChargeUnit = "RU"; internal const int CpuMax = 100; internal const int CpuPrecision = 3; internal const String CpuName = "CPU"; internal const String CpuUnit = "Percentage"; internal const long MemoryMax = Int64.MaxValue; internal const int MemoryPrecision = 5; internal const String MemoryName = "Memory Remaining"; internal const String MemoryUnit = "MB"; internal const string DefaultVmMetadataUrL = "http://169.254.169.254/metadata/instance?api-version=2020-06-01"; internal const double DefaultTimeStampInSeconds = 600; internal const double Percentile50 = 50.0; internal const double Percentile90 = 90.0; internal const double Percentile95 = 95.0; internal const double Percentile99 = 99.0; internal const double Percentile999 = 99.9; internal const string DateFormat = "yyyy-MM-ddTHH:mm:ssZ"; internal const string EnvPropsClientTelemetrySchedulingInSeconds = "COSMOS.CLIENT_TELEMETRY_SCHEDULING_IN_SECONDS"; internal const string EnvPropsClientTelemetryEnabled = "COSMOS.CLIENT_TELEMETRY_ENABLED"; internal const string EnvPropsClientTelemetryVmMetadataUrl = "COSMOS.VM_METADATA_URL"; internal const string EnvPropsClientTelemetryEndpoint = "COSMOS.CLIENT_TELEMETRY_ENDPOINT"; internal const string EnvPropsClientTelemetryEnvironmentName = "COSMOS.ENVIRONMENT_NAME"; internal static readonly ResourceType AllowedResourceTypes = ResourceType.Document; internal static readonly JsonSerializerSettings JsonSerializerSettings = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }; internal static readonly int RequestChargeMax = 99999 * Convert.ToInt32(HistogramPrecisionFactor); internal static readonly int RequestChargeMin = 1 * Convert.ToInt32(HistogramPrecisionFactor); private static Uri vmMetadataUrl; private static TimeSpan scheduledTimeSpan = TimeSpan.Zero; private static Uri clientTelemetryEndpoint; private static string environmentName; internal static Uri GetVmMetadataUrl() { if (vmMetadataUrl == null) { string vmMetadataUrlProp = ConfigurationManager.GetEnvironmentVariable<string>( EnvPropsClientTelemetryVmMetadataUrl, DefaultVmMetadataUrL); if (!String.IsNullOrEmpty(vmMetadataUrlProp)) { vmMetadataUrl = new Uri(vmMetadataUrlProp); } DefaultTrace.TraceInformation("VM metadata URL for telemetry " + vmMetadataUrlProp); } return vmMetadataUrl; } internal static TimeSpan GetScheduledTimeSpan() { if (scheduledTimeSpan.Equals(TimeSpan.Zero)) { double scheduledTimeInSeconds = ConfigurationManager .GetEnvironmentVariable<double>( ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, ClientTelemetryOptions.DefaultTimeStampInSeconds); if (scheduledTimeInSeconds <= 0) { throw new ArgumentException("Telemetry Scheduled time can not be less than or equal to 0."); } scheduledTimeSpan = TimeSpan.FromSeconds(scheduledTimeInSeconds); DefaultTrace.TraceInformation("Telemetry Scheduled in Seconds " + scheduledTimeSpan.TotalSeconds); } return scheduledTimeSpan; } internal static async Task<AzureVMMetadata> ProcessResponseAsync(HttpResponseMessage httpResponseMessage) { if (httpResponseMessage.Content == null) { return null; } string jsonVmInfo = await httpResponseMessage.Content.ReadAsStringAsync(); return JObject.Parse(jsonVmInfo).ToObject<AzureVMMetadata>(); } internal static string GetHostInformation(Compute vmInformation) { return String.Concat(vmInformation?.OSType, "|", vmInformation?.SKU, "|", vmInformation?.VMSize, "|", vmInformation?.AzEnvironment); } internal static Uri GetClientTelemetryEndpoint() { if (clientTelemetryEndpoint == null) { string uriProp = ConfigurationManager .GetEnvironmentVariable<string>( ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, null); if (!String.IsNullOrEmpty(uriProp)) { clientTelemetryEndpoint = new Uri(uriProp); } DefaultTrace.TraceInformation("Telemetry Endpoint URL is " + uriProp); } return clientTelemetryEndpoint; } internal static string GetEnvironmentName() { if (String.IsNullOrEmpty(environmentName)) { environmentName = ConfigurationManager .GetEnvironmentVariable<string>( ClientTelemetryOptions.EnvPropsClientTelemetryEnvironmentName, String.Empty); } return environmentName; } } }
42.266234
157
0.636503
[ "MIT" ]
askazakov/azure-cosmos-dotnet-v3
Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs
6,511
C#
using Newtonsoft.Json; namespace AndreasReitberger.Models.Events { public class PrinterChangedEventArgs : CalculatorEventArgs { #region Properties public Printer3d Printer { get; set; } #endregion #region Overrides public override string ToString() { return JsonConvert.SerializeObject(this, Formatting.Indented); } #endregion } }
22.210526
74
0.637441
[ "Apache-2.0" ]
AndreasReitberger/3dPrintCostCalculatorSharp
source/3dPrintCalculatorLibrary/Models/Events/PrinterChangedEventArgs.cs
424
C#
namespace ECApp.Models { public class ErrorViewModel { public string RequestId { get; set; } public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); } }
21.777778
71
0.627551
[ "MIT" ]
expertscoding/asturias-netconf
ECApp/Models/ErrorViewModel.cs
196
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace todoapivstemplate.Controllers { public class User { public int Id { get; set; } public string firstName { get; set; } public string lastName { get; set; } } [Route("api/[controller]")] [ApiController] public class ValuesController : ControllerBase { static List<User> users = new List<User>{ new User(){Id=1, firstName="Fred",lastName="Belotte"}, new User(){Id=2, firstName="Nick",lastName="Excalona"}, }; // GET api/values [HttpGet] //public ActionResult<IEnumerable<string>> Get() public IActionResult Get() { //return NotFound(); return Ok(users); // return new string[] { "value1", "value2" }; } // GET api/values/5 [HttpGet("{id}")] [ProducesResponseType(typeof(User), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] // public ActionResult<string> Get(int id) public IActionResult Get(int id) { var user = users.Where<User>(a => a.Id == id); if (id != 0 || User != null) { return Ok(user); } else return NotFound(); //return "value"; } // POST api/values [HttpPost] public void Post([FromBody] User user) { users.Add(user); } // PUT api/values/5 [HttpPut("{id}")] public void Put(int id, [FromBody] string value) { } // DELETE api/values/5 [HttpDelete("{id}")] public void Delete(int id) { } } }
25.266667
69
0.52876
[ "MIT" ]
1905-may05-dotnet/training-code
05-WebServices/todoapivstemplate/todoapivstemplate/Controllers/ValuesController.cs
1,897
C#
/* * Exchange Web Services Managed API * * Copyright (c) Microsoft Corporation * All rights reserved. * * MIT License * * 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. */ namespace Microsoft.Exchange.WebServices.Data { using System.Diagnostics.CodeAnalysis; /// <summary> /// Represents the schem for contacts. /// </summary> [Schema] public class ContactSchema : ItemSchema { /// <summary> /// FieldURIs for contacts. /// </summary> private static class FieldUris { public const string FileAs = "contacts:FileAs"; public const string FileAsMapping = "contacts:FileAsMapping"; public const string DisplayName = "contacts:DisplayName"; public const string GivenName = "contacts:GivenName"; public const string Initials = "contacts:Initials"; public const string MiddleName = "contacts:MiddleName"; public const string NickName = "contacts:Nickname"; public const string CompleteName = "contacts:CompleteName"; public const string CompanyName = "contacts:CompanyName"; public const string EmailAddress = "contacts:EmailAddress"; public const string EmailAddresses = "contacts:EmailAddresses"; public const string PhysicalAddresses = "contacts:PhysicalAddresses"; public const string PhoneNumber = "contacts:PhoneNumber"; public const string PhoneNumbers = "contacts:PhoneNumbers"; public const string AssistantName = "contacts:AssistantName"; public const string Birthday = "contacts:Birthday"; public const string BusinessHomePage = "contacts:BusinessHomePage"; public const string Children = "contacts:Children"; public const string Companies = "contacts:Companies"; public const string ContactSource = "contacts:ContactSource"; public const string Department = "contacts:Department"; public const string Generation = "contacts:Generation"; public const string ImAddress = "contacts:ImAddress"; public const string ImAddresses = "contacts:ImAddresses"; public const string JobTitle = "contacts:JobTitle"; public const string Manager = "contacts:Manager"; public const string Mileage = "contacts:Mileage"; public const string OfficeLocation = "contacts:OfficeLocation"; public const string PhysicalAddressCity = "contacts:PhysicalAddress:City"; public const string PhysicalAddressCountryOrRegion = "contacts:PhysicalAddress:CountryOrRegion"; public const string PhysicalAddressState = "contacts:PhysicalAddress:State"; public const string PhysicalAddressStreet = "contacts:PhysicalAddress:Street"; public const string PhysicalAddressPostalCode = "contacts:PhysicalAddress:PostalCode"; public const string PostalAddressIndex = "contacts:PostalAddressIndex"; public const string Profession = "contacts:Profession"; public const string SpouseName = "contacts:SpouseName"; public const string Surname = "contacts:Surname"; public const string WeddingAnniversary = "contacts:WeddingAnniversary"; public const string HasPicture = "contacts:HasPicture"; public const string PhoneticFullName = "contacts:PhoneticFullName"; public const string PhoneticFirstName = "contacts:PhoneticFirstName"; public const string PhoneticLastName = "contacts:PhoneticLastName"; public const string Alias = "contacts:Alias"; public const string Notes = "contacts:Notes"; public const string Photo = "contacts:Photo"; public const string UserSMIMECertificate = "contacts:UserSMIMECertificate"; public const string MSExchangeCertificate = "contacts:MSExchangeCertificate"; public const string DirectoryId = "contacts:DirectoryId"; public const string ManagerMailbox = "contacts:ManagerMailbox"; public const string DirectReports = "contacts:DirectReports"; } /// <summary> /// Defines the FileAs property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition FileAs = new StringPropertyDefinition( XmlElementNames.FileAs, FieldUris.FileAs, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the FileAsMapping property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition FileAsMapping = new GenericPropertyDefinition<FileAsMapping>( XmlElementNames.FileAsMapping, FieldUris.FileAsMapping, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the DisplayName property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition DisplayName = new StringPropertyDefinition( XmlElementNames.DisplayName, FieldUris.DisplayName, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the GivenName property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition GivenName = new StringPropertyDefinition( XmlElementNames.GivenName, FieldUris.GivenName, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the Initials property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition Initials = new StringPropertyDefinition( XmlElementNames.Initials, FieldUris.Initials, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the MiddleName property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition MiddleName = new StringPropertyDefinition( XmlElementNames.MiddleName, FieldUris.MiddleName, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the NickName property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition NickName = new StringPropertyDefinition( XmlElementNames.NickName, FieldUris.NickName, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the CompleteName property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition CompleteName = new ComplexPropertyDefinition<CompleteName>( XmlElementNames.CompleteName, FieldUris.CompleteName, PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1, delegate() { return new CompleteName(); }); /// <summary> /// Defines the CompanyName property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition CompanyName = new StringPropertyDefinition( XmlElementNames.CompanyName, FieldUris.CompanyName, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the EmailAddresses property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition EmailAddresses = new ComplexPropertyDefinition<EmailAddressDictionary>( XmlElementNames.EmailAddresses, FieldUris.EmailAddresses, PropertyDefinitionFlags.AutoInstantiateOnRead | PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate, ExchangeVersion.Exchange2007_SP1, delegate() { return new EmailAddressDictionary(); }); /// <summary> /// Defines the PhysicalAddresses property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition PhysicalAddresses = new ComplexPropertyDefinition<PhysicalAddressDictionary>( XmlElementNames.PhysicalAddresses, FieldUris.PhysicalAddresses, PropertyDefinitionFlags.AutoInstantiateOnRead | PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate, ExchangeVersion.Exchange2007_SP1, delegate() { return new PhysicalAddressDictionary(); }); /// <summary> /// Defines the PhoneNumbers property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition PhoneNumbers = new ComplexPropertyDefinition<PhoneNumberDictionary>( XmlElementNames.PhoneNumbers, FieldUris.PhoneNumbers, PropertyDefinitionFlags.AutoInstantiateOnRead | PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate, ExchangeVersion.Exchange2007_SP1, delegate() { return new PhoneNumberDictionary(); }); /// <summary> /// Defines the AssistantName property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition AssistantName = new StringPropertyDefinition( XmlElementNames.AssistantName, FieldUris.AssistantName, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the Birthday property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition Birthday = new DateTimePropertyDefinition( XmlElementNames.Birthday, FieldUris.Birthday, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the BusinessHomePage property. /// </summary> /// <remarks> /// Defined as anyURI in the EWS schema. String is fine here. /// </remarks> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition BusinessHomePage = new StringPropertyDefinition( XmlElementNames.BusinessHomePage, FieldUris.BusinessHomePage, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the Children property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition Children = new ComplexPropertyDefinition<StringList>( XmlElementNames.Children, FieldUris.Children, PropertyDefinitionFlags.AutoInstantiateOnRead | PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1, delegate() { return new StringList(); }); /// <summary> /// Defines the Companies property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition Companies = new ComplexPropertyDefinition<StringList>( XmlElementNames.Companies, FieldUris.Companies, PropertyDefinitionFlags.AutoInstantiateOnRead | PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1, delegate() { return new StringList(); }); /// <summary> /// Defines the ContactSource property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition ContactSource = new GenericPropertyDefinition<ContactSource>( XmlElementNames.ContactSource, FieldUris.ContactSource, PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the Department property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition Department = new StringPropertyDefinition( XmlElementNames.Department, FieldUris.Department, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the Generation property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition Generation = new StringPropertyDefinition( XmlElementNames.Generation, FieldUris.Generation, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the ImAddresses property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition ImAddresses = new ComplexPropertyDefinition<ImAddressDictionary>( XmlElementNames.ImAddresses, FieldUris.ImAddresses, PropertyDefinitionFlags.AutoInstantiateOnRead | PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate, ExchangeVersion.Exchange2007_SP1, delegate() { return new ImAddressDictionary(); }); /// <summary> /// Defines the JobTitle property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition JobTitle = new StringPropertyDefinition( XmlElementNames.JobTitle, FieldUris.JobTitle, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the Manager property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition Manager = new StringPropertyDefinition( XmlElementNames.Manager, FieldUris.Manager, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the Mileage property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition Mileage = new StringPropertyDefinition( XmlElementNames.Mileage, FieldUris.Mileage, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the OfficeLocation property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition OfficeLocation = new StringPropertyDefinition( XmlElementNames.OfficeLocation, FieldUris.OfficeLocation, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the PostalAddressIndex property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition PostalAddressIndex = new GenericPropertyDefinition<PhysicalAddressIndex>( XmlElementNames.PostalAddressIndex, FieldUris.PostalAddressIndex, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the Profession property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition Profession = new StringPropertyDefinition( XmlElementNames.Profession, FieldUris.Profession, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the SpouseName property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition SpouseName = new StringPropertyDefinition( XmlElementNames.SpouseName, FieldUris.SpouseName, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the Surname property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition Surname = new StringPropertyDefinition( XmlElementNames.Surname, FieldUris.Surname, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the WeddingAnniversary property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition WeddingAnniversary = new DateTimePropertyDefinition( XmlElementNames.WeddingAnniversary, FieldUris.WeddingAnniversary, PropertyDefinitionFlags.CanSet | PropertyDefinitionFlags.CanUpdate | PropertyDefinitionFlags.CanDelete | PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2007_SP1); /// <summary> /// Defines the HasPicture property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition HasPicture = new BoolPropertyDefinition( XmlElementNames.HasPicture, FieldUris.HasPicture, PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2010); #region Directory Only Properties /// <summary> /// Defines the PhoneticFullName property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition PhoneticFullName = new StringPropertyDefinition( XmlElementNames.PhoneticFullName, FieldUris.PhoneticFullName, PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2010_SP1); /// <summary> /// Defines the PhoneticFirstName property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition PhoneticFirstName = new StringPropertyDefinition( XmlElementNames.PhoneticFirstName, FieldUris.PhoneticFirstName, PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2010_SP1); /// <summary> /// Defines the PhoneticLastName property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition PhoneticLastName = new StringPropertyDefinition( XmlElementNames.PhoneticLastName, FieldUris.PhoneticLastName, PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2010_SP1); /// <summary> /// Defines the Alias property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition Alias = new StringPropertyDefinition( XmlElementNames.Alias, FieldUris.Alias, PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2010_SP1); /// <summary> /// Defines the Notes property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition Notes = new StringPropertyDefinition( XmlElementNames.Notes, FieldUris.Notes, PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2010_SP1); /// <summary> /// Defines the Photo property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition Photo = new ByteArrayPropertyDefinition( XmlElementNames.Photo, FieldUris.Photo, PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2010_SP1); /// <summary> /// Defines the UserSMIMECertificate property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition UserSMIMECertificate = new ComplexPropertyDefinition<ByteArrayArray>( XmlElementNames.UserSMIMECertificate, FieldUris.UserSMIMECertificate, PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2010_SP1, delegate() { return new ByteArrayArray(); }); /// <summary> /// Defines the MSExchangeCertificate property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition MSExchangeCertificate = new ComplexPropertyDefinition<ByteArrayArray>( XmlElementNames.MSExchangeCertificate, FieldUris.MSExchangeCertificate, PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2010_SP1, delegate() { return new ByteArrayArray(); }); /// <summary> /// Defines the DirectoryId property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition DirectoryId = new StringPropertyDefinition( XmlElementNames.DirectoryId, FieldUris.DirectoryId, PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2010_SP1); /// <summary> /// Defines the ManagerMailbox property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition ManagerMailbox = new ContainedPropertyDefinition<EmailAddress>( XmlElementNames.ManagerMailbox, FieldUris.ManagerMailbox, XmlElementNames.Mailbox, PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2010_SP1, delegate() { return new EmailAddress(); }); /// <summary> /// Defines the DirectReports property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly PropertyDefinition DirectReports = new ComplexPropertyDefinition<EmailAddressCollection>( XmlElementNames.DirectReports, FieldUris.DirectReports, PropertyDefinitionFlags.CanFind, ExchangeVersion.Exchange2010_SP1, delegate() { return new EmailAddressCollection(); }); #endregion #region Email addresses indexed properties /// <summary> /// Defines the EmailAddress1 property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition EmailAddress1 = new IndexedPropertyDefinition(FieldUris.EmailAddress, "EmailAddress1"); /// <summary> /// Defines the EmailAddress2 property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition EmailAddress2 = new IndexedPropertyDefinition(FieldUris.EmailAddress, "EmailAddress2"); /// <summary> /// Defines the EmailAddress3 property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition EmailAddress3 = new IndexedPropertyDefinition(FieldUris.EmailAddress, "EmailAddress3"); #endregion #region IM addresses indexed properties /// <summary> /// Defines the ImAddress1 property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition ImAddress1 = new IndexedPropertyDefinition(FieldUris.ImAddress, "ImAddress1"); /// <summary> /// Defines the ImAddress2 property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition ImAddress2 = new IndexedPropertyDefinition(FieldUris.ImAddress, "ImAddress2"); /// <summary> /// Defines the ImAddress3 property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition ImAddress3 = new IndexedPropertyDefinition(FieldUris.ImAddress, "ImAddress3"); #endregion #region Phone numbers indexed properties /// <summary> /// Defines the AssistentPhone property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition AssistantPhone = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "AssistantPhone"); /// <summary> /// Defines the BusinessFax property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition BusinessFax = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "BusinessFax"); /// <summary> /// Defines the BusinessPhone property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition BusinessPhone = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "BusinessPhone"); /// <summary> /// Defines the BusinessPhone2 property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition BusinessPhone2 = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "BusinessPhone2"); /// <summary> /// Defines the Callback property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition Callback = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "Callback"); /// <summary> /// Defines the CarPhone property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition CarPhone = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "CarPhone"); /// <summary> /// Defines the CompanyMainPhone property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition CompanyMainPhone = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "CompanyMainPhone"); /// <summary> /// Defines the HomeFax property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition HomeFax = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "HomeFax"); /// <summary> /// Defines the HomePhone property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition HomePhone = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "HomePhone"); /// <summary> /// Defines the HomePhone2 property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition HomePhone2 = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "HomePhone2"); /// <summary> /// Defines the Isdn property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition Isdn = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "Isdn"); /// <summary> /// Defines the MobilePhone property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition MobilePhone = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "MobilePhone"); /// <summary> /// Defines the OtherFax property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition OtherFax = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "OtherFax"); /// <summary> /// Defines the OtherTelephone property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition OtherTelephone = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "OtherTelephone"); /// <summary> /// Defines the Pager property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition Pager = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "Pager"); /// <summary> /// Defines the PrimaryPhone property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition PrimaryPhone = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "PrimaryPhone"); /// <summary> /// Defines the RadioPhone property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition RadioPhone = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "RadioPhone"); /// <summary> /// Defines the Telex property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition Telex = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "Telex"); /// <summary> /// Defines the TtyTddPhone property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition TtyTddPhone = new IndexedPropertyDefinition(FieldUris.PhoneNumber, "TtyTddPhone"); #endregion #region Business address indexed properties /// <summary> /// Defines the BusinessAddressStreet property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition BusinessAddressStreet = new IndexedPropertyDefinition(FieldUris.PhysicalAddressStreet, "Business"); /// <summary> /// Defines the BusinessAddressCity property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition BusinessAddressCity = new IndexedPropertyDefinition(FieldUris.PhysicalAddressCity, "Business"); /// <summary> /// Defines the BusinessAddressState property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition BusinessAddressState = new IndexedPropertyDefinition(FieldUris.PhysicalAddressState, "Business"); /// <summary> /// Defines the BusinessAddressCountryOrRegion property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition BusinessAddressCountryOrRegion = new IndexedPropertyDefinition(FieldUris.PhysicalAddressCountryOrRegion, "Business"); /// <summary> /// Defines the BusinessAddressPostalCode property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition BusinessAddressPostalCode = new IndexedPropertyDefinition(FieldUris.PhysicalAddressPostalCode, "Business"); #endregion #region Home address indexed properties /// <summary> /// Defines the HomeAddressStreet property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition HomeAddressStreet = new IndexedPropertyDefinition(FieldUris.PhysicalAddressStreet, "Home"); /// <summary> /// Defines the HomeAddressCity property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition HomeAddressCity = new IndexedPropertyDefinition(FieldUris.PhysicalAddressCity, "Home"); /// <summary> /// Defines the HomeAddressState property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition HomeAddressState = new IndexedPropertyDefinition(FieldUris.PhysicalAddressState, "Home"); /// <summary> /// Defines the HomeAddressCountryOrRegion property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition HomeAddressCountryOrRegion = new IndexedPropertyDefinition(FieldUris.PhysicalAddressCountryOrRegion, "Home"); /// <summary> /// Defines the HomeAddressPostalCode property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition HomeAddressPostalCode = new IndexedPropertyDefinition(FieldUris.PhysicalAddressPostalCode, "Home"); #endregion #region Other address indexed properties /// <summary> /// Defines the OtherAddressStreet property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition OtherAddressStreet = new IndexedPropertyDefinition(FieldUris.PhysicalAddressStreet, "Other"); /// <summary> /// Defines the OtherAddressCity property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition OtherAddressCity = new IndexedPropertyDefinition(FieldUris.PhysicalAddressCity, "Other"); /// <summary> /// Defines the OtherAddressState property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition OtherAddressState = new IndexedPropertyDefinition(FieldUris.PhysicalAddressState, "Other"); /// <summary> /// Defines the OtherAddressCountryOrRegion property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition OtherAddressCountryOrRegion = new IndexedPropertyDefinition(FieldUris.PhysicalAddressCountryOrRegion, "Other"); /// <summary> /// Defines the OtherAddressPostalCode property. /// </summary> [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Immutable type")] public static readonly IndexedPropertyDefinition OtherAddressPostalCode = new IndexedPropertyDefinition(FieldUris.PhysicalAddressPostalCode, "Other"); #endregion // This must be declared after the property definitions internal static new readonly ContactSchema Instance = new ContactSchema(); /// <summary> /// Registers properties. /// </summary> /// <remarks> /// IMPORTANT NOTE: PROPERTIES MUST BE REGISTERED IN SCHEMA ORDER (i.e. the same order as they are defined in types.xsd) /// </remarks> internal override void RegisterProperties() { base.RegisterProperties(); this.RegisterProperty(FileAs); this.RegisterProperty(FileAsMapping); this.RegisterProperty(DisplayName); this.RegisterProperty(GivenName); this.RegisterProperty(Initials); this.RegisterProperty(MiddleName); this.RegisterProperty(NickName); this.RegisterProperty(CompleteName); this.RegisterProperty(CompanyName); this.RegisterProperty(EmailAddresses); this.RegisterProperty(PhysicalAddresses); this.RegisterProperty(PhoneNumbers); this.RegisterProperty(AssistantName); this.RegisterProperty(Birthday); this.RegisterProperty(BusinessHomePage); this.RegisterProperty(Children); this.RegisterProperty(Companies); this.RegisterProperty(ContactSource); this.RegisterProperty(Department); this.RegisterProperty(Generation); this.RegisterProperty(ImAddresses); this.RegisterProperty(JobTitle); this.RegisterProperty(Manager); this.RegisterProperty(Mileage); this.RegisterProperty(OfficeLocation); this.RegisterProperty(PostalAddressIndex); this.RegisterProperty(Profession); this.RegisterProperty(SpouseName); this.RegisterProperty(Surname); this.RegisterProperty(WeddingAnniversary); this.RegisterProperty(HasPicture); this.RegisterProperty(PhoneticFullName); this.RegisterProperty(PhoneticFirstName); this.RegisterProperty(PhoneticLastName); this.RegisterProperty(Alias); this.RegisterProperty(Notes); this.RegisterProperty(Photo); this.RegisterProperty(UserSMIMECertificate); this.RegisterProperty(MSExchangeCertificate); this.RegisterProperty(DirectoryId); this.RegisterProperty(ManagerMailbox); this.RegisterProperty(DirectReports); this.RegisterIndexedProperty(EmailAddress1); this.RegisterIndexedProperty(EmailAddress2); this.RegisterIndexedProperty(EmailAddress3); this.RegisterIndexedProperty(ImAddress1); this.RegisterIndexedProperty(ImAddress2); this.RegisterIndexedProperty(ImAddress3); this.RegisterIndexedProperty(AssistantPhone); this.RegisterIndexedProperty(BusinessFax); this.RegisterIndexedProperty(BusinessPhone); this.RegisterIndexedProperty(BusinessPhone2); this.RegisterIndexedProperty(Callback); this.RegisterIndexedProperty(CarPhone); this.RegisterIndexedProperty(CompanyMainPhone); this.RegisterIndexedProperty(HomeFax); this.RegisterIndexedProperty(HomePhone); this.RegisterIndexedProperty(HomePhone2); this.RegisterIndexedProperty(Isdn); this.RegisterIndexedProperty(MobilePhone); this.RegisterIndexedProperty(OtherFax); this.RegisterIndexedProperty(OtherTelephone); this.RegisterIndexedProperty(Pager); this.RegisterIndexedProperty(PrimaryPhone); this.RegisterIndexedProperty(RadioPhone); this.RegisterIndexedProperty(Telex); this.RegisterIndexedProperty(TtyTddPhone); this.RegisterIndexedProperty(BusinessAddressStreet); this.RegisterIndexedProperty(BusinessAddressCity); this.RegisterIndexedProperty(BusinessAddressState); this.RegisterIndexedProperty(BusinessAddressCountryOrRegion); this.RegisterIndexedProperty(BusinessAddressPostalCode); this.RegisterIndexedProperty(HomeAddressStreet); this.RegisterIndexedProperty(HomeAddressCity); this.RegisterIndexedProperty(HomeAddressState); this.RegisterIndexedProperty(HomeAddressCountryOrRegion); this.RegisterIndexedProperty(HomeAddressPostalCode); this.RegisterIndexedProperty(OtherAddressStreet); this.RegisterIndexedProperty(OtherAddressCity); this.RegisterIndexedProperty(OtherAddressState); this.RegisterIndexedProperty(OtherAddressCountryOrRegion); this.RegisterIndexedProperty(OtherAddressPostalCode); } internal ContactSchema() : base() { } } }
52.994903
201
0.680792
[ "MIT" ]
OfficeDevUnofficial/ews-managed-api
ews-managed-api/Core/ServiceObjects/Schemas/ContactSchema.cs
51,988
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace DBManager.MSSQLModels { [Table("CONTACT")] public partial class Contact { [Key] [StringLength(15)] public string Person { get; set; } [Key] [StringLength(15)] public string Patient { get; set; } [Key] public int Id { get; set; } [Column(TypeName = "date")] public DateTime Date { get; set; } [ForeignKey(nameof(Patient))] [InverseProperty("Contact")] public virtual Patient PatientNavigation { get; set; } [ForeignKey(nameof(Person))] [InverseProperty("Contact")] public virtual Person PersonNavigation { get; set; } } }
27.433333
62
0.619684
[ "MIT" ]
AlejandroIbarraC/Pandemica
API/SecondWaveAPIs/DBManager/MSSQLModels/Contact.cs
825
C#
using System; using System.Collections; using System.Collections.Generic; using System.Linq; namespace Disqord.Collections { internal sealed class ReadOnlyValuePredicateDictionary<TKey, TValue> : IReadOnlyDictionary<TKey, TValue> { public IEnumerable<TKey> Keys => _dictionary is IDictionary<TKey, TValue> dictionary ? new ReadOnlyPredicateCollection<TKey>(dictionary.Keys, ContainsKey) : this.Select(x => x.Key); public IEnumerable<TValue> Values => _dictionary is IDictionary<TKey, TValue> dictionary ? new ReadOnlyPredicateCollection<TValue>(dictionary.Values, _predicate) : this.Select(x => x.Value); public int Count => Values.Count(); private readonly IReadOnlyDictionary<TKey, TValue> _dictionary; private readonly Predicate<TValue> _predicate; public ReadOnlyValuePredicateDictionary(IReadOnlyDictionary<TKey, TValue> dictionary, Predicate<TValue> predicate) { _dictionary = dictionary; _predicate = predicate; } public TValue this[TKey key] => TryGetValue(key, out var value) ? value : throw new KeyNotFoundException(); public bool ContainsKey(TKey key) => TryGetValue(key, out var value) && _predicate(value); public bool TryGetValue(TKey key, out TValue value) => _dictionary.TryGetValue(key, out value) && _predicate(value); public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator() { foreach (var kvp in _dictionary) { if (_predicate(kvp.Value)) yield return kvp; } } IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } }
35.538462
123
0.621753
[ "MIT" ]
FenikkusuKoneko/Disqord
src/Disqord.Core/Collections/ReadOnly/ReadOnlyValuePredicateDictionary.cs
1,850
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; using System.Threading.Tasks; using Microsoft.Identity.Client.AuthScheme.PoP; using Microsoft.Identity.Client.Cache; using Microsoft.Identity.Client.Core; using Microsoft.Identity.Client.Internal; using Microsoft.Identity.Client.Internal.Broker; using Microsoft.Identity.Client.PlatformsCommon.Interfaces; using Microsoft.Identity.Client.UI; namespace Microsoft.Identity.Client.PlatformsCommon.Shared { internal abstract class AbstractPlatformProxy : IPlatformProxy { private readonly Lazy<string> _callingApplicationName; private readonly Lazy<string> _callingApplicationVersion; private readonly Lazy<ICryptographyManager> _cryptographyManager; private readonly Lazy<string> _deviceId; private readonly Lazy<string> _deviceModel; private readonly Lazy<string> _operatingSystem; private readonly Lazy<IPlatformLogger> _platformLogger; private readonly Lazy<string> _processorArchitecture; private readonly Lazy<string> _productName; protected AbstractPlatformProxy(ICoreLogger logger) { Logger = logger; _deviceModel = new Lazy<string>(InternalGetDeviceModel); _operatingSystem = new Lazy<string>(InternalGetOperatingSystem); _processorArchitecture = new Lazy<string>(InternalGetProcessorArchitecture); _callingApplicationName = new Lazy<string>(InternalGetCallingApplicationName); _callingApplicationVersion = new Lazy<string>(InternalGetCallingApplicationVersion); _deviceId = new Lazy<string>(InternalGetDeviceId); _productName = new Lazy<string>(InternalGetProductName); _cryptographyManager = new Lazy<ICryptographyManager>(InternalGetCryptographyManager); _platformLogger = new Lazy<IPlatformLogger>(InternalGetPlatformLogger); } public virtual bool IsSystemWebViewAvailable { get { return true; } } public virtual bool UseEmbeddedWebViewDefault { get { return true; } } protected IWebUIFactory OverloadWebUiFactory { get; set; } protected IFeatureFlags OverloadFeatureFlags { get; set; } protected ICoreLogger Logger { get; } /// <inheritdoc /> public IWebUIFactory GetWebUiFactory() { return OverloadWebUiFactory ?? CreateWebUiFactory(); } /// <inheritdoc /> public void SetWebUiFactory(IWebUIFactory webUiFactory) { OverloadWebUiFactory = webUiFactory; } /// <inheritdoc /> public string GetDeviceModel() { return _deviceModel.Value; } /// <inheritdoc /> public abstract string GetEnvironmentVariable(string variable); /// <inheritdoc /> public string GetOperatingSystem() { return _operatingSystem.Value; } /// <inheritdoc /> public string GetProcessorArchitecture() { return _processorArchitecture.Value; } /// <inheritdoc /> public abstract Task<string> GetUserPrincipalNameAsync(); /// <inheritdoc /> public abstract bool IsDomainJoined(); /// <inheritdoc /> public abstract Task<bool> IsUserLocalAsync(RequestContext requestContext); /// <inheritdoc /> public string GetCallingApplicationName() { return _callingApplicationName.Value; } /// <inheritdoc /> public string GetCallingApplicationVersion() { return _callingApplicationVersion.Value; } /// <inheritdoc /> public string GetDeviceId() { return _deviceId.Value; } /// <inheritdoc /> public abstract string GetBrokerOrRedirectUri(Uri redirectUri); /// <inheritdoc /> public abstract string GetDefaultRedirectUri(string clientId, bool useRecommendedRedirectUri = false); /// <inheritdoc /> public string GetProductName() { return _productName.Value; } /// <inheritdoc /> public abstract ILegacyCachePersistence CreateLegacyCachePersistence(); /// <inheritdoc /> public abstract ITokenCacheAccessor CreateTokenCacheAccessor(); /// <inheritdoc /> public ICryptographyManager CryptographyManager => _cryptographyManager.Value; /// <inheritdoc /> public IPlatformLogger PlatformLogger => _platformLogger.Value; protected IBroker OverloadBrokerForTest { get; private set; } protected abstract IWebUIFactory CreateWebUiFactory(); protected abstract IFeatureFlags CreateFeatureFlags(); protected abstract string InternalGetDeviceModel(); protected abstract string InternalGetOperatingSystem(); protected abstract string InternalGetProcessorArchitecture(); protected abstract string InternalGetCallingApplicationName(); protected abstract string InternalGetCallingApplicationVersion(); protected abstract string InternalGetDeviceId(); protected abstract string InternalGetProductName(); protected abstract ICryptographyManager InternalGetCryptographyManager(); protected abstract IPlatformLogger InternalGetPlatformLogger(); public virtual ITokenCacheBlobStorage CreateTokenCacheBlobStorage() { return null; } // MATS properties public abstract string GetDevicePlatformTelemetryId(); public abstract string GetDeviceNetworkState(); public abstract int GetMatsOsPlatformCode(); public abstract string GetMatsOsPlatform(); public virtual IFeatureFlags GetFeatureFlags() { return OverloadFeatureFlags ?? CreateFeatureFlags(); } public void SetFeatureFlags(IFeatureFlags featureFlags) { OverloadFeatureFlags = featureFlags; } public void SetBrokerForTest(IBroker broker) { OverloadBrokerForTest = broker; } public virtual Task StartDefaultOsBrowserAsync(string url) { throw new NotImplementedException(); } public virtual IBroker CreateBroker(CoreUIParent uIParent) { return OverloadBrokerForTest ?? new NullBroker(); } public virtual bool CanBrokerSupportSilentAuth() { return false; } public virtual IPoPCryptoProvider GetDefaultPoPCryptoProvider() { throw new NotImplementedException(); } public virtual IDeviceAuthManager CreateDeviceAuthManager() { return new NullDeviceAuthManager(); } } }
32.748837
110
0.65147
[ "MIT" ]
DaehyunLee/microsoft-authentication-library-for-dotnet
src/client/Microsoft.Identity.Client/PlatformsCommon/Shared/AbstractPlatformProxy.cs
7,043
C#
namespace Landriesnidis.LCL_Controls.Controls.Button { partial class MiniImageButton { /// <summary> /// 必需的设计器变量。 /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// 清理所有正在使用的资源。 /// </summary> /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region 组件设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要修改 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { this.SuspendLayout(); // // MiniImageButton // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; this.BackgroundImage = global::Landriesnidis.LCL_Controls.Properties.Resources.MiniImageButton_Close; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; this.Name = "MiniImageButton"; this.Size = new System.Drawing.Size(25, 25); this.Load += new System.EventHandler(this.MiniImageButton_Load); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.MiniImageButton_MouseDown); this.MouseLeave += new System.EventHandler(this.MiniImageButton_MouseLeave); this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.MiniImageButton_MouseMove); this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.MiniImageButton_MouseUp); this.ResumeLayout(false); } #endregion } }
36.037037
113
0.599178
[ "MIT" ]
landriesnidis/LCL_UI
LCL_Controls/Controls/Botton/MiniImageButton.Designer.cs
2,102
C#
using System; using System.Collections.Generic; using System.IO; using RfpProxy.AaMiDe.Nwk.InformationElements; namespace RfpProxy.AaMiDe.Nwk { public abstract class NwkSFormatPayload : NwkPayload { public IList<NwkInformationElement> InformationElements { get; } public override bool HasUnknown { get; } protected NwkSFormatPayload(NwkProtocolDiscriminator pd, byte ti, bool f, ReadOnlyMemory<byte> data) : base(pd, ti, f) { var span = data.Span; InformationElements = new List<NwkInformationElement>(); int i = 0; for (; i < span.Length; i++) { var current = span[i]; if ((current & 0x80) != 0) { //fixed length if ((current & 0xf0) == 0xe0) { //double byte var identifier = (byte) (current & 0xf); var content = span[i + 1]; var ie = NwkDoubleByteInformationElement.Create(identifier, content); if (ie.HasUnknown) HasUnknown = true; InformationElements.Add(ie); i++; } else { //single byte var identifier = (byte) ((current >> 4) & 0x7); var content = (byte)(current & 0xf); var ie = NwkSingleByteInformationElement.Create(identifier, content); if (ie.HasUnknown) HasUnknown = true; InformationElements.Add(ie); } } else { var type = (NwkVariableLengthElementType) current; var length = span[i+1]; if (length > 0) //EN ETSI 300 175-5 #7.5.1 { var ie = NwkVariableLengthInformationElement.Create(type, data.Slice(i + 2, length)); if (ie.HasUnknown) HasUnknown = true; InformationElements.Add(ie); } else { InformationElements.Add(new NwkIeEmpty()); } i += length + 1; } } if (i < span.Length) HasUnknown = true; } protected abstract string MessageType { get; } public override void Log(TextWriter writer) { base.Log(writer); writer.Write($" {MessageType}"); foreach (var ie in InformationElements) { writer.WriteLine(); ie.Log(writer); } } } }
35.987805
126
0.431379
[ "MIT" ]
eventphone/rfpproxy
RfpProxy.AaMiDe/AaMiDe/Nwk/NwkSFormatPayload.cs
2,953
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 appmesh-2019-01-25.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.AppMesh.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.AppMesh.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for DescribeMesh operation /// </summary> public class DescribeMeshResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { DescribeMeshResponse response = new DescribeMeshResponse(); var unmarshaller = MeshDataUnmarshaller.Instance; response.Mesh = unmarshaller.Unmarshall(context); return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("BadRequestException")) { return BadRequestExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ForbiddenException")) { return ForbiddenExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InternalServerErrorException")) { return InternalServerErrorExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("NotFoundException")) { return NotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceUnavailableException")) { return ServiceUnavailableExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRequestsException")) { return TooManyRequestsExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonAppMeshException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static DescribeMeshResponseUnmarshaller _instance = new DescribeMeshResponseUnmarshaller(); internal static DescribeMeshResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static DescribeMeshResponseUnmarshaller Instance { get { return _instance; } } } }
40.801653
190
0.6508
[ "Apache-2.0" ]
DetlefGolze/aws-sdk-net
sdk/src/Services/AppMesh/Generated/Model/Internal/MarshallTransformations/DescribeMeshResponseUnmarshaller.cs
4,937
C#
using System; using System.Collections.Generic; using System.Linq; using System.Reactive.Linq; using System.Reactive.Subjects; using System.Text; using System.Threading; using System.Threading.Tasks; namespace Observable_ { class Program { // メインメソッド static void Main(string[] args) { // 3秒後にint型の値を発行して終了するobservableの作成. Console.WriteLine("Observable.Defer<TValue> 1"); // "Observable.Defer<TValue> 1"を出力. var observable = Observable.Defer<int>(() => { // 値の発行と完了. Console.WriteLine("Observable.Defer<TValue> 2"); // "Observable.Defer<TValue> 2"を出力. Thread.Sleep(3000); // 3秒休止. Console.WriteLine("Observable.Defer<TValue> 3"); // "Observable.Defer<TValue> 3"を出力. var subscriber = new ReplaySubject<int>(); // subscriber生成.(ReplaySubject) Console.WriteLine("Observable.Defer<TValue> 4"); // "Observable.Defer<TValue> 4"を出力. subscriber.OnNext(1); // 1を発行. Console.WriteLine("Observable.Defer<TValue> 5"); // "Observable.Defer<TValue> 5"を出力. Thread.Sleep(3000); // 3秒休止. Console.WriteLine("Observable.Defer<TValue> 6"); // "Observable.Defer<TValue> 6"を出力. subscriber.OnCompleted(); // 完了通知. Console.WriteLine("Observable.Defer<TValue> 7"); // "Observable.Defer<TValue> 7"を出力. return subscriber; // subscriberはIObservable<int>なのでそのまま返せる. } ); Console.WriteLine("Observable.Defer<TValue> 8"); // "Observable.Defer<TValue> 8"を出力. // 1度目のSubscribe. var subscriber1 = observable.Subscribe(x => Console.WriteLine("x = " + x), ex => Console.WriteLine("ex.Message = " + ex.Message), () => Console.WriteLine("Complete.")); // 値の通知, 例外の通知, 完了の通知をセット. Console.WriteLine("Observable.Defer<TValue> 9"); // "Observable.Defer<TValue> 9"を出力. // 2度目のSubscribe. var subscriber2 = observable.Subscribe(x => Console.WriteLine("x = " + x), ex => Console.WriteLine("ex.Message = " + ex.Message), () => Console.WriteLine("Complete.")); // 値の通知, 例外の通知, 完了の通知をセット. Console.WriteLine("Observable.Defer<TValue> 10"); // "Observable.Defer<TValue> 10"を出力. subscriber1.Dispose(); // subscriber1の解除. subscriber2.Dispose(); // subscriber2の解除. } } }
52.957447
207
0.591402
[ "MIT" ]
bg1bgst333/Sample
rx/Observable/Defer_TValue/src/Observable_/Observable_/Program.cs
2,763
C#
using System; using System.Web; using System.Web.Http; using System.Web.Mvc; using System.Web.Routing; using DigitalLabels.Core.Config; using DigitalLabels.Core.DomainModels; using DigitalLabels.WebApi.Config; using DigitalLabels.WebApi.Infrastructure; using Microsoft.Practices.ServiceLocation; using Microsoft.Web.Infrastructure.DynamicModuleHelper; using Ninject; using Ninject.Web.Common; using Ninject.Extensions.Conventions; using NinjectAdapter; using Raven.Client; using NinjectDependencyResolver = DigitalLabels.WebApi.Infrastructure.NinjectDependencyResolver; [assembly: WebActivator.PreApplicationStartMethod(typeof(DigitalLabels.WebApi.WebsiteBootstrapper), "PreStart")] [assembly: WebActivator.PostApplicationStartMethod(typeof(DigitalLabels.WebApi.WebsiteBootstrapper), "PostStart")] [assembly: WebActivator.ApplicationShutdownMethodAttribute(typeof(DigitalLabels.WebApi.WebsiteBootstrapper), "Stop")] namespace DigitalLabels.WebApi { public static class WebsiteBootstrapper { private static readonly Bootstrapper bootstrapper = new Bootstrapper(); private static IKernel _kernal; /// <summary> /// Starts the application /// </summary> public static void PreStart() { DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule)); DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule)); bootstrapper.Initialize(CreateKernel); // Register Web Routes RouteConfig.RegisterRoutes(RouteTable.Routes); } /// <summary> /// Stops the application. /// </summary> public static void Stop() { bootstrapper.ShutDown(); } /// <summary> /// Creates the kernel that will manage your application. /// </summary> /// <returns>The created kernel.</returns> private static IKernel CreateKernel() { _kernal = new StandardKernel(); _kernal.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel); _kernal.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>(); RegisterServices(_kernal); // Register WebAPI dependency resolver GlobalConfiguration.Configuration.DependencyResolver = new NinjectDependencyResolver(_kernal); return _kernal; } /// <summary> /// Load your modules or register your services here! /// </summary> /// <param name="kernel">The kernel.</param> private static void RegisterServices(IKernel kernel) { // Raven Db Bindings kernel.Bind<IDocumentStore>().ToProvider<NinjectRavenDocumentStoreProvider>().InSingletonScope(); kernel.Bind<IDocumentSession>().ToProvider<NinjectRavenSessionProvider>(); // The rest of our bindings kernel.Bind(x => x .FromAssemblyContaining(typeof(DomainModel), typeof(WebsiteBootstrapper)) .SelectAllClasses() .BindAllInterfaces()); kernel.Bind<IServiceLocator>().ToMethod(x => ServiceLocator.Current); ServiceLocator.SetLocatorProvider(() => new NinjectServiceLocator(kernel)); } public static void PostStart() { AreaRegistration.RegisterAllAreas(); // Register Global Filters FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); // Configure Web Api WebApiConfig.Configure(); } } }
35.392157
117
0.664543
[ "MIT" ]
museumsvictoria/digital-labels
src/DigitalLabels.WebApi/App_Start/WebsiteBootstrapper.cs
3,612
C#
using System; using UnityEngine; namespace SootyShaderLoader { [KSPAddon(KSPAddon.Startup.Instantly, true)] public class SootyShaderLoader : MonoBehaviour { private const string shadersAssetName = "tundraexpshader"; private const string winShaderName = "-windows.ksp"; private const string linuxShaderName = "-linux.ksp"; private const string macShaderName = "-macosx.ksp"; private static bool loaded; private static Shader tundraShader; public static Shader TundraShader { get { return tundraShader; } } private void Start() { if (loaded) return; loadBundle(); } //This code is borrowed from Textures Unlimited: https://github.com/shadowmage45/TexturesUnlimited/blob/master/Plugin/SSTUTools/KSPShaderTools/Addon/TexturesUnlimitedLoader.cs#L198-L254 private void loadBundle() { string shaderPath; if (Application.platform == RuntimePlatform.WindowsPlayer && SystemInfo.graphicsDeviceVersion.StartsWith("OpenGL")) shaderPath = shadersAssetName + linuxShaderName; else if (Application.platform == RuntimePlatform.WindowsPlayer) shaderPath = shadersAssetName + winShaderName; else if (Application.platform == RuntimePlatform.LinuxPlayer) shaderPath = shadersAssetName + linuxShaderName; else shaderPath = shadersAssetName + macShaderName; shaderPath = KSPUtil.ApplicationRootPath + "GameData/TundraExploration/Resources/" + shaderPath; // KSP-PartTools built AssetBunldes are in the Web format, // and must be loaded using a WWW reference; you cannot use the // AssetBundle.CreateFromFile/LoadFromFile methods unless you // manually compiled your bundles for stand-alone use WWW www = CreateWWW(shaderPath); if (!string.IsNullOrEmpty(www.error)) { print("[TundraExploration] - Error while loading shader AssetBundle: " + www.error); return; } else if (www.assetBundle == null) { print("[TundraExploration] - Could not load AssetBundle from WWW - " + www); return; } AssetBundle bundle = www.assetBundle; string[] assetNames = bundle.GetAllAssetNames(); int len = assetNames.Length; Shader shader; for (int i = 0; i < len; i++) { if (assetNames[i].EndsWith(".shader")) { shader = bundle.LoadAsset<Shader>(assetNames[i]); print("[TundraExploration] - Loaded Shader: " + shader.name + " :: " + assetNames[i] + " from path: " + shaderPath); if (shader == null || string.IsNullOrEmpty(shader.name)) { print("[TundraExploration] - ERROR: Shader did not load properly for asset name: " + assetNames[i]); } GameDatabase.Instance.databaseShaders.AddUnique(shader); tundraShader = shader; } } //this unloads the compressed assets inside the bundle, but leaves any instantiated shaders in-place bundle.Unload(false); loaded = true; } private static WWW CreateWWW(string bundlePath) { try { string name = Application.platform == RuntimePlatform.WindowsPlayer ? "file:///" + bundlePath : "file://" + bundlePath; return new WWW(Uri.EscapeUriString(name)); } catch (Exception e) { print("[TundraExploration] - Error while creating AssetBundle request: " + e); return null; } } } }
38.495238
193
0.56383
[ "MIT" ]
bfrobin446/TundraExploration
Source/Plugins/SootyShaderLoader/SootyShaderLoader.cs
4,044
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. namespace Microsoft.Psi.Visualization.Summarizers { using Microsoft.Psi.Visualization.Data; /// <summary> /// Represents a range summarizer that performs interval-based data summarization over a series of int values. /// </summary> [Summarizer] public class IntRangeSummarizer : Summarizer<int, int> { /// <summary> /// Initializes a new instance of the <see cref="IntRangeSummarizer"/> class. /// </summary> public IntRangeSummarizer() : base(NumericRangeSummarizer.Summarizer) { } } }
29.478261
114
0.653392
[ "MIT" ]
danbohus/psi
Sources/Visualization/Microsoft.Psi.Visualization.Windows/Summarizers/Numeric/IntRangeSummarizer.cs
680
C#
using System.Diagnostics; namespace KMisaki.OSSProject.DotNetBeans.Common { public class ProcessUtils { private ProcessUtils() { } /// <summary> /// プロセスを取得する。 /// </summary> /// <param name="pname">取得対象のプロセス名</param> /// <returns>取得されたプロセスオブジェクト</returns> public static Process GetSingleProcessByName(string pname) { if (pname == null) pname = ""; Process[] processes = Process.GetProcessesByName(pname); if (processes == null || processes.Length != 1) { throw new System.InvalidOperationException("some processes found." + " proces-sname: " + pname + ", process-count:" + processes?.Length); } return processes[0]; } } }
29.928571
82
0.5358
[ "Apache-2.0" ]
mickey305/DotNetBeans
DotNetBeans/Common/ProcessUtils.cs
910
C#
using System; namespace Rodasnet.Infrastructure.HealthCheck { public interface IHealthCheckStorageConfiguration { String ConnectionString { get; } } }
19.222222
53
0.722543
[ "MIT" ]
rodasnet/rodasnet-infrastructure
Rodasnet.Infrastructure/HealthCheck/IHealthCheckStorageConfiguration.cs
175
C#
using Ipfs.Engine.BlockExchange; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace Ipfs.Engine { [TestClass] public class BitswapApiTest { IpfsEngine ipfs = TestFixture.Ipfs; IpfsEngine ipfsOther = TestFixture.IpfsOther; [TestMethod] public async Task Wants() { await ipfs.StartAsync(); try { var cts = new CancellationTokenSource(); var block = new DagNode(Encoding.UTF8.GetBytes("BitswapApiTest unknown block")); Task wantTask = ipfs.Bitswap.GetAsync(block.Id, cts.Token); var endTime = DateTime.Now.AddSeconds(10); while (true) { if (DateTime.Now > endTime) Assert.Fail("wanted block is missing"); await Task.Delay(100); var w = await ipfs.Bitswap.WantsAsync(); if (w.Contains(block.Id)) break; } cts.Cancel(); var wants = await ipfs.Bitswap.WantsAsync(); CollectionAssert.DoesNotContain(wants.ToArray(), block.Id); Assert.IsTrue(wantTask.IsCanceled); } finally { await ipfs.StopAsync(); } } [TestMethod] public async Task Unwant() { await ipfs.StartAsync(); try { var block = new DagNode(Encoding.UTF8.GetBytes("BitswapApiTest unknown block 2")); Task wantTask = ipfs.Bitswap.GetAsync(block.Id); var endTime = DateTime.Now.AddSeconds(10); while (true) { if (DateTime.Now > endTime) Assert.Fail("wanted block is missing"); await Task.Delay(100); var w = await ipfs.Bitswap.WantsAsync(); if (w.Contains(block.Id)) break; } await ipfs.Bitswap.UnwantAsync(block.Id); var wants = await ipfs.Bitswap.WantsAsync(); CollectionAssert.DoesNotContain(wants.ToArray(), block.Id); Assert.IsTrue(wantTask.IsCanceled); } finally { await ipfs.StopAsync(); } } [TestMethod] public async Task OnConnect_Sends_WantList() { ipfs.Options.Discovery.DisableMdns = true; ipfs.Options.Discovery.BootstrapPeers = new MultiAddress[0]; await ipfs.StartAsync(); ipfsOther.Options.Discovery.DisableMdns = true; ipfsOther.Options.Discovery.BootstrapPeers = new MultiAddress[0]; await ipfsOther.StartAsync(); try { var local = await ipfs.LocalPeer; var remote = await ipfsOther.LocalPeer; Console.WriteLine($"this at {local.Addresses.First()}"); Console.WriteLine($"othr at {remote.Addresses.First()}"); var data = Guid.NewGuid().ToByteArray(); var cid = new Cid { Hash = MultiHash.ComputeHash(data) }; var _ = ipfs.Block.GetAsync(cid); await ipfs.Swarm.ConnectAsync(remote.Addresses.First()); var endTime = DateTime.Now.AddSeconds(10); while (DateTime.Now < endTime) { var wants = await ipfsOther.Bitswap.WantsAsync(local.Id); if (wants.Contains(cid)) return; await Task.Delay(200); } Assert.Fail("want list not sent"); } finally { await ipfsOther.StopAsync(); await ipfs.StopAsync(); ipfs.Options.Discovery = new DiscoveryOptions(); ipfsOther.Options.Discovery = new DiscoveryOptions(); } } [TestMethod] public async Task GetsBlock_OnConnect() { ipfs.Options.Discovery.DisableMdns = true; ipfs.Options.Discovery.BootstrapPeers = new MultiAddress[0]; await ipfs.StartAsync(); ipfsOther.Options.Discovery.DisableMdns = true; ipfsOther.Options.Discovery.BootstrapPeers = new MultiAddress[0]; await ipfsOther.StartAsync(); try { var data = Guid.NewGuid().ToByteArray(); var cid = await ipfsOther.Block.PutAsync(data); var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)); var getTask = ipfs.Block.GetAsync(cid, cts.Token); var remote = await ipfsOther.LocalPeer; await ipfs.Swarm.ConnectAsync(remote.Addresses.First(), cts.Token); var block = await getTask; Assert.IsFalse(getTask.IsCanceled, "task cancelled"); Assert.IsFalse(getTask.IsFaulted, "task faulted"); Assert.IsTrue(getTask.IsCompleted, "task not completed"); Assert.AreEqual(cid, block.Id); CollectionAssert.AreEqual(data, block.DataBytes); var otherPeer = await ipfsOther.LocalPeer; var ledger = await ipfs.Bitswap.LedgerAsync(otherPeer); Assert.AreEqual(otherPeer, ledger.Peer); Assert.AreNotEqual(0UL, ledger.BlocksExchanged); Assert.AreNotEqual(0UL, ledger.DataReceived); Assert.AreEqual(0UL, ledger.DataSent); Assert.IsTrue(ledger.IsInDebt); // TODO: Timing issue here. ipfsOther could have sent the block // but not updated the stats yet. #if false var localPeer = await ipfs.LocalPeer; ledger = await ipfsOther.Bitswap.LedgerAsync(localPeer); Assert.AreEqual(localPeer, ledger.Peer); Assert.AreNotEqual(0UL, ledger.BlocksExchanged); Assert.AreEqual(0UL, ledger.DataReceived); Assert.AreNotEqual(0UL, ledger.DataSent); Assert.IsFalse(ledger.IsInDebt); #endif } finally { await ipfsOther.StopAsync(); await ipfs.StopAsync(); ipfs.Options.Discovery = new DiscoveryOptions(); ipfsOther.Options.Discovery = new DiscoveryOptions(); } } [TestMethod] public async Task GetsBlock_OnConnect_Bitswap1() { var originalProtocols = (await ipfs.BitswapService).Protocols; var otherOriginalProtocols = (await ipfsOther.BitswapService).Protocols; (await ipfs.BitswapService).Protocols = new IBitswapProtocol[] { new Bitswap1 { Bitswap = (await ipfs.BitswapService) } }; ipfs.Options.Discovery.DisableMdns = true; ipfs.Options.Discovery.BootstrapPeers = new MultiAddress[0]; await ipfs.StartAsync(); (await ipfsOther.BitswapService).Protocols = new IBitswapProtocol[] { new Bitswap1 { Bitswap = (await ipfsOther.BitswapService) } }; ipfsOther.Options.Discovery.DisableMdns = true; ipfsOther.Options.Discovery.BootstrapPeers = new MultiAddress[0]; await ipfsOther.StartAsync(); try { var data = Guid.NewGuid().ToByteArray(); var cid = await ipfsOther.Block.PutAsync(data); var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)); var getTask = ipfs.Block.GetAsync(cid, cts.Token); var remote = await ipfsOther.LocalPeer; await ipfs.Swarm.ConnectAsync(remote.Addresses.First(), cts.Token); var block = await getTask; Assert.IsFalse(getTask.IsCanceled, "task cancelled"); Assert.IsFalse(getTask.IsFaulted, "task faulted"); Assert.IsTrue(getTask.IsCompleted, "task not completed"); Assert.AreEqual(cid, block.Id); CollectionAssert.AreEqual(data, block.DataBytes); var otherPeer = await ipfsOther.LocalPeer; var ledger = await ipfs.Bitswap.LedgerAsync(otherPeer); Assert.AreEqual(otherPeer, ledger.Peer); Assert.AreNotEqual(0UL, ledger.BlocksExchanged); Assert.AreNotEqual(0UL, ledger.DataReceived); Assert.AreEqual(0UL, ledger.DataSent); Assert.IsTrue(ledger.IsInDebt); // TODO: Timing issue here. ipfsOther could have sent the block // but not updated the stats yet. #if false var localPeer = await ipfs.LocalPeer; ledger = await ipfsOther.Bitswap.LedgerAsync(localPeer); Assert.AreEqual(localPeer, ledger.Peer); Assert.AreNotEqual(0UL, ledger.BlocksExchanged); Assert.AreEqual(0UL, ledger.DataReceived); Assert.AreNotEqual(0UL, ledger.DataSent); Assert.IsFalse(ledger.IsInDebt); #endif } finally { await ipfsOther.StopAsync(); await ipfs.StopAsync(); ipfs.Options.Discovery = new DiscoveryOptions(); ipfsOther.Options.Discovery = new DiscoveryOptions(); (await ipfs.BitswapService).Protocols = originalProtocols; (await ipfsOther.BitswapService).Protocols = otherOriginalProtocols; } } [TestMethod] public async Task GetsBlock_OnConnect_Bitswap11() { var originalProtocols = (await ipfs.BitswapService).Protocols; var otherOriginalProtocols = (await ipfsOther.BitswapService).Protocols; (await ipfs.BitswapService).Protocols = new IBitswapProtocol[] { new Bitswap11 { Bitswap = (await ipfs.BitswapService) } }; ipfs.Options.Discovery.DisableMdns = true; ipfs.Options.Discovery.BootstrapPeers = new MultiAddress[0]; await ipfs.StartAsync(); (await ipfsOther.BitswapService).Protocols = new IBitswapProtocol[] { new Bitswap11 { Bitswap = (await ipfsOther.BitswapService) } }; ipfsOther.Options.Discovery.DisableMdns = true; ipfsOther.Options.Discovery.BootstrapPeers = new MultiAddress[0]; await ipfsOther.StartAsync(); try { var data = Guid.NewGuid().ToByteArray(); var cid = await ipfsOther.Block.PutAsync(data); var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)); var getTask = ipfs.Block.GetAsync(cid, cts.Token); var remote = await ipfsOther.LocalPeer; await ipfs.Swarm.ConnectAsync(remote.Addresses.First(), cts.Token); var block = await getTask; Assert.IsFalse(getTask.IsCanceled, "task cancelled"); Assert.IsFalse(getTask.IsFaulted, "task faulted"); Assert.IsTrue(getTask.IsCompleted, "task not completed"); Assert.AreEqual(cid, block.Id); CollectionAssert.AreEqual(data, block.DataBytes); var otherPeer = await ipfsOther.LocalPeer; var ledger = await ipfs.Bitswap.LedgerAsync(otherPeer); Assert.AreEqual(otherPeer, ledger.Peer); Assert.AreNotEqual(0UL, ledger.BlocksExchanged); Assert.AreNotEqual(0UL, ledger.DataReceived); Assert.AreEqual(0UL, ledger.DataSent); Assert.IsTrue(ledger.IsInDebt); // TODO: Timing issue here. ipfsOther could have sent the block // but not updated the stats yet. #if false var localPeer = await ipfs.LocalPeer; ledger = await ipfsOther.Bitswap.LedgerAsync(localPeer); Assert.AreEqual(localPeer, ledger.Peer); Assert.AreNotEqual(0UL, ledger.BlocksExchanged); Assert.AreEqual(0UL, ledger.DataReceived); Assert.AreNotEqual(0UL, ledger.DataSent); Assert.IsFalse(ledger.IsInDebt); #endif } finally { await ipfsOther.StopAsync(); await ipfs.StopAsync(); ipfs.Options.Discovery = new DiscoveryOptions(); ipfsOther.Options.Discovery = new DiscoveryOptions(); (await ipfs.BitswapService).Protocols = originalProtocols; (await ipfsOther.BitswapService).Protocols = otherOriginalProtocols; } } [TestMethod] public async Task GetsBlock_OnRequest() { ipfs.Options.Discovery.DisableMdns = true; ipfs.Options.Discovery.BootstrapPeers = new MultiAddress[0]; await ipfs.StartAsync(); ipfsOther.Options.Discovery.DisableMdns = true; ipfsOther.Options.Discovery.BootstrapPeers = new MultiAddress[0]; await ipfsOther.StartAsync(); try { var cts = new CancellationTokenSource(10000); var data = Guid.NewGuid().ToByteArray(); var cid = await ipfsOther.Block.PutAsync(data, cancel: cts.Token); var remote = await ipfsOther.LocalPeer; await ipfs.Swarm.ConnectAsync(remote.Addresses.First(), cancel: cts.Token); var block = await ipfs.Block.GetAsync(cid, cancel: cts.Token); Assert.AreEqual(cid, block.Id); CollectionAssert.AreEqual(data, block.DataBytes); } finally { await ipfsOther.StopAsync(); await ipfs.StopAsync(); ipfs.Options.Discovery = new DiscoveryOptions(); ipfsOther.Options.Discovery = new DiscoveryOptions(); } } [TestMethod] public async Task GetsBlock_Cidv1() { await ipfs.StartAsync(); await ipfsOther.StartAsync(); try { var data = Guid.NewGuid().ToByteArray(); var cid = await ipfsOther.Block.PutAsync(data, "raw", "sha2-512"); var remote = await ipfsOther.LocalPeer; await ipfs.Swarm.ConnectAsync(remote.Addresses.First()); var cts = new CancellationTokenSource(3000); var block = await ipfs.Block.GetAsync(cid, cts.Token); Assert.AreEqual(cid, block.Id); CollectionAssert.AreEqual(data, block.DataBytes); } finally { await ipfsOther.StopAsync(); await ipfs.StopAsync(); } } [TestMethod] public async Task GetBlock_Timeout() { var block = new DagNode(Encoding.UTF8.GetBytes("BitswapApiTest unknown block")); await ipfs.StartAsync(); try { var cts = new CancellationTokenSource(300); ExceptionAssert.Throws<TaskCanceledException>(() => { var _ = ipfs.Bitswap.GetAsync(block.Id, cts.Token).Result; }); Assert.AreEqual(0, (await ipfs.Bitswap.WantsAsync()).Count()); } finally { await ipfs.StopAsync(); } } [TestMethod] public async Task PeerLedger() { await ipfs.StartAsync(); try { var peer = await ipfsOther.LocalPeer; var ledger = await ipfs.Bitswap.LedgerAsync(peer); Assert.IsNotNull(ledger); } finally { await ipfs.StopAsync(); } } } }
38.735225
98
0.546048
[ "MIT" ]
benschop-it/net-ipfs-engine
test/CoreApi/BitswapApiTest.cs
16,387
C#
namespace SKIT.FlurlHttpClient.Wechat.Api.Models { /// <summary> /// <para>表示 [POST] /cgi-bin/guide/getguidebuyerrelationlist 接口的响应。</para> /// </summary> public class CgibinGuideGetGuideBuyerRelationListResponse : WechatApiResponse { public static class Types { public class Buyer { /// <summary> /// 获取或设置客户 OpenId。 /// </summary> [Newtonsoft.Json.JsonProperty("openid")] [System.Text.Json.Serialization.JsonPropertyName("openid")] public string OpenId { get; set; } = default!; /// <summary> /// 获取或设置客户微信昵称。 /// </summary> [Newtonsoft.Json.JsonProperty("buyer_nickname")] [System.Text.Json.Serialization.JsonPropertyName("buyer_nickname")] public string Nickname { get; set; } = default!; /// <summary> /// 获取或设置绑定时间戳。 /// </summary> [Newtonsoft.Json.JsonProperty("create_time")] [System.Text.Json.Serialization.JsonPropertyName("create_time")] public long CreateTimestamp { get; set; } } } /// <summary> /// 获取或设置客户总数量。 /// </summary> [Newtonsoft.Json.JsonProperty("total_num")] [System.Text.Json.Serialization.JsonPropertyName("total_num")] public int Total { get; set; } /// <summary> /// 获取或设置客户账号列表。 /// </summary> [Newtonsoft.Json.JsonProperty("list")] [System.Text.Json.Serialization.JsonPropertyName("list")] public Types.Buyer[]? BuyerList { get; set; } } }
34.88
83
0.530963
[ "MIT" ]
OrchesAdam/DotNetCore.SKIT.FlurlHttpClient.Wechat
src/SKIT.FlurlHttpClient.Wechat.Api/Models/CgibinGuide/BuyerRelation/CgibinGuideGetGuideBuyerRelationListResponse.cs
1,870
C#
// <auto-generated> // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace Microsoft.Azure.Management.Maintenance { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; /// <summary> /// ConfigurationAssignmentsOperations operations. /// </summary> internal partial class ConfigurationAssignmentsOperations : IServiceOperations<MaintenanceManagementClient>, IConfigurationAssignmentsOperations { /// <summary> /// Initializes a new instance of the ConfigurationAssignmentsOperations class. /// </summary> /// <param name='client'> /// Reference to the service client. /// </param> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> internal ConfigurationAssignmentsOperations(MaintenanceManagementClient client) { if (client == null) { throw new System.ArgumentNullException("client"); } Client = client; } /// <summary> /// Gets a reference to the MaintenanceManagementClient /// </summary> public MaintenanceManagementClient Client { get; private set; } /// <summary> /// Get configuration assignment /// </summary> /// <remarks> /// Get configuration for resource. /// </remarks> /// <param name='resourceGroupName'> /// Resource group name /// </param> /// <param name='providerName'> /// Resource provider name /// </param> /// <param name='resourceParentType'> /// Resource parent type /// </param> /// <param name='resourceParentName'> /// Resource parent identifier /// </param> /// <param name='resourceType'> /// Resource type /// </param> /// <param name='resourceName'> /// Resource identifier /// </param> /// <param name='configurationAssignmentName'> /// Configuration assignment name /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="MaintenanceErrorException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<ConfigurationAssignment>> GetParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (providerName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "providerName"); } if (resourceParentType == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceParentType"); } if (resourceParentName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceParentName"); } if (resourceType == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); } if (configurationAssignmentName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "configurationAssignmentName"); } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("providerName", providerName); tracingParameters.Add("resourceParentType", resourceParentType); tracingParameters.Add("resourceParentName", resourceParentName); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("configurationAssignmentName", configurationAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetParent", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceParentType}", System.Uri.EscapeDataString(resourceParentType)); _url = _url.Replace("{resourceParentName}", System.Uri.EscapeDataString(resourceParentName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); List<string> _queryParameters = new List<string>(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); MaintenanceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<MaintenanceError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<ConfigurationAssignment>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ConfigurationAssignment>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Create configuration assignment /// </summary> /// <remarks> /// Register configuration for resource. /// </remarks> /// <param name='resourceGroupName'> /// Resource group name /// </param> /// <param name='providerName'> /// Resource provider name /// </param> /// <param name='resourceParentType'> /// Resource parent type /// </param> /// <param name='resourceParentName'> /// Resource parent identifier /// </param> /// <param name='resourceType'> /// Resource type /// </param> /// <param name='resourceName'> /// Resource identifier /// </param> /// <param name='configurationAssignmentName'> /// Configuration assignment name /// </param> /// <param name='configurationAssignment'> /// The configurationAssignment /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="MaintenanceErrorException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<ConfigurationAssignment>> CreateOrUpdateParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, ConfigurationAssignment configurationAssignment, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (providerName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "providerName"); } if (resourceParentType == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceParentType"); } if (resourceParentName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceParentName"); } if (resourceType == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); } if (configurationAssignmentName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "configurationAssignmentName"); } if (configurationAssignment == null) { throw new ValidationException(ValidationRules.CannotBeNull, "configurationAssignment"); } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("providerName", providerName); tracingParameters.Add("resourceParentType", resourceParentType); tracingParameters.Add("resourceParentName", resourceParentName); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("configurationAssignmentName", configurationAssignmentName); tracingParameters.Add("configurationAssignment", configurationAssignment); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateParent", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceParentType}", System.Uri.EscapeDataString(resourceParentType)); _url = _url.Replace("{resourceParentName}", System.Uri.EscapeDataString(resourceParentName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); List<string> _queryParameters = new List<string>(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; if(configurationAssignment != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(configurationAssignment, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); MaintenanceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<MaintenanceError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<ConfigurationAssignment>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ConfigurationAssignment>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Unregister configuration for resource /// </summary> /// <remarks> /// Unregister configuration for resource. /// </remarks> /// <param name='resourceGroupName'> /// Resource group name /// </param> /// <param name='providerName'> /// Resource provider name /// </param> /// <param name='resourceParentType'> /// Resource parent type /// </param> /// <param name='resourceParentName'> /// Resource parent identifier /// </param> /// <param name='resourceType'> /// Resource type /// </param> /// <param name='resourceName'> /// Resource identifier /// </param> /// <param name='configurationAssignmentName'> /// Unique configuration assignment name /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="MaintenanceErrorException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<ConfigurationAssignment>> DeleteParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (providerName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "providerName"); } if (resourceParentType == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceParentType"); } if (resourceParentName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceParentName"); } if (resourceType == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); } if (configurationAssignmentName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "configurationAssignmentName"); } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("providerName", providerName); tracingParameters.Add("resourceParentType", resourceParentType); tracingParameters.Add("resourceParentName", resourceParentName); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("configurationAssignmentName", configurationAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "DeleteParent", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceParentType}", System.Uri.EscapeDataString(resourceParentType)); _url = _url.Replace("{resourceParentName}", System.Uri.EscapeDataString(resourceParentName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); List<string> _queryParameters = new List<string>(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); MaintenanceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<MaintenanceError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<ConfigurationAssignment>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ConfigurationAssignment>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Get configuration assignment /// </summary> /// <remarks> /// Get configuration for resource. /// </remarks> /// <param name='resourceGroupName'> /// Resource group name /// </param> /// <param name='providerName'> /// Resource provider name /// </param> /// <param name='resourceType'> /// Resource type /// </param> /// <param name='resourceName'> /// Resource identifier /// </param> /// <param name='configurationAssignmentName'> /// Configuration assignment name /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="MaintenanceErrorException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<ConfigurationAssignment>> GetWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (providerName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "providerName"); } if (resourceType == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); } if (configurationAssignmentName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "configurationAssignmentName"); } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("providerName", providerName); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("configurationAssignmentName", configurationAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); List<string> _queryParameters = new List<string>(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); MaintenanceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<MaintenanceError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<ConfigurationAssignment>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ConfigurationAssignment>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Create configuration assignment /// </summary> /// <remarks> /// Register configuration for resource. /// </remarks> /// <param name='resourceGroupName'> /// Resource group name /// </param> /// <param name='providerName'> /// Resource provider name /// </param> /// <param name='resourceType'> /// Resource type /// </param> /// <param name='resourceName'> /// Resource identifier /// </param> /// <param name='configurationAssignmentName'> /// Configuration assignment name /// </param> /// <param name='configurationAssignment'> /// The configurationAssignment /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="MaintenanceErrorException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<ConfigurationAssignment>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName, ConfigurationAssignment configurationAssignment, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (providerName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "providerName"); } if (resourceType == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); } if (configurationAssignmentName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "configurationAssignmentName"); } if (configurationAssignment == null) { throw new ValidationException(ValidationRules.CannotBeNull, "configurationAssignment"); } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("providerName", providerName); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("configurationAssignmentName", configurationAssignmentName); tracingParameters.Add("configurationAssignment", configurationAssignment); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); List<string> _queryParameters = new List<string>(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; if(configurationAssignment != null) { _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(configurationAssignment, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); MaintenanceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<MaintenanceError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<ConfigurationAssignment>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ConfigurationAssignment>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// Unregister configuration for resource /// </summary> /// <remarks> /// Unregister configuration for resource. /// </remarks> /// <param name='resourceGroupName'> /// Resource group name /// </param> /// <param name='providerName'> /// Resource provider name /// </param> /// <param name='resourceType'> /// Resource type /// </param> /// <param name='resourceName'> /// Resource identifier /// </param> /// <param name='configurationAssignmentName'> /// Unique configuration assignment name /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="MaintenanceErrorException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<ConfigurationAssignment>> DeleteWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (providerName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "providerName"); } if (resourceType == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); } if (configurationAssignmentName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "configurationAssignmentName"); } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("providerName", providerName); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("configurationAssignmentName", configurationAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); List<string> _queryParameters = new List<string>(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); MaintenanceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<MaintenanceError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<ConfigurationAssignment>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<ConfigurationAssignment>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// List configurationAssignments for resource /// </summary> /// <remarks> /// List configurationAssignments for resource. /// </remarks> /// <param name='resourceGroupName'> /// Resource group name /// </param> /// <param name='providerName'> /// Resource provider name /// </param> /// <param name='resourceParentType'> /// Resource parent type /// </param> /// <param name='resourceParentName'> /// Resource parent identifier /// </param> /// <param name='resourceType'> /// Resource type /// </param> /// <param name='resourceName'> /// Resource identifier /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="MaintenanceErrorException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<IEnumerable<ConfigurationAssignment>>> ListParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (providerName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "providerName"); } if (resourceParentType == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceParentType"); } if (resourceParentName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceParentName"); } if (resourceType == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("providerName", providerName); tracingParameters.Add("resourceParentType", resourceParentType); tracingParameters.Add("resourceParentName", resourceParentName); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListParent", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceParentType}", System.Uri.EscapeDataString(resourceParentType)); _url = _url.Replace("{resourceParentName}", System.Uri.EscapeDataString(resourceParentName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List<string> _queryParameters = new List<string>(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); MaintenanceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<MaintenanceError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<IEnumerable<ConfigurationAssignment>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<ConfigurationAssignment>>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// <summary> /// List configurationAssignments for resource /// </summary> /// <remarks> /// List configurationAssignments for resource. /// </remarks> /// <param name='resourceGroupName'> /// Resource group name /// </param> /// <param name='providerName'> /// Resource provider name /// </param> /// <param name='resourceType'> /// Resource type /// </param> /// <param name='resourceName'> /// Resource identifier /// </param> /// <param name='customHeaders'> /// Headers that will be added to request. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> /// <exception cref="MaintenanceErrorException"> /// Thrown when the operation returned an invalid status code /// </exception> /// <exception cref="SerializationException"> /// Thrown when unable to deserialize the response /// </exception> /// <exception cref="ValidationException"> /// Thrown when a required parameter is null /// </exception> /// <exception cref="System.ArgumentNullException"> /// Thrown when a required parameter is null /// </exception> /// <return> /// A response object containing the response body and response headers. /// </return> public async Task<AzureOperationResponse<IEnumerable<ConfigurationAssignment>>> ListWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (providerName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "providerName"); } if (resourceType == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); } if (resourceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary<string, object> tracingParameters = new Dictionary<string, object>(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("providerName", providerName); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List<string> _queryParameters = new List<string>(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { foreach(var _header in customHeaders) { if (_httpRequest.Headers.Contains(_header.Key)) { _httpRequest.Headers.Remove(_header.Key); } _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } // Serialize Request string _requestContent = null; // Set Credentials if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); MaintenanceError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<MaintenanceError>(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } catch (JsonException) { // Ignore the exception } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw ex; } // Create Result var _result = new AzureOperationResponse<IEnumerable<ConfigurationAssignment>>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } // Deserialize Response if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<ConfigurationAssignment>>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } }
47.715486
465
0.578
[ "MIT" ]
93mishra/azure-sdk-for-net
sdk/maintenance/Microsoft.Azure.Management.Maintenance/src/Generated/ConfigurationAssignmentsOperations.cs
90,898
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\Model\ComplexType.cs.tt namespace Microsoft.Graph { using System; using System.Collections.Generic; using System.IO; using System.Runtime.Serialization; using Newtonsoft.Json; /// <summary> /// The type PublicInnerError. /// </summary> [JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonConverter(typeof(DerivedTypeConverter))] public partial class PublicInnerError { /// <summary> /// Gets or sets code. /// </summary> [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "code", Required = Newtonsoft.Json.Required.Default)] public string Code { get; set; } /// <summary> /// Gets or sets details. /// </summary> [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "details", Required = Newtonsoft.Json.Required.Default)] public IEnumerable<PublicErrorDetail> Details { get; set; } /// <summary> /// Gets or sets message. /// </summary> [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "message", Required = Newtonsoft.Json.Required.Default)] public string Message { get; set; } /// <summary> /// Gets or sets target. /// </summary> [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "target", Required = Newtonsoft.Json.Required.Default)] public string Target { get; set; } /// <summary> /// Gets or sets additional data. /// </summary> [JsonExtensionData(ReadData = true)] public IDictionary<string, object> AdditionalData { get; set; } /// <summary> /// Gets or sets @odata.type. /// </summary> [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "@odata.type", Required = Newtonsoft.Json.Required.Default)] public string ODataType { get; set; } } }
38.609375
153
0.600567
[ "MIT" ]
gurry/msgraph-beta-sdk-dotnet
src/Microsoft.Graph/Models/Generated/PublicInnerError.cs
2,471
C#
// Developed by Softeq Development Corporation // http://www.softeq.com using System; using System.Threading.Tasks; using Softeq.XToolkit.Common.Extensions; using Softeq.XToolkit.Common.Logger; namespace Softeq.XToolkit.Common.Timers { /// <summary> /// Runs and wait task after a set interval. /// </summary> public class Timer : ITimer, IDisposable { private readonly ILogger? _logger; private readonly int _interval; private Func<Task>? _taskFactory; /// <summary> /// Initializes a new instance of the <see cref="Timer"/> class with specified interval. /// </summary> /// <param name="taskFactory">Returns Task to be executed at specified interval.</param> /// <param name="interval">Timer interval (ms).</param> /// <param name="logger">Optional Logger implementation.</param> public Timer(Func<Task> taskFactory, int interval, ILogger? logger = null) { if (interval <= 0) { throw new ArgumentException("Interval should be a positive number"); } _taskFactory = taskFactory; _interval = interval; _logger = logger; } /// <summary> /// Gets a value indicating whether the <see cref="T:Softeq.XToolkit.Common.Timers.Timer" /> should run task. /// </summary> /// <value><c>true</c> if Task should run; otherwise, <c>false</c>.</value> public bool IsActive { get; private set; } /// <summary> /// Releases all resource used by the <see cref="T:Softeq.XToolkit.Common.Timers.Timer" /> object. /// </summary> /// <remarks> /// Call <see cref="Dispose" /> when you are finished using the <see cref="T:Softeq.XToolkit.Common.Timers.Timer" />. The /// <see cref="Dispose" /> method leaves the <see cref="T:Softeq.XToolkit.Common.Timers.Timer" /> in an unusable state. /// After calling <see cref="Dispose" />, you must release all references to the /// <see cref="T:Softeq.XToolkit.Common.Timers.Timer" /> so the garbage collector can reclaim the memory that the /// <see cref="T:Softeq.XToolkit.Common.Timers.Timer" /> was occupying. /// </remarks> public void Dispose() { Stop(); _taskFactory = null; } /// <inheritdoc /> public void Start() { if (IsActive) { return; } IsActive = true; DoWork().FireAndForget(_logger); } /// <inheritdoc /> public void Stop() { IsActive = false; } private async Task DoWork() { do { await Task.Delay(_interval); if (IsActive && _taskFactory != null) { await _taskFactory().ConfigureAwait(false); } } while (IsActive); } } }
33.543478
133
0.544394
[ "MIT" ]
Softeq/XToolkit.WhiteLabel
Softeq.XToolkit.Common/Timers/Timer.cs
3,088
C#
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace DataShaping { public static class DataShapingExtensions { public static IDictionary<string, object> ShapeData<T>(this T dataToshape, string fields) { var result = new Dictionary<string, object>(); if (dataToshape == null) { return result; } var propertyInfoList = GetPropertyInfos<T>(fields); result.FillDictionary(dataToshape, propertyInfoList); return result; } public static IDictionary<string, object> ShapeDataList<T>(this IEnumerable<T> dataToshape, string fields, string listName = "values") { var result = new Dictionary<string, object>(); if (dataToshape == null) { return result; } var propertyInfoList = GetPropertyInfos<T>(fields); var list = dataToshape.Select(line => { var data = new Dictionary<string, object>(); data.FillDictionary(line, propertyInfoList); return data; }).Where(d => d.Keys.Any()).ToList(); result[listName] = list; return result; } private static void FillDictionary<T>(this IDictionary<string, object> dictionary, T source, IEnumerable<PropertyInfo> fields) { foreach (var propertyInfo in fields) { var propertyValue = propertyInfo.GetValue(source); dictionary.Add(propertyInfo.Name, propertyValue); } } private static IEnumerable<PropertyInfo> GetPropertyInfos<T>(string fields) { var propertyInfoList = new List<PropertyInfo>(); if (!string.IsNullOrWhiteSpace(fields)) { return ExtractSelectedPropertiesInfo<T>(fields, propertyInfoList); } var propertyInfos = typeof(T).GetRuntimeProperties(); propertyInfoList.AddRange(propertyInfos); return propertyInfoList; } private static IEnumerable<PropertyInfo> ExtractSelectedPropertiesInfo<T>(string fields, List<PropertyInfo> propertyInfoList) { var fieldsAfterSplit = fields.Split(','); foreach (var propertyName in fieldsAfterSplit.Select(f => f.Trim())) { var propertyInfo = typeof(T).GetRuntimeProperty(propertyName); if (propertyInfo == null) { continue; } propertyInfoList.Add(propertyInfo); } return propertyInfoList; } } }
30.549451
142
0.567986
[ "MIT" ]
niccou/DataShaping
src/DataShaping/DataShapingExtensions.cs
2,782
C#
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Globalization; #if ASPNETWEBAPI using System.Net.Http; #else using System.Web.Routing; #endif #if ASPNETWEBAPI namespace System.Web.Http.Routing.Constraints #else namespace System.Web.Mvc.Routing.Constraints #endif { /// <summary> /// Constrains a route parameter to be an integer with a maximum value. /// </summary> #if ASPNETWEBAPI public class MaxRouteConstraint : IHttpRouteConstraint #else public class MaxRouteConstraint : IRouteConstraint #endif { public MaxRouteConstraint(long max) { Max = max; } /// <summary> /// Gets the maximum value of the route parameter. /// </summary> public long Max { get; private set; } /// <inheritdoc /> #if ASPNETWEBAPI public bool Match(HttpRequestMessage request, IHttpRoute route, string parameterName, IDictionary<string, object> values, HttpRouteDirection routeDirection) #else public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection) #endif { if (parameterName == null) { throw Error.ArgumentNull("parameterName"); } if (values == null) { throw Error.ArgumentNull("values"); } object value; if (values.TryGetValue(parameterName, out value) && value != null) { long longValue; if (value is long) { longValue = (long)value; return longValue <= Max; } string valueString = Convert.ToString(value, CultureInfo.InvariantCulture); if (Int64.TryParse(valueString, NumberStyles.Integer, CultureInfo.InvariantCulture, out longValue)) { return longValue <= Max; } } return false; } } }
30.082192
164
0.600638
[ "Apache-2.0" ]
Darth-Fx/AspNetMvcStack
src/Common/Routing/Constraints/MaxRouteConstraint.cs
2,196
C#
namespace iControl { using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; using System.Web.Services.Protocols; using System; using System.Diagnostics; /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="Management.NamedBinding", Namespace="urn:iControl")] [System.Xml.Serialization.SoapIncludeAttribute(typeof(ManagementStatementDefinition))] public partial class ManagementNamed : iControlInterface { public ManagementNamed() { this.Url = "https://url_to_service"; } //======================================================================= // Operations //======================================================================= //----------------------------------------------------------------------- // delete_acl_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void delete_acl_statement( string [] statement_names ) { this.Invoke("delete_acl_statement", new object [] { statement_names}); } public System.IAsyncResult Begindelete_acl_statement(string [] statement_names, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("delete_acl_statement", new object[] { statement_names}, callback, asyncState); } public void Enddelete_acl_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // delete_controls_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void delete_controls_statement( ) { this.Invoke("delete_controls_statement", new object [0]); } public System.IAsyncResult Begindelete_controls_statement(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("delete_controls_statement", new object[0], callback, asyncState); } public void Enddelete_controls_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // delete_include_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void delete_include_statement( string [] path_names ) { this.Invoke("delete_include_statement", new object [] { path_names}); } public System.IAsyncResult Begindelete_include_statement(string [] path_names, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("delete_include_statement", new object[] { path_names}, callback, asyncState); } public void Enddelete_include_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // delete_key_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void delete_key_statement( string [] statement_names ) { this.Invoke("delete_key_statement", new object [] { statement_names}); } public System.IAsyncResult Begindelete_key_statement(string [] statement_names, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("delete_key_statement", new object[] { statement_names}, callback, asyncState); } public void Enddelete_key_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // delete_logging_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void delete_logging_statement( ) { this.Invoke("delete_logging_statement", new object [0]); } public System.IAsyncResult Begindelete_logging_statement(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("delete_logging_statement", new object[0], callback, asyncState); } public void Enddelete_logging_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // delete_options_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void delete_options_statement( ) { this.Invoke("delete_options_statement", new object [0]); } public System.IAsyncResult Begindelete_options_statement(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("delete_options_statement", new object[0], callback, asyncState); } public void Enddelete_options_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // delete_server_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void delete_server_statement( string [] statement_names ) { this.Invoke("delete_server_statement", new object [] { statement_names}); } public System.IAsyncResult Begindelete_server_statement(string [] statement_names, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("delete_server_statement", new object[] { statement_names}, callback, asyncState); } public void Enddelete_server_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // delete_trusted_keys_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void delete_trusted_keys_statement( ) { this.Invoke("delete_trusted_keys_statement", new object [0]); } public System.IAsyncResult Begindelete_trusted_keys_statement(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("delete_trusted_keys_statement", new object[0], callback, asyncState); } public void Enddelete_trusted_keys_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // get_bind_version //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] [return: System.Xml.Serialization.SoapElementAttribute("return")] public string get_bind_version( ) { object [] results = this.Invoke("get_bind_version", new object [0]); return ((string)(results[0])); } public System.IAsyncResult Beginget_bind_version(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("get_bind_version", new object[0], callback, asyncState); } public string Endget_bind_version(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } //----------------------------------------------------------------------- // get_named_configuration_file //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] [return: System.Xml.Serialization.SoapElementAttribute("return")] public string [] get_named_configuration_file( ) { object [] results = this.Invoke("get_named_configuration_file", new object [0]); return ((string [])(results[0])); } public System.IAsyncResult Beginget_named_configuration_file(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("get_named_configuration_file", new object[0], callback, asyncState); } public string [] Endget_named_configuration_file(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); return ((string [])(results[0])); } //----------------------------------------------------------------------- // get_version //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] [return: System.Xml.Serialization.SoapElementAttribute("return")] public string get_version( ) { object [] results = this.Invoke("get_version", new object [] { }); return ((string)(results[0])); } public System.IAsyncResult Beginget_version(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("get_version", new object[] { }, callback, asyncState); } public string Endget_version(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } //----------------------------------------------------------------------- // set_acl_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void set_acl_statement( ManagementStatementDefinition [] statements ) { this.Invoke("set_acl_statement", new object [] { statements}); } public System.IAsyncResult Beginset_acl_statement(ManagementStatementDefinition [] statements, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("set_acl_statement", new object[] { statements}, callback, asyncState); } public void Endset_acl_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // set_controls_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void set_controls_statement( ManagementStatementDefinition statement ) { this.Invoke("set_controls_statement", new object [] { statement}); } public System.IAsyncResult Beginset_controls_statement(ManagementStatementDefinition statement, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("set_controls_statement", new object[] { statement}, callback, asyncState); } public void Endset_controls_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // set_include_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void set_include_statement( ManagementStatementDefinition [] statements ) { this.Invoke("set_include_statement", new object [] { statements}); } public System.IAsyncResult Beginset_include_statement(ManagementStatementDefinition [] statements, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("set_include_statement", new object[] { statements}, callback, asyncState); } public void Endset_include_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // set_key_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void set_key_statement( ManagementStatementDefinition [] statements ) { this.Invoke("set_key_statement", new object [] { statements}); } public System.IAsyncResult Beginset_key_statement(ManagementStatementDefinition [] statements, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("set_key_statement", new object[] { statements}, callback, asyncState); } public void Endset_key_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // set_logging_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void set_logging_statement( ManagementStatementDefinition statement ) { this.Invoke("set_logging_statement", new object [] { statement}); } public System.IAsyncResult Beginset_logging_statement(ManagementStatementDefinition statement, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("set_logging_statement", new object[] { statement}, callback, asyncState); } public void Endset_logging_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // set_options_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void set_options_statement( ManagementStatementDefinition statement ) { this.Invoke("set_options_statement", new object [] { statement}); } public System.IAsyncResult Beginset_options_statement(ManagementStatementDefinition statement, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("set_options_statement", new object[] { statement}, callback, asyncState); } public void Endset_options_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // set_server_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void set_server_statement( ManagementStatementDefinition [] statements ) { this.Invoke("set_server_statement", new object [] { statements}); } public System.IAsyncResult Beginset_server_statement(ManagementStatementDefinition [] statements, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("set_server_statement", new object[] { statements}, callback, asyncState); } public void Endset_server_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } //----------------------------------------------------------------------- // set_trusted_keys_statement //----------------------------------------------------------------------- [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Management/Named", RequestNamespace="urn:iControl:Management/Named", ResponseNamespace="urn:iControl:Management/Named")] public void set_trusted_keys_statement( ManagementStatementDefinition statement ) { this.Invoke("set_trusted_keys_statement", new object [] { statement}); } public System.IAsyncResult Beginset_trusted_keys_statement(ManagementStatementDefinition statement, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("set_trusted_keys_statement", new object[] { statement}, callback, asyncState); } public void Endset_trusted_keys_statement(System.IAsyncResult asyncResult) { object [] results = this.EndInvoke(asyncResult); } } //======================================================================= // Enums //======================================================================= //======================================================================= // Structs //======================================================================= }
44.818182
152
0.646182
[ "MIT" ]
F5Networks/f5-icontrol-library-dotnet
iControl/Interfaces/Management/ManagementNamed.cs
18,241
C#
// Copyright 2014 The Rector & Visitors of the University of Virginia // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using System; using Xamarin.Forms; using System.Reflection; namespace Sensus.UI.UiProperties { /// <summary> /// Decorated members should be rendered as editable floating-point values. /// </summary> public class EntryDoubleUiProperty : UiProperty { public class ValueConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value == null) { return ""; } return value.ToString(); } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { try { return System.Convert.ToDouble(value); } catch (Exception) { if (targetType == typeof(double)) { return 0d; } else { return null; } } } } public EntryDoubleUiProperty(string labelText, bool editable, int order) : base(labelText, editable, order) { } public override View GetView(PropertyInfo property, object o, out BindableProperty bindingProperty, out IValueConverter converter) { bindingProperty = Entry.TextProperty; converter = new ValueConverter(); return new Entry { Keyboard = Keyboard.Numeric, HorizontalOptions = LayoutOptions.FillAndExpand }; } } }
32.653333
138
0.560229
[ "Apache-2.0" ]
cph-cachet/radmis.Moribus.vs2
Sensus.Shared/UI/UiProperties/EntryDoubleUiProperty.cs
2,449
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the networkmanager-2019-07-05.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.NetworkManager.Model { /// <summary> /// This is the response object from the ListAttachments operation. /// </summary> public partial class ListAttachmentsResponse : AmazonWebServiceResponse { private List<Attachment> _attachments = new List<Attachment>(); private string _nextToken; /// <summary> /// Gets and sets the property Attachments. /// <para> /// Describes the list of attachments. /// </para> /// </summary> public List<Attachment> Attachments { get { return this._attachments; } set { this._attachments = value; } } // Check to see if Attachments property is set internal bool IsSetAttachments() { return this._attachments != null && this._attachments.Count > 0; } /// <summary> /// Gets and sets the property NextToken. /// <para> /// The token for the next page of results. /// </para> /// </summary> [AWSProperty(Min=0, Max=2048)] public string NextToken { get { return this._nextToken; } set { this._nextToken = value; } } // Check to see if NextToken property is set internal bool IsSetNextToken() { return this._nextToken != null; } } }
29.818182
112
0.625
[ "Apache-2.0" ]
Hazy87/aws-sdk-net
sdk/src/Services/NetworkManager/Generated/Model/ListAttachmentsResponse.cs
2,296
C#
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using BuildXL.Utilities; using Test.BuildXL.FrontEnd.Core; using Test.BuildXL.TestUtilities.Xunit; using Xunit; using Xunit.Abstractions; namespace Test.DScript.Ast.Interpretation { /// <summary> /// Tests for ambient unsafe. /// </summary> public sealed class AmbientUnsafeTests : DsTest { public AmbientUnsafeTests(ITestOutputHelper output) : base(output) { } [Fact] public void TestUnsafeOutputFile() { var spec = @" export const x = Unsafe.outputFile(p`a/b/c`); export const y = Unsafe.outputFile(p`d/e/f`, 2); export const xPath = p`a/b/c`; export const yPath = p`d/e/f`; "; var result = Build() .AddSpec("spec.dsc", spec) .RootSpec("spec.dsc") .EvaluateExpressionsWithNoErrors("x", "y", "xPath", "yPath"); var x = result.Get<FileArtifact>("x"); var y = result.Get<FileArtifact>("y"); var xPath = result.Get<AbsolutePath>("xPath"); var yPath = result.Get<AbsolutePath>("yPath"); XAssert.IsTrue(x.IsOutputFile); XAssert.AreEqual(xPath, x.Path); XAssert.IsTrue(y.IsOutputFile); XAssert.AreEqual(2, y.RewriteCount); XAssert.AreEqual(yPath, y.Path); } [Fact] public void TestUnsafeOutputDirectory() { var spec = @" export const x = Unsafe.exOutputDirectory(p`a/b/c`); export const xPath = p`a/b/c`; "; var result = Build() .AddSpec("spec.dsc", spec) .RootSpec("spec.dsc") .EvaluateExpressionsWithNoErrors("x", "xPath"); var x = result.Get<DirectoryArtifact>("x"); var xPath = result.Get<AbsolutePath>("xPath"); XAssert.AreEqual((uint)0, x.PartialSealId); XAssert.AreEqual(xPath, x.Path); } } }
31.304348
102
0.556481
[ "MIT" ]
breidikl/BuildXL
Public/Src/FrontEnd/UnitTests/Script.Ambients/AmbientUnsafetests.cs
2,162
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the es-2015-01-01.normal.json service model. */ using System; using System.Collections.Generic; using System.Net; using Amazon.Elasticsearch.Model; using Amazon.Elasticsearch.Model.Internal.MarshallTransformations; using Amazon.Elasticsearch.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.Elasticsearch { /// <summary> /// Implementation for accessing Elasticsearch /// /// Amazon Elasticsearch Configuration Service /// <para> /// Use the Amazon Elasticsearch Configuration API to create, configure, and manage Elasticsearch /// domains. /// </para> /// /// <para> /// For sample code that uses the Configuration API, see the <a href="https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-configuration-samples.html">Amazon /// Elasticsearch Service Developer Guide</a>. The guide also contains <a href="https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-request-signing.html">sample /// code for sending signed HTTP requests to the Elasticsearch APIs</a>. /// </para> /// /// <para> /// The endpoint for configuration service requests is region-specific: es.<i>region</i>.amazonaws.com. /// For example, es.us-east-1.amazonaws.com. For a current list of supported regions and /// endpoints, see <a href="http://docs.aws.amazon.com/general/latest/gr/rande.html#elasticsearch-service-regions" /// target="_blank">Regions and Endpoints</a>. /// </para> /// </summary> public partial class AmazonElasticsearchClient : AmazonServiceClient, IAmazonElasticsearch { private static IServiceMetadata serviceMetadata = new AmazonElasticsearchMetadata(); #region Constructors /// <summary> /// Constructs AmazonElasticsearchClient 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> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> public AmazonElasticsearchClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonElasticsearchConfig()) { } /// <summary> /// Constructs AmazonElasticsearchClient 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> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> /// <param name="region">The region to connect.</param> public AmazonElasticsearchClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonElasticsearchConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonElasticsearchClient 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> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> /// <param name="config">The AmazonElasticsearchClient Configuration Object</param> public AmazonElasticsearchClient(AmazonElasticsearchConfig config) : base(FallbackCredentialsFactory.GetCredentials(), config) { } /// <summary> /// Constructs AmazonElasticsearchClient with AWS Credentials /// </summary> /// <param name="credentials">AWS Credentials</param> public AmazonElasticsearchClient(AWSCredentials credentials) : this(credentials, new AmazonElasticsearchConfig()) { } /// <summary> /// Constructs AmazonElasticsearchClient with AWS Credentials /// </summary> /// <param name="credentials">AWS Credentials</param> /// <param name="region">The region to connect.</param> public AmazonElasticsearchClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonElasticsearchConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonElasticsearchClient with AWS Credentials and an /// AmazonElasticsearchClient Configuration object. /// </summary> /// <param name="credentials">AWS Credentials</param> /// <param name="clientConfig">The AmazonElasticsearchClient Configuration Object</param> public AmazonElasticsearchClient(AWSCredentials credentials, AmazonElasticsearchConfig clientConfig) : base(credentials, clientConfig) { } /// <summary> /// Constructs AmazonElasticsearchClient 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 AmazonElasticsearchClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonElasticsearchConfig()) { } /// <summary> /// Constructs AmazonElasticsearchClient 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 AmazonElasticsearchClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonElasticsearchConfig() {RegionEndpoint=region}) { } /// <summary> /// Constructs AmazonElasticsearchClient with AWS Access Key ID, AWS Secret Key and an /// AmazonElasticsearchClient Configuration object. /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="clientConfig">The AmazonElasticsearchClient Configuration Object</param> public AmazonElasticsearchClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonElasticsearchConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// <summary> /// Constructs AmazonElasticsearchClient 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 AmazonElasticsearchClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonElasticsearchConfig()) { } /// <summary> /// Constructs AmazonElasticsearchClient 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 AmazonElasticsearchClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonElasticsearchConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonElasticsearchClient with AWS Access Key ID, AWS Secret Key and an /// AmazonElasticsearchClient 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 AmazonElasticsearchClient Configuration Object</param> public AmazonElasticsearchClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonElasticsearchConfig 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 AcceptInboundCrossClusterSearchConnection /// <summary> /// Allows the destination domain owner to accept an inbound cross-cluster search connection /// request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AcceptInboundCrossClusterSearchConnection service method.</param> /// /// <returns>The response from the AcceptInboundCrossClusterSearchConnection service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.LimitExceededException"> /// An exception for trying to create more than allowed resources or sub-resources. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AcceptInboundCrossClusterSearchConnection">REST API Reference for AcceptInboundCrossClusterSearchConnection Operation</seealso> public virtual AcceptInboundCrossClusterSearchConnectionResponse AcceptInboundCrossClusterSearchConnection(AcceptInboundCrossClusterSearchConnectionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AcceptInboundCrossClusterSearchConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = AcceptInboundCrossClusterSearchConnectionResponseUnmarshaller.Instance; return Invoke<AcceptInboundCrossClusterSearchConnectionResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the AcceptInboundCrossClusterSearchConnection operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AcceptInboundCrossClusterSearchConnection operation on AmazonElasticsearchClient.</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 EndAcceptInboundCrossClusterSearchConnection /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AcceptInboundCrossClusterSearchConnection">REST API Reference for AcceptInboundCrossClusterSearchConnection Operation</seealso> public virtual IAsyncResult BeginAcceptInboundCrossClusterSearchConnection(AcceptInboundCrossClusterSearchConnectionRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = AcceptInboundCrossClusterSearchConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = AcceptInboundCrossClusterSearchConnectionResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the AcceptInboundCrossClusterSearchConnection operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginAcceptInboundCrossClusterSearchConnection.</param> /// /// <returns>Returns a AcceptInboundCrossClusterSearchConnectionResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AcceptInboundCrossClusterSearchConnection">REST API Reference for AcceptInboundCrossClusterSearchConnection Operation</seealso> public virtual AcceptInboundCrossClusterSearchConnectionResponse EndAcceptInboundCrossClusterSearchConnection(IAsyncResult asyncResult) { return EndInvoke<AcceptInboundCrossClusterSearchConnectionResponse>(asyncResult); } #endregion #region AddTags /// <summary> /// Attaches tags to an existing Elasticsearch domain. Tags are a set of case-sensitive /// key value pairs. An Elasticsearch domain may have up to 10 tags. See <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains.html#es-managedomains-awsresorcetagging" /// target="_blank"> Tagging Amazon Elasticsearch Service Domains for more information.</a> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AddTags service method.</param> /// /// <returns>The response from the AddTags service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.LimitExceededException"> /// An exception for trying to create more than allowed resources or sub-resources. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AddTags">REST API Reference for AddTags Operation</seealso> public virtual AddTagsResponse AddTags(AddTagsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AddTagsRequestMarshaller.Instance; options.ResponseUnmarshaller = AddTagsResponseUnmarshaller.Instance; return Invoke<AddTagsResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the AddTags operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AddTags operation on AmazonElasticsearchClient.</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 EndAddTags /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AddTags">REST API Reference for AddTags Operation</seealso> public virtual IAsyncResult BeginAddTags(AddTagsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = AddTagsRequestMarshaller.Instance; options.ResponseUnmarshaller = AddTagsResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the AddTags operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginAddTags.</param> /// /// <returns>Returns a AddTagsResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AddTags">REST API Reference for AddTags Operation</seealso> public virtual AddTagsResponse EndAddTags(IAsyncResult asyncResult) { return EndInvoke<AddTagsResponse>(asyncResult); } #endregion #region AssociatePackage /// <summary> /// Associates a package with an Amazon ES domain. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AssociatePackage service method.</param> /// /// <returns>The response from the AssociatePackage service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.AccessDeniedException"> /// An error occurred because user does not have permissions to access the resource. Returns /// HTTP status code 403. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ConflictException"> /// An error occurred because the client attempts to remove a resource that is currently /// in use. Returns HTTP status code 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AssociatePackage">REST API Reference for AssociatePackage Operation</seealso> public virtual AssociatePackageResponse AssociatePackage(AssociatePackageRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AssociatePackageRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociatePackageResponseUnmarshaller.Instance; return Invoke<AssociatePackageResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the AssociatePackage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the AssociatePackage operation on AmazonElasticsearchClient.</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 EndAssociatePackage /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AssociatePackage">REST API Reference for AssociatePackage Operation</seealso> public virtual IAsyncResult BeginAssociatePackage(AssociatePackageRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = AssociatePackageRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociatePackageResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the AssociatePackage operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginAssociatePackage.</param> /// /// <returns>Returns a AssociatePackageResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/AssociatePackage">REST API Reference for AssociatePackage Operation</seealso> public virtual AssociatePackageResponse EndAssociatePackage(IAsyncResult asyncResult) { return EndInvoke<AssociatePackageResponse>(asyncResult); } #endregion #region CancelElasticsearchServiceSoftwareUpdate /// <summary> /// Cancels a scheduled service software update for an Amazon ES domain. You can only /// perform this operation before the <code>AutomatedUpdateDate</code> and when the <code>UpdateStatus</code> /// is in the <code>PENDING_UPDATE</code> state. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CancelElasticsearchServiceSoftwareUpdate service method.</param> /// /// <returns>The response from the CancelElasticsearchServiceSoftwareUpdate service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CancelElasticsearchServiceSoftwareUpdate">REST API Reference for CancelElasticsearchServiceSoftwareUpdate Operation</seealso> public virtual CancelElasticsearchServiceSoftwareUpdateResponse CancelElasticsearchServiceSoftwareUpdate(CancelElasticsearchServiceSoftwareUpdateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CancelElasticsearchServiceSoftwareUpdateRequestMarshaller.Instance; options.ResponseUnmarshaller = CancelElasticsearchServiceSoftwareUpdateResponseUnmarshaller.Instance; return Invoke<CancelElasticsearchServiceSoftwareUpdateResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the CancelElasticsearchServiceSoftwareUpdate operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CancelElasticsearchServiceSoftwareUpdate operation on AmazonElasticsearchClient.</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 EndCancelElasticsearchServiceSoftwareUpdate /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CancelElasticsearchServiceSoftwareUpdate">REST API Reference for CancelElasticsearchServiceSoftwareUpdate Operation</seealso> public virtual IAsyncResult BeginCancelElasticsearchServiceSoftwareUpdate(CancelElasticsearchServiceSoftwareUpdateRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = CancelElasticsearchServiceSoftwareUpdateRequestMarshaller.Instance; options.ResponseUnmarshaller = CancelElasticsearchServiceSoftwareUpdateResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the CancelElasticsearchServiceSoftwareUpdate operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginCancelElasticsearchServiceSoftwareUpdate.</param> /// /// <returns>Returns a CancelElasticsearchServiceSoftwareUpdateResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CancelElasticsearchServiceSoftwareUpdate">REST API Reference for CancelElasticsearchServiceSoftwareUpdate Operation</seealso> public virtual CancelElasticsearchServiceSoftwareUpdateResponse EndCancelElasticsearchServiceSoftwareUpdate(IAsyncResult asyncResult) { return EndInvoke<CancelElasticsearchServiceSoftwareUpdateResponse>(asyncResult); } #endregion #region CreateElasticsearchDomain /// <summary> /// Creates a new Elasticsearch domain. For more information, see <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomains" /// target="_blank">Creating Elasticsearch Domains</a> in the <i>Amazon Elasticsearch /// Service Developer Guide</i>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateElasticsearchDomain service method.</param> /// /// <returns>The response from the CreateElasticsearchDomain service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InvalidTypeException"> /// An exception for trying to create or access sub-resource that is either invalid or /// not supported. Gives http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.LimitExceededException"> /// An exception for trying to create more than allowed resources or sub-resources. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceAlreadyExistsException"> /// An exception for creating a resource that already exists. Gives http status code of /// 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CreateElasticsearchDomain">REST API Reference for CreateElasticsearchDomain Operation</seealso> public virtual CreateElasticsearchDomainResponse CreateElasticsearchDomain(CreateElasticsearchDomainRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateElasticsearchDomainRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateElasticsearchDomainResponseUnmarshaller.Instance; return Invoke<CreateElasticsearchDomainResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the CreateElasticsearchDomain operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateElasticsearchDomain operation on AmazonElasticsearchClient.</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 EndCreateElasticsearchDomain /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CreateElasticsearchDomain">REST API Reference for CreateElasticsearchDomain Operation</seealso> public virtual IAsyncResult BeginCreateElasticsearchDomain(CreateElasticsearchDomainRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = CreateElasticsearchDomainRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateElasticsearchDomainResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the CreateElasticsearchDomain operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateElasticsearchDomain.</param> /// /// <returns>Returns a CreateElasticsearchDomainResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CreateElasticsearchDomain">REST API Reference for CreateElasticsearchDomain Operation</seealso> public virtual CreateElasticsearchDomainResponse EndCreateElasticsearchDomain(IAsyncResult asyncResult) { return EndInvoke<CreateElasticsearchDomainResponse>(asyncResult); } #endregion #region CreateOutboundCrossClusterSearchConnection /// <summary> /// Creates a new cross-cluster search connection from a source domain to a destination /// domain. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateOutboundCrossClusterSearchConnection service method.</param> /// /// <returns>The response from the CreateOutboundCrossClusterSearchConnection service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.LimitExceededException"> /// An exception for trying to create more than allowed resources or sub-resources. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceAlreadyExistsException"> /// An exception for creating a resource that already exists. Gives http status code of /// 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CreateOutboundCrossClusterSearchConnection">REST API Reference for CreateOutboundCrossClusterSearchConnection Operation</seealso> public virtual CreateOutboundCrossClusterSearchConnectionResponse CreateOutboundCrossClusterSearchConnection(CreateOutboundCrossClusterSearchConnectionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateOutboundCrossClusterSearchConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateOutboundCrossClusterSearchConnectionResponseUnmarshaller.Instance; return Invoke<CreateOutboundCrossClusterSearchConnectionResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the CreateOutboundCrossClusterSearchConnection operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateOutboundCrossClusterSearchConnection operation on AmazonElasticsearchClient.</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 EndCreateOutboundCrossClusterSearchConnection /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CreateOutboundCrossClusterSearchConnection">REST API Reference for CreateOutboundCrossClusterSearchConnection Operation</seealso> public virtual IAsyncResult BeginCreateOutboundCrossClusterSearchConnection(CreateOutboundCrossClusterSearchConnectionRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = CreateOutboundCrossClusterSearchConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateOutboundCrossClusterSearchConnectionResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the CreateOutboundCrossClusterSearchConnection operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateOutboundCrossClusterSearchConnection.</param> /// /// <returns>Returns a CreateOutboundCrossClusterSearchConnectionResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CreateOutboundCrossClusterSearchConnection">REST API Reference for CreateOutboundCrossClusterSearchConnection Operation</seealso> public virtual CreateOutboundCrossClusterSearchConnectionResponse EndCreateOutboundCrossClusterSearchConnection(IAsyncResult asyncResult) { return EndInvoke<CreateOutboundCrossClusterSearchConnectionResponse>(asyncResult); } #endregion #region CreatePackage /// <summary> /// Create a package for use with Amazon ES domains. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreatePackage service method.</param> /// /// <returns>The response from the CreatePackage service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.AccessDeniedException"> /// An error occurred because user does not have permissions to access the resource. Returns /// HTTP status code 403. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InvalidTypeException"> /// An exception for trying to create or access sub-resource that is either invalid or /// not supported. Gives http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.LimitExceededException"> /// An exception for trying to create more than allowed resources or sub-resources. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceAlreadyExistsException"> /// An exception for creating a resource that already exists. Gives http status code of /// 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CreatePackage">REST API Reference for CreatePackage Operation</seealso> public virtual CreatePackageResponse CreatePackage(CreatePackageRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreatePackageRequestMarshaller.Instance; options.ResponseUnmarshaller = CreatePackageResponseUnmarshaller.Instance; return Invoke<CreatePackageResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the CreatePackage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreatePackage operation on AmazonElasticsearchClient.</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 EndCreatePackage /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CreatePackage">REST API Reference for CreatePackage Operation</seealso> public virtual IAsyncResult BeginCreatePackage(CreatePackageRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = CreatePackageRequestMarshaller.Instance; options.ResponseUnmarshaller = CreatePackageResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the CreatePackage operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreatePackage.</param> /// /// <returns>Returns a CreatePackageResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/CreatePackage">REST API Reference for CreatePackage Operation</seealso> public virtual CreatePackageResponse EndCreatePackage(IAsyncResult asyncResult) { return EndInvoke<CreatePackageResponse>(asyncResult); } #endregion #region DeleteElasticsearchDomain /// <summary> /// Permanently deletes the specified Elasticsearch domain and all of its data. Once a /// domain is deleted, it cannot be recovered. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteElasticsearchDomain service method.</param> /// /// <returns>The response from the DeleteElasticsearchDomain service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteElasticsearchDomain">REST API Reference for DeleteElasticsearchDomain Operation</seealso> public virtual DeleteElasticsearchDomainResponse DeleteElasticsearchDomain(DeleteElasticsearchDomainRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteElasticsearchDomainRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteElasticsearchDomainResponseUnmarshaller.Instance; return Invoke<DeleteElasticsearchDomainResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DeleteElasticsearchDomain operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteElasticsearchDomain operation on AmazonElasticsearchClient.</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 EndDeleteElasticsearchDomain /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteElasticsearchDomain">REST API Reference for DeleteElasticsearchDomain Operation</seealso> public virtual IAsyncResult BeginDeleteElasticsearchDomain(DeleteElasticsearchDomainRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteElasticsearchDomainRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteElasticsearchDomainResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DeleteElasticsearchDomain operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteElasticsearchDomain.</param> /// /// <returns>Returns a DeleteElasticsearchDomainResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteElasticsearchDomain">REST API Reference for DeleteElasticsearchDomain Operation</seealso> public virtual DeleteElasticsearchDomainResponse EndDeleteElasticsearchDomain(IAsyncResult asyncResult) { return EndInvoke<DeleteElasticsearchDomainResponse>(asyncResult); } #endregion #region DeleteElasticsearchServiceRole /// <summary> /// Deletes the service-linked role that Elasticsearch Service uses to manage and maintain /// VPC domains. Role deletion will fail if any existing VPC domains use the role. You /// must delete any such Elasticsearch domains before deleting the role. See <a href="http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-vpc.html#es-enabling-slr" /// target="_blank">Deleting Elasticsearch Service Role</a> in <i>VPC Endpoints for Amazon /// Elasticsearch Service Domains</i>. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteElasticsearchServiceRole service method.</param> /// /// <returns>The response from the DeleteElasticsearchServiceRole service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteElasticsearchServiceRole">REST API Reference for DeleteElasticsearchServiceRole Operation</seealso> public virtual DeleteElasticsearchServiceRoleResponse DeleteElasticsearchServiceRole(DeleteElasticsearchServiceRoleRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteElasticsearchServiceRoleRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteElasticsearchServiceRoleResponseUnmarshaller.Instance; return Invoke<DeleteElasticsearchServiceRoleResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DeleteElasticsearchServiceRole operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteElasticsearchServiceRole operation on AmazonElasticsearchClient.</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 EndDeleteElasticsearchServiceRole /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteElasticsearchServiceRole">REST API Reference for DeleteElasticsearchServiceRole Operation</seealso> public virtual IAsyncResult BeginDeleteElasticsearchServiceRole(DeleteElasticsearchServiceRoleRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteElasticsearchServiceRoleRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteElasticsearchServiceRoleResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DeleteElasticsearchServiceRole operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteElasticsearchServiceRole.</param> /// /// <returns>Returns a DeleteElasticsearchServiceRoleResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteElasticsearchServiceRole">REST API Reference for DeleteElasticsearchServiceRole Operation</seealso> public virtual DeleteElasticsearchServiceRoleResponse EndDeleteElasticsearchServiceRole(IAsyncResult asyncResult) { return EndInvoke<DeleteElasticsearchServiceRoleResponse>(asyncResult); } #endregion #region DeleteInboundCrossClusterSearchConnection /// <summary> /// Allows the destination domain owner to delete an existing inbound cross-cluster search /// connection. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteInboundCrossClusterSearchConnection service method.</param> /// /// <returns>The response from the DeleteInboundCrossClusterSearchConnection service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteInboundCrossClusterSearchConnection">REST API Reference for DeleteInboundCrossClusterSearchConnection Operation</seealso> public virtual DeleteInboundCrossClusterSearchConnectionResponse DeleteInboundCrossClusterSearchConnection(DeleteInboundCrossClusterSearchConnectionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteInboundCrossClusterSearchConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteInboundCrossClusterSearchConnectionResponseUnmarshaller.Instance; return Invoke<DeleteInboundCrossClusterSearchConnectionResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DeleteInboundCrossClusterSearchConnection operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteInboundCrossClusterSearchConnection operation on AmazonElasticsearchClient.</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 EndDeleteInboundCrossClusterSearchConnection /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteInboundCrossClusterSearchConnection">REST API Reference for DeleteInboundCrossClusterSearchConnection Operation</seealso> public virtual IAsyncResult BeginDeleteInboundCrossClusterSearchConnection(DeleteInboundCrossClusterSearchConnectionRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteInboundCrossClusterSearchConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteInboundCrossClusterSearchConnectionResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DeleteInboundCrossClusterSearchConnection operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteInboundCrossClusterSearchConnection.</param> /// /// <returns>Returns a DeleteInboundCrossClusterSearchConnectionResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteInboundCrossClusterSearchConnection">REST API Reference for DeleteInboundCrossClusterSearchConnection Operation</seealso> public virtual DeleteInboundCrossClusterSearchConnectionResponse EndDeleteInboundCrossClusterSearchConnection(IAsyncResult asyncResult) { return EndInvoke<DeleteInboundCrossClusterSearchConnectionResponse>(asyncResult); } #endregion #region DeleteOutboundCrossClusterSearchConnection /// <summary> /// Allows the source domain owner to delete an existing outbound cross-cluster search /// connection. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteOutboundCrossClusterSearchConnection service method.</param> /// /// <returns>The response from the DeleteOutboundCrossClusterSearchConnection service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteOutboundCrossClusterSearchConnection">REST API Reference for DeleteOutboundCrossClusterSearchConnection Operation</seealso> public virtual DeleteOutboundCrossClusterSearchConnectionResponse DeleteOutboundCrossClusterSearchConnection(DeleteOutboundCrossClusterSearchConnectionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteOutboundCrossClusterSearchConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteOutboundCrossClusterSearchConnectionResponseUnmarshaller.Instance; return Invoke<DeleteOutboundCrossClusterSearchConnectionResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DeleteOutboundCrossClusterSearchConnection operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteOutboundCrossClusterSearchConnection operation on AmazonElasticsearchClient.</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 EndDeleteOutboundCrossClusterSearchConnection /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteOutboundCrossClusterSearchConnection">REST API Reference for DeleteOutboundCrossClusterSearchConnection Operation</seealso> public virtual IAsyncResult BeginDeleteOutboundCrossClusterSearchConnection(DeleteOutboundCrossClusterSearchConnectionRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteOutboundCrossClusterSearchConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteOutboundCrossClusterSearchConnectionResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DeleteOutboundCrossClusterSearchConnection operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteOutboundCrossClusterSearchConnection.</param> /// /// <returns>Returns a DeleteOutboundCrossClusterSearchConnectionResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeleteOutboundCrossClusterSearchConnection">REST API Reference for DeleteOutboundCrossClusterSearchConnection Operation</seealso> public virtual DeleteOutboundCrossClusterSearchConnectionResponse EndDeleteOutboundCrossClusterSearchConnection(IAsyncResult asyncResult) { return EndInvoke<DeleteOutboundCrossClusterSearchConnectionResponse>(asyncResult); } #endregion #region DeletePackage /// <summary> /// Delete the package. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeletePackage service method.</param> /// /// <returns>The response from the DeletePackage service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.AccessDeniedException"> /// An error occurred because user does not have permissions to access the resource. Returns /// HTTP status code 403. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ConflictException"> /// An error occurred because the client attempts to remove a resource that is currently /// in use. Returns HTTP status code 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeletePackage">REST API Reference for DeletePackage Operation</seealso> public virtual DeletePackageResponse DeletePackage(DeletePackageRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeletePackageRequestMarshaller.Instance; options.ResponseUnmarshaller = DeletePackageResponseUnmarshaller.Instance; return Invoke<DeletePackageResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DeletePackage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeletePackage operation on AmazonElasticsearchClient.</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 EndDeletePackage /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeletePackage">REST API Reference for DeletePackage Operation</seealso> public virtual IAsyncResult BeginDeletePackage(DeletePackageRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DeletePackageRequestMarshaller.Instance; options.ResponseUnmarshaller = DeletePackageResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DeletePackage operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeletePackage.</param> /// /// <returns>Returns a DeletePackageResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DeletePackage">REST API Reference for DeletePackage Operation</seealso> public virtual DeletePackageResponse EndDeletePackage(IAsyncResult asyncResult) { return EndInvoke<DeletePackageResponse>(asyncResult); } #endregion #region DescribeDomainAutoTunes /// <summary> /// Provides scheduled Auto-Tune action details for the Elasticsearch domain, such as /// Auto-Tune action type, description, severity, and scheduled date. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeDomainAutoTunes service method.</param> /// /// <returns>The response from the DescribeDomainAutoTunes service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeDomainAutoTunes">REST API Reference for DescribeDomainAutoTunes Operation</seealso> public virtual DescribeDomainAutoTunesResponse DescribeDomainAutoTunes(DescribeDomainAutoTunesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeDomainAutoTunesRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeDomainAutoTunesResponseUnmarshaller.Instance; return Invoke<DescribeDomainAutoTunesResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DescribeDomainAutoTunes operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeDomainAutoTunes operation on AmazonElasticsearchClient.</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 EndDescribeDomainAutoTunes /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeDomainAutoTunes">REST API Reference for DescribeDomainAutoTunes Operation</seealso> public virtual IAsyncResult BeginDescribeDomainAutoTunes(DescribeDomainAutoTunesRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeDomainAutoTunesRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeDomainAutoTunesResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DescribeDomainAutoTunes operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeDomainAutoTunes.</param> /// /// <returns>Returns a DescribeDomainAutoTunesResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeDomainAutoTunes">REST API Reference for DescribeDomainAutoTunes Operation</seealso> public virtual DescribeDomainAutoTunesResponse EndDescribeDomainAutoTunes(IAsyncResult asyncResult) { return EndInvoke<DescribeDomainAutoTunesResponse>(asyncResult); } #endregion #region DescribeElasticsearchDomain /// <summary> /// Returns domain configuration information about the specified Elasticsearch domain, /// including the domain ID, domain endpoint, and domain ARN. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeElasticsearchDomain service method.</param> /// /// <returns>The response from the DescribeElasticsearchDomain service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomain">REST API Reference for DescribeElasticsearchDomain Operation</seealso> public virtual DescribeElasticsearchDomainResponse DescribeElasticsearchDomain(DescribeElasticsearchDomainRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeElasticsearchDomainRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeElasticsearchDomainResponseUnmarshaller.Instance; return Invoke<DescribeElasticsearchDomainResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DescribeElasticsearchDomain operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeElasticsearchDomain operation on AmazonElasticsearchClient.</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 EndDescribeElasticsearchDomain /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomain">REST API Reference for DescribeElasticsearchDomain Operation</seealso> public virtual IAsyncResult BeginDescribeElasticsearchDomain(DescribeElasticsearchDomainRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeElasticsearchDomainRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeElasticsearchDomainResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DescribeElasticsearchDomain operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeElasticsearchDomain.</param> /// /// <returns>Returns a DescribeElasticsearchDomainResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomain">REST API Reference for DescribeElasticsearchDomain Operation</seealso> public virtual DescribeElasticsearchDomainResponse EndDescribeElasticsearchDomain(IAsyncResult asyncResult) { return EndInvoke<DescribeElasticsearchDomainResponse>(asyncResult); } #endregion #region DescribeElasticsearchDomainConfig /// <summary> /// Provides cluster configuration information about the specified Elasticsearch domain, /// such as the state, creation date, update version, and update date for cluster options. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeElasticsearchDomainConfig service method.</param> /// /// <returns>The response from the DescribeElasticsearchDomainConfig service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomainConfig">REST API Reference for DescribeElasticsearchDomainConfig Operation</seealso> public virtual DescribeElasticsearchDomainConfigResponse DescribeElasticsearchDomainConfig(DescribeElasticsearchDomainConfigRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeElasticsearchDomainConfigRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeElasticsearchDomainConfigResponseUnmarshaller.Instance; return Invoke<DescribeElasticsearchDomainConfigResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DescribeElasticsearchDomainConfig operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeElasticsearchDomainConfig operation on AmazonElasticsearchClient.</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 EndDescribeElasticsearchDomainConfig /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomainConfig">REST API Reference for DescribeElasticsearchDomainConfig Operation</seealso> public virtual IAsyncResult BeginDescribeElasticsearchDomainConfig(DescribeElasticsearchDomainConfigRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeElasticsearchDomainConfigRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeElasticsearchDomainConfigResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DescribeElasticsearchDomainConfig operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeElasticsearchDomainConfig.</param> /// /// <returns>Returns a DescribeElasticsearchDomainConfigResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomainConfig">REST API Reference for DescribeElasticsearchDomainConfig Operation</seealso> public virtual DescribeElasticsearchDomainConfigResponse EndDescribeElasticsearchDomainConfig(IAsyncResult asyncResult) { return EndInvoke<DescribeElasticsearchDomainConfigResponse>(asyncResult); } #endregion #region DescribeElasticsearchDomains /// <summary> /// Returns domain configuration information about the specified Elasticsearch domains, /// including the domain ID, domain endpoint, and domain ARN. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeElasticsearchDomains service method.</param> /// /// <returns>The response from the DescribeElasticsearchDomains service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomains">REST API Reference for DescribeElasticsearchDomains Operation</seealso> public virtual DescribeElasticsearchDomainsResponse DescribeElasticsearchDomains(DescribeElasticsearchDomainsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeElasticsearchDomainsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeElasticsearchDomainsResponseUnmarshaller.Instance; return Invoke<DescribeElasticsearchDomainsResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DescribeElasticsearchDomains operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeElasticsearchDomains operation on AmazonElasticsearchClient.</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 EndDescribeElasticsearchDomains /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomains">REST API Reference for DescribeElasticsearchDomains Operation</seealso> public virtual IAsyncResult BeginDescribeElasticsearchDomains(DescribeElasticsearchDomainsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeElasticsearchDomainsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeElasticsearchDomainsResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DescribeElasticsearchDomains operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeElasticsearchDomains.</param> /// /// <returns>Returns a DescribeElasticsearchDomainsResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchDomains">REST API Reference for DescribeElasticsearchDomains Operation</seealso> public virtual DescribeElasticsearchDomainsResponse EndDescribeElasticsearchDomains(IAsyncResult asyncResult) { return EndInvoke<DescribeElasticsearchDomainsResponse>(asyncResult); } #endregion #region DescribeElasticsearchInstanceTypeLimits /// <summary> /// Describe Elasticsearch Limits for a given InstanceType and ElasticsearchVersion. /// When modifying existing Domain, specify the <code> <a>DomainName</a> </code> to know /// what Limits are supported for modifying. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeElasticsearchInstanceTypeLimits service method.</param> /// /// <returns>The response from the DescribeElasticsearchInstanceTypeLimits service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InvalidTypeException"> /// An exception for trying to create or access sub-resource that is either invalid or /// not supported. Gives http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.LimitExceededException"> /// An exception for trying to create more than allowed resources or sub-resources. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchInstanceTypeLimits">REST API Reference for DescribeElasticsearchInstanceTypeLimits Operation</seealso> public virtual DescribeElasticsearchInstanceTypeLimitsResponse DescribeElasticsearchInstanceTypeLimits(DescribeElasticsearchInstanceTypeLimitsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeElasticsearchInstanceTypeLimitsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeElasticsearchInstanceTypeLimitsResponseUnmarshaller.Instance; return Invoke<DescribeElasticsearchInstanceTypeLimitsResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DescribeElasticsearchInstanceTypeLimits operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeElasticsearchInstanceTypeLimits operation on AmazonElasticsearchClient.</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 EndDescribeElasticsearchInstanceTypeLimits /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchInstanceTypeLimits">REST API Reference for DescribeElasticsearchInstanceTypeLimits Operation</seealso> public virtual IAsyncResult BeginDescribeElasticsearchInstanceTypeLimits(DescribeElasticsearchInstanceTypeLimitsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeElasticsearchInstanceTypeLimitsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeElasticsearchInstanceTypeLimitsResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DescribeElasticsearchInstanceTypeLimits operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeElasticsearchInstanceTypeLimits.</param> /// /// <returns>Returns a DescribeElasticsearchInstanceTypeLimitsResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeElasticsearchInstanceTypeLimits">REST API Reference for DescribeElasticsearchInstanceTypeLimits Operation</seealso> public virtual DescribeElasticsearchInstanceTypeLimitsResponse EndDescribeElasticsearchInstanceTypeLimits(IAsyncResult asyncResult) { return EndInvoke<DescribeElasticsearchInstanceTypeLimitsResponse>(asyncResult); } #endregion #region DescribeInboundCrossClusterSearchConnections /// <summary> /// Lists all the inbound cross-cluster search connections for a destination domain. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeInboundCrossClusterSearchConnections service method.</param> /// /// <returns>The response from the DescribeInboundCrossClusterSearchConnections service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InvalidPaginationTokenException"> /// The request processing has failed because of invalid pagination token provided by /// customer. Returns an HTTP status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeInboundCrossClusterSearchConnections">REST API Reference for DescribeInboundCrossClusterSearchConnections Operation</seealso> public virtual DescribeInboundCrossClusterSearchConnectionsResponse DescribeInboundCrossClusterSearchConnections(DescribeInboundCrossClusterSearchConnectionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeInboundCrossClusterSearchConnectionsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeInboundCrossClusterSearchConnectionsResponseUnmarshaller.Instance; return Invoke<DescribeInboundCrossClusterSearchConnectionsResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DescribeInboundCrossClusterSearchConnections operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeInboundCrossClusterSearchConnections operation on AmazonElasticsearchClient.</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 EndDescribeInboundCrossClusterSearchConnections /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeInboundCrossClusterSearchConnections">REST API Reference for DescribeInboundCrossClusterSearchConnections Operation</seealso> public virtual IAsyncResult BeginDescribeInboundCrossClusterSearchConnections(DescribeInboundCrossClusterSearchConnectionsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeInboundCrossClusterSearchConnectionsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeInboundCrossClusterSearchConnectionsResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DescribeInboundCrossClusterSearchConnections operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeInboundCrossClusterSearchConnections.</param> /// /// <returns>Returns a DescribeInboundCrossClusterSearchConnectionsResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeInboundCrossClusterSearchConnections">REST API Reference for DescribeInboundCrossClusterSearchConnections Operation</seealso> public virtual DescribeInboundCrossClusterSearchConnectionsResponse EndDescribeInboundCrossClusterSearchConnections(IAsyncResult asyncResult) { return EndInvoke<DescribeInboundCrossClusterSearchConnectionsResponse>(asyncResult); } #endregion #region DescribeOutboundCrossClusterSearchConnections /// <summary> /// Lists all the outbound cross-cluster search connections for a source domain. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeOutboundCrossClusterSearchConnections service method.</param> /// /// <returns>The response from the DescribeOutboundCrossClusterSearchConnections service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InvalidPaginationTokenException"> /// The request processing has failed because of invalid pagination token provided by /// customer. Returns an HTTP status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeOutboundCrossClusterSearchConnections">REST API Reference for DescribeOutboundCrossClusterSearchConnections Operation</seealso> public virtual DescribeOutboundCrossClusterSearchConnectionsResponse DescribeOutboundCrossClusterSearchConnections(DescribeOutboundCrossClusterSearchConnectionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeOutboundCrossClusterSearchConnectionsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeOutboundCrossClusterSearchConnectionsResponseUnmarshaller.Instance; return Invoke<DescribeOutboundCrossClusterSearchConnectionsResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DescribeOutboundCrossClusterSearchConnections operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeOutboundCrossClusterSearchConnections operation on AmazonElasticsearchClient.</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 EndDescribeOutboundCrossClusterSearchConnections /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeOutboundCrossClusterSearchConnections">REST API Reference for DescribeOutboundCrossClusterSearchConnections Operation</seealso> public virtual IAsyncResult BeginDescribeOutboundCrossClusterSearchConnections(DescribeOutboundCrossClusterSearchConnectionsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeOutboundCrossClusterSearchConnectionsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeOutboundCrossClusterSearchConnectionsResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DescribeOutboundCrossClusterSearchConnections operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeOutboundCrossClusterSearchConnections.</param> /// /// <returns>Returns a DescribeOutboundCrossClusterSearchConnectionsResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeOutboundCrossClusterSearchConnections">REST API Reference for DescribeOutboundCrossClusterSearchConnections Operation</seealso> public virtual DescribeOutboundCrossClusterSearchConnectionsResponse EndDescribeOutboundCrossClusterSearchConnections(IAsyncResult asyncResult) { return EndInvoke<DescribeOutboundCrossClusterSearchConnectionsResponse>(asyncResult); } #endregion #region DescribePackages /// <summary> /// Describes all packages available to Amazon ES. Includes options for filtering, limiting /// the number of results, and pagination. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribePackages service method.</param> /// /// <returns>The response from the DescribePackages service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.AccessDeniedException"> /// An error occurred because user does not have permissions to access the resource. Returns /// HTTP status code 403. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribePackages">REST API Reference for DescribePackages Operation</seealso> public virtual DescribePackagesResponse DescribePackages(DescribePackagesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribePackagesRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribePackagesResponseUnmarshaller.Instance; return Invoke<DescribePackagesResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DescribePackages operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribePackages operation on AmazonElasticsearchClient.</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 EndDescribePackages /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribePackages">REST API Reference for DescribePackages Operation</seealso> public virtual IAsyncResult BeginDescribePackages(DescribePackagesRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DescribePackagesRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribePackagesResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DescribePackages operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribePackages.</param> /// /// <returns>Returns a DescribePackagesResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribePackages">REST API Reference for DescribePackages Operation</seealso> public virtual DescribePackagesResponse EndDescribePackages(IAsyncResult asyncResult) { return EndInvoke<DescribePackagesResponse>(asyncResult); } #endregion #region DescribeReservedElasticsearchInstanceOfferings /// <summary> /// Lists available reserved Elasticsearch instance offerings. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeReservedElasticsearchInstanceOfferings service method.</param> /// /// <returns>The response from the DescribeReservedElasticsearchInstanceOfferings service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeReservedElasticsearchInstanceOfferings">REST API Reference for DescribeReservedElasticsearchInstanceOfferings Operation</seealso> public virtual DescribeReservedElasticsearchInstanceOfferingsResponse DescribeReservedElasticsearchInstanceOfferings(DescribeReservedElasticsearchInstanceOfferingsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeReservedElasticsearchInstanceOfferingsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeReservedElasticsearchInstanceOfferingsResponseUnmarshaller.Instance; return Invoke<DescribeReservedElasticsearchInstanceOfferingsResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DescribeReservedElasticsearchInstanceOfferings operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeReservedElasticsearchInstanceOfferings operation on AmazonElasticsearchClient.</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 EndDescribeReservedElasticsearchInstanceOfferings /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeReservedElasticsearchInstanceOfferings">REST API Reference for DescribeReservedElasticsearchInstanceOfferings Operation</seealso> public virtual IAsyncResult BeginDescribeReservedElasticsearchInstanceOfferings(DescribeReservedElasticsearchInstanceOfferingsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeReservedElasticsearchInstanceOfferingsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeReservedElasticsearchInstanceOfferingsResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DescribeReservedElasticsearchInstanceOfferings operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeReservedElasticsearchInstanceOfferings.</param> /// /// <returns>Returns a DescribeReservedElasticsearchInstanceOfferingsResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeReservedElasticsearchInstanceOfferings">REST API Reference for DescribeReservedElasticsearchInstanceOfferings Operation</seealso> public virtual DescribeReservedElasticsearchInstanceOfferingsResponse EndDescribeReservedElasticsearchInstanceOfferings(IAsyncResult asyncResult) { return EndInvoke<DescribeReservedElasticsearchInstanceOfferingsResponse>(asyncResult); } #endregion #region DescribeReservedElasticsearchInstances /// <summary> /// Returns information about reserved Elasticsearch instances for this account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeReservedElasticsearchInstances service method.</param> /// /// <returns>The response from the DescribeReservedElasticsearchInstances service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeReservedElasticsearchInstances">REST API Reference for DescribeReservedElasticsearchInstances Operation</seealso> public virtual DescribeReservedElasticsearchInstancesResponse DescribeReservedElasticsearchInstances(DescribeReservedElasticsearchInstancesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeReservedElasticsearchInstancesRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeReservedElasticsearchInstancesResponseUnmarshaller.Instance; return Invoke<DescribeReservedElasticsearchInstancesResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DescribeReservedElasticsearchInstances operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeReservedElasticsearchInstances operation on AmazonElasticsearchClient.</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 EndDescribeReservedElasticsearchInstances /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeReservedElasticsearchInstances">REST API Reference for DescribeReservedElasticsearchInstances Operation</seealso> public virtual IAsyncResult BeginDescribeReservedElasticsearchInstances(DescribeReservedElasticsearchInstancesRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeReservedElasticsearchInstancesRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeReservedElasticsearchInstancesResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DescribeReservedElasticsearchInstances operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeReservedElasticsearchInstances.</param> /// /// <returns>Returns a DescribeReservedElasticsearchInstancesResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DescribeReservedElasticsearchInstances">REST API Reference for DescribeReservedElasticsearchInstances Operation</seealso> public virtual DescribeReservedElasticsearchInstancesResponse EndDescribeReservedElasticsearchInstances(IAsyncResult asyncResult) { return EndInvoke<DescribeReservedElasticsearchInstancesResponse>(asyncResult); } #endregion #region DissociatePackage /// <summary> /// Dissociates a package from the Amazon ES domain. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DissociatePackage service method.</param> /// /// <returns>The response from the DissociatePackage service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.AccessDeniedException"> /// An error occurred because user does not have permissions to access the resource. Returns /// HTTP status code 403. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ConflictException"> /// An error occurred because the client attempts to remove a resource that is currently /// in use. Returns HTTP status code 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DissociatePackage">REST API Reference for DissociatePackage Operation</seealso> public virtual DissociatePackageResponse DissociatePackage(DissociatePackageRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DissociatePackageRequestMarshaller.Instance; options.ResponseUnmarshaller = DissociatePackageResponseUnmarshaller.Instance; return Invoke<DissociatePackageResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the DissociatePackage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DissociatePackage operation on AmazonElasticsearchClient.</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 EndDissociatePackage /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DissociatePackage">REST API Reference for DissociatePackage Operation</seealso> public virtual IAsyncResult BeginDissociatePackage(DissociatePackageRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = DissociatePackageRequestMarshaller.Instance; options.ResponseUnmarshaller = DissociatePackageResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the DissociatePackage operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginDissociatePackage.</param> /// /// <returns>Returns a DissociatePackageResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/DissociatePackage">REST API Reference for DissociatePackage Operation</seealso> public virtual DissociatePackageResponse EndDissociatePackage(IAsyncResult asyncResult) { return EndInvoke<DissociatePackageResponse>(asyncResult); } #endregion #region GetCompatibleElasticsearchVersions /// <summary> /// Returns a list of upgrade compatible Elastisearch versions. You can optionally pass /// a <code> <a>DomainName</a> </code> to get all upgrade compatible Elasticsearch versions /// for that specific domain. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetCompatibleElasticsearchVersions service method.</param> /// /// <returns>The response from the GetCompatibleElasticsearchVersions service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/GetCompatibleElasticsearchVersions">REST API Reference for GetCompatibleElasticsearchVersions Operation</seealso> public virtual GetCompatibleElasticsearchVersionsResponse GetCompatibleElasticsearchVersions(GetCompatibleElasticsearchVersionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetCompatibleElasticsearchVersionsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetCompatibleElasticsearchVersionsResponseUnmarshaller.Instance; return Invoke<GetCompatibleElasticsearchVersionsResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the GetCompatibleElasticsearchVersions operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetCompatibleElasticsearchVersions operation on AmazonElasticsearchClient.</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 EndGetCompatibleElasticsearchVersions /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/GetCompatibleElasticsearchVersions">REST API Reference for GetCompatibleElasticsearchVersions Operation</seealso> public virtual IAsyncResult BeginGetCompatibleElasticsearchVersions(GetCompatibleElasticsearchVersionsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = GetCompatibleElasticsearchVersionsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetCompatibleElasticsearchVersionsResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the GetCompatibleElasticsearchVersions operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetCompatibleElasticsearchVersions.</param> /// /// <returns>Returns a GetCompatibleElasticsearchVersionsResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/GetCompatibleElasticsearchVersions">REST API Reference for GetCompatibleElasticsearchVersions Operation</seealso> public virtual GetCompatibleElasticsearchVersionsResponse EndGetCompatibleElasticsearchVersions(IAsyncResult asyncResult) { return EndInvoke<GetCompatibleElasticsearchVersionsResponse>(asyncResult); } #endregion #region GetPackageVersionHistory /// <summary> /// Returns a list of versions of the package, along with their creation time and commit /// message. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetPackageVersionHistory service method.</param> /// /// <returns>The response from the GetPackageVersionHistory service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.AccessDeniedException"> /// An error occurred because user does not have permissions to access the resource. Returns /// HTTP status code 403. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/GetPackageVersionHistory">REST API Reference for GetPackageVersionHistory Operation</seealso> public virtual GetPackageVersionHistoryResponse GetPackageVersionHistory(GetPackageVersionHistoryRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetPackageVersionHistoryRequestMarshaller.Instance; options.ResponseUnmarshaller = GetPackageVersionHistoryResponseUnmarshaller.Instance; return Invoke<GetPackageVersionHistoryResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the GetPackageVersionHistory operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetPackageVersionHistory operation on AmazonElasticsearchClient.</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 EndGetPackageVersionHistory /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/GetPackageVersionHistory">REST API Reference for GetPackageVersionHistory Operation</seealso> public virtual IAsyncResult BeginGetPackageVersionHistory(GetPackageVersionHistoryRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = GetPackageVersionHistoryRequestMarshaller.Instance; options.ResponseUnmarshaller = GetPackageVersionHistoryResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the GetPackageVersionHistory operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetPackageVersionHistory.</param> /// /// <returns>Returns a GetPackageVersionHistoryResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/GetPackageVersionHistory">REST API Reference for GetPackageVersionHistory Operation</seealso> public virtual GetPackageVersionHistoryResponse EndGetPackageVersionHistory(IAsyncResult asyncResult) { return EndInvoke<GetPackageVersionHistoryResponse>(asyncResult); } #endregion #region GetUpgradeHistory /// <summary> /// Retrieves the complete history of the last 10 upgrades that were performed on the /// domain. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetUpgradeHistory service method.</param> /// /// <returns>The response from the GetUpgradeHistory service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/GetUpgradeHistory">REST API Reference for GetUpgradeHistory Operation</seealso> public virtual GetUpgradeHistoryResponse GetUpgradeHistory(GetUpgradeHistoryRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetUpgradeHistoryRequestMarshaller.Instance; options.ResponseUnmarshaller = GetUpgradeHistoryResponseUnmarshaller.Instance; return Invoke<GetUpgradeHistoryResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the GetUpgradeHistory operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetUpgradeHistory operation on AmazonElasticsearchClient.</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 EndGetUpgradeHistory /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/GetUpgradeHistory">REST API Reference for GetUpgradeHistory Operation</seealso> public virtual IAsyncResult BeginGetUpgradeHistory(GetUpgradeHistoryRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = GetUpgradeHistoryRequestMarshaller.Instance; options.ResponseUnmarshaller = GetUpgradeHistoryResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the GetUpgradeHistory operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetUpgradeHistory.</param> /// /// <returns>Returns a GetUpgradeHistoryResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/GetUpgradeHistory">REST API Reference for GetUpgradeHistory Operation</seealso> public virtual GetUpgradeHistoryResponse EndGetUpgradeHistory(IAsyncResult asyncResult) { return EndInvoke<GetUpgradeHistoryResponse>(asyncResult); } #endregion #region GetUpgradeStatus /// <summary> /// Retrieves the latest status of the last upgrade or upgrade eligibility check that /// was performed on the domain. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetUpgradeStatus service method.</param> /// /// <returns>The response from the GetUpgradeStatus service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/GetUpgradeStatus">REST API Reference for GetUpgradeStatus Operation</seealso> public virtual GetUpgradeStatusResponse GetUpgradeStatus(GetUpgradeStatusRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetUpgradeStatusRequestMarshaller.Instance; options.ResponseUnmarshaller = GetUpgradeStatusResponseUnmarshaller.Instance; return Invoke<GetUpgradeStatusResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the GetUpgradeStatus operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetUpgradeStatus operation on AmazonElasticsearchClient.</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 EndGetUpgradeStatus /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/GetUpgradeStatus">REST API Reference for GetUpgradeStatus Operation</seealso> public virtual IAsyncResult BeginGetUpgradeStatus(GetUpgradeStatusRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = GetUpgradeStatusRequestMarshaller.Instance; options.ResponseUnmarshaller = GetUpgradeStatusResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the GetUpgradeStatus operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetUpgradeStatus.</param> /// /// <returns>Returns a GetUpgradeStatusResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/GetUpgradeStatus">REST API Reference for GetUpgradeStatus Operation</seealso> public virtual GetUpgradeStatusResponse EndGetUpgradeStatus(IAsyncResult asyncResult) { return EndInvoke<GetUpgradeStatusResponse>(asyncResult); } #endregion #region ListDomainNames /// <summary> /// Returns the name of all Elasticsearch domains owned by the current user's account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListDomainNames service method.</param> /// /// <returns>The response from the ListDomainNames service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListDomainNames">REST API Reference for ListDomainNames Operation</seealso> public virtual ListDomainNamesResponse ListDomainNames(ListDomainNamesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListDomainNamesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListDomainNamesResponseUnmarshaller.Instance; return Invoke<ListDomainNamesResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the ListDomainNames operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListDomainNames operation on AmazonElasticsearchClient.</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 EndListDomainNames /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListDomainNames">REST API Reference for ListDomainNames Operation</seealso> public virtual IAsyncResult BeginListDomainNames(ListDomainNamesRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = ListDomainNamesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListDomainNamesResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the ListDomainNames operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginListDomainNames.</param> /// /// <returns>Returns a ListDomainNamesResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListDomainNames">REST API Reference for ListDomainNames Operation</seealso> public virtual ListDomainNamesResponse EndListDomainNames(IAsyncResult asyncResult) { return EndInvoke<ListDomainNamesResponse>(asyncResult); } #endregion #region ListDomainsForPackage /// <summary> /// Lists all Amazon ES domains associated with the package. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListDomainsForPackage service method.</param> /// /// <returns>The response from the ListDomainsForPackage service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.AccessDeniedException"> /// An error occurred because user does not have permissions to access the resource. Returns /// HTTP status code 403. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListDomainsForPackage">REST API Reference for ListDomainsForPackage Operation</seealso> public virtual ListDomainsForPackageResponse ListDomainsForPackage(ListDomainsForPackageRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListDomainsForPackageRequestMarshaller.Instance; options.ResponseUnmarshaller = ListDomainsForPackageResponseUnmarshaller.Instance; return Invoke<ListDomainsForPackageResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the ListDomainsForPackage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListDomainsForPackage operation on AmazonElasticsearchClient.</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 EndListDomainsForPackage /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListDomainsForPackage">REST API Reference for ListDomainsForPackage Operation</seealso> public virtual IAsyncResult BeginListDomainsForPackage(ListDomainsForPackageRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = ListDomainsForPackageRequestMarshaller.Instance; options.ResponseUnmarshaller = ListDomainsForPackageResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the ListDomainsForPackage operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginListDomainsForPackage.</param> /// /// <returns>Returns a ListDomainsForPackageResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListDomainsForPackage">REST API Reference for ListDomainsForPackage Operation</seealso> public virtual ListDomainsForPackageResponse EndListDomainsForPackage(IAsyncResult asyncResult) { return EndInvoke<ListDomainsForPackageResponse>(asyncResult); } #endregion #region ListElasticsearchInstanceTypes /// <summary> /// List all Elasticsearch instance types that are supported for given ElasticsearchVersion /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListElasticsearchInstanceTypes service method.</param> /// /// <returns>The response from the ListElasticsearchInstanceTypes service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchInstanceTypes">REST API Reference for ListElasticsearchInstanceTypes Operation</seealso> public virtual ListElasticsearchInstanceTypesResponse ListElasticsearchInstanceTypes(ListElasticsearchInstanceTypesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListElasticsearchInstanceTypesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListElasticsearchInstanceTypesResponseUnmarshaller.Instance; return Invoke<ListElasticsearchInstanceTypesResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the ListElasticsearchInstanceTypes operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListElasticsearchInstanceTypes operation on AmazonElasticsearchClient.</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 EndListElasticsearchInstanceTypes /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchInstanceTypes">REST API Reference for ListElasticsearchInstanceTypes Operation</seealso> public virtual IAsyncResult BeginListElasticsearchInstanceTypes(ListElasticsearchInstanceTypesRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = ListElasticsearchInstanceTypesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListElasticsearchInstanceTypesResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the ListElasticsearchInstanceTypes operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginListElasticsearchInstanceTypes.</param> /// /// <returns>Returns a ListElasticsearchInstanceTypesResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchInstanceTypes">REST API Reference for ListElasticsearchInstanceTypes Operation</seealso> public virtual ListElasticsearchInstanceTypesResponse EndListElasticsearchInstanceTypes(IAsyncResult asyncResult) { return EndInvoke<ListElasticsearchInstanceTypesResponse>(asyncResult); } #endregion #region ListElasticsearchVersions /// <summary> /// List all supported Elasticsearch versions /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListElasticsearchVersions service method.</param> /// /// <returns>The response from the ListElasticsearchVersions service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchVersions">REST API Reference for ListElasticsearchVersions Operation</seealso> public virtual ListElasticsearchVersionsResponse ListElasticsearchVersions(ListElasticsearchVersionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListElasticsearchVersionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListElasticsearchVersionsResponseUnmarshaller.Instance; return Invoke<ListElasticsearchVersionsResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the ListElasticsearchVersions operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListElasticsearchVersions operation on AmazonElasticsearchClient.</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 EndListElasticsearchVersions /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchVersions">REST API Reference for ListElasticsearchVersions Operation</seealso> public virtual IAsyncResult BeginListElasticsearchVersions(ListElasticsearchVersionsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = ListElasticsearchVersionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListElasticsearchVersionsResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the ListElasticsearchVersions operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginListElasticsearchVersions.</param> /// /// <returns>Returns a ListElasticsearchVersionsResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListElasticsearchVersions">REST API Reference for ListElasticsearchVersions Operation</seealso> public virtual ListElasticsearchVersionsResponse EndListElasticsearchVersions(IAsyncResult asyncResult) { return EndInvoke<ListElasticsearchVersionsResponse>(asyncResult); } #endregion #region ListPackagesForDomain /// <summary> /// Lists all packages associated with the Amazon ES domain. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListPackagesForDomain service method.</param> /// /// <returns>The response from the ListPackagesForDomain service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.AccessDeniedException"> /// An error occurred because user does not have permissions to access the resource. Returns /// HTTP status code 403. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListPackagesForDomain">REST API Reference for ListPackagesForDomain Operation</seealso> public virtual ListPackagesForDomainResponse ListPackagesForDomain(ListPackagesForDomainRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListPackagesForDomainRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPackagesForDomainResponseUnmarshaller.Instance; return Invoke<ListPackagesForDomainResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the ListPackagesForDomain operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListPackagesForDomain operation on AmazonElasticsearchClient.</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 EndListPackagesForDomain /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListPackagesForDomain">REST API Reference for ListPackagesForDomain Operation</seealso> public virtual IAsyncResult BeginListPackagesForDomain(ListPackagesForDomainRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = ListPackagesForDomainRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPackagesForDomainResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the ListPackagesForDomain operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginListPackagesForDomain.</param> /// /// <returns>Returns a ListPackagesForDomainResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListPackagesForDomain">REST API Reference for ListPackagesForDomain Operation</seealso> public virtual ListPackagesForDomainResponse EndListPackagesForDomain(IAsyncResult asyncResult) { return EndInvoke<ListPackagesForDomainResponse>(asyncResult); } #endregion #region ListTags /// <summary> /// Returns all tags for the given Elasticsearch domain. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListTags service method.</param> /// /// <returns>The response from the ListTags service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListTags">REST API Reference for ListTags Operation</seealso> public virtual ListTagsResponse ListTags(ListTagsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListTagsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTagsResponseUnmarshaller.Instance; return Invoke<ListTagsResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the ListTags operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListTags operation on AmazonElasticsearchClient.</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 EndListTags /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListTags">REST API Reference for ListTags Operation</seealso> public virtual IAsyncResult BeginListTags(ListTagsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = ListTagsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTagsResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the ListTags operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginListTags.</param> /// /// <returns>Returns a ListTagsResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/ListTags">REST API Reference for ListTags Operation</seealso> public virtual ListTagsResponse EndListTags(IAsyncResult asyncResult) { return EndInvoke<ListTagsResponse>(asyncResult); } #endregion #region PurchaseReservedElasticsearchInstanceOffering /// <summary> /// Allows you to purchase reserved Elasticsearch instances. /// </summary> /// <param name="request">Container for the necessary parameters to execute the PurchaseReservedElasticsearchInstanceOffering service method.</param> /// /// <returns>The response from the PurchaseReservedElasticsearchInstanceOffering service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.LimitExceededException"> /// An exception for trying to create more than allowed resources or sub-resources. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceAlreadyExistsException"> /// An exception for creating a resource that already exists. Gives http status code of /// 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/PurchaseReservedElasticsearchInstanceOffering">REST API Reference for PurchaseReservedElasticsearchInstanceOffering Operation</seealso> public virtual PurchaseReservedElasticsearchInstanceOfferingResponse PurchaseReservedElasticsearchInstanceOffering(PurchaseReservedElasticsearchInstanceOfferingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PurchaseReservedElasticsearchInstanceOfferingRequestMarshaller.Instance; options.ResponseUnmarshaller = PurchaseReservedElasticsearchInstanceOfferingResponseUnmarshaller.Instance; return Invoke<PurchaseReservedElasticsearchInstanceOfferingResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the PurchaseReservedElasticsearchInstanceOffering operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PurchaseReservedElasticsearchInstanceOffering operation on AmazonElasticsearchClient.</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 EndPurchaseReservedElasticsearchInstanceOffering /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/PurchaseReservedElasticsearchInstanceOffering">REST API Reference for PurchaseReservedElasticsearchInstanceOffering Operation</seealso> public virtual IAsyncResult BeginPurchaseReservedElasticsearchInstanceOffering(PurchaseReservedElasticsearchInstanceOfferingRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = PurchaseReservedElasticsearchInstanceOfferingRequestMarshaller.Instance; options.ResponseUnmarshaller = PurchaseReservedElasticsearchInstanceOfferingResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the PurchaseReservedElasticsearchInstanceOffering operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginPurchaseReservedElasticsearchInstanceOffering.</param> /// /// <returns>Returns a PurchaseReservedElasticsearchInstanceOfferingResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/PurchaseReservedElasticsearchInstanceOffering">REST API Reference for PurchaseReservedElasticsearchInstanceOffering Operation</seealso> public virtual PurchaseReservedElasticsearchInstanceOfferingResponse EndPurchaseReservedElasticsearchInstanceOffering(IAsyncResult asyncResult) { return EndInvoke<PurchaseReservedElasticsearchInstanceOfferingResponse>(asyncResult); } #endregion #region RejectInboundCrossClusterSearchConnection /// <summary> /// Allows the destination domain owner to reject an inbound cross-cluster search connection /// request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RejectInboundCrossClusterSearchConnection service method.</param> /// /// <returns>The response from the RejectInboundCrossClusterSearchConnection service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/RejectInboundCrossClusterSearchConnection">REST API Reference for RejectInboundCrossClusterSearchConnection Operation</seealso> public virtual RejectInboundCrossClusterSearchConnectionResponse RejectInboundCrossClusterSearchConnection(RejectInboundCrossClusterSearchConnectionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = RejectInboundCrossClusterSearchConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = RejectInboundCrossClusterSearchConnectionResponseUnmarshaller.Instance; return Invoke<RejectInboundCrossClusterSearchConnectionResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the RejectInboundCrossClusterSearchConnection operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RejectInboundCrossClusterSearchConnection operation on AmazonElasticsearchClient.</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 EndRejectInboundCrossClusterSearchConnection /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/RejectInboundCrossClusterSearchConnection">REST API Reference for RejectInboundCrossClusterSearchConnection Operation</seealso> public virtual IAsyncResult BeginRejectInboundCrossClusterSearchConnection(RejectInboundCrossClusterSearchConnectionRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = RejectInboundCrossClusterSearchConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = RejectInboundCrossClusterSearchConnectionResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the RejectInboundCrossClusterSearchConnection operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginRejectInboundCrossClusterSearchConnection.</param> /// /// <returns>Returns a RejectInboundCrossClusterSearchConnectionResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/RejectInboundCrossClusterSearchConnection">REST API Reference for RejectInboundCrossClusterSearchConnection Operation</seealso> public virtual RejectInboundCrossClusterSearchConnectionResponse EndRejectInboundCrossClusterSearchConnection(IAsyncResult asyncResult) { return EndInvoke<RejectInboundCrossClusterSearchConnectionResponse>(asyncResult); } #endregion #region RemoveTags /// <summary> /// Removes the specified set of tags from the specified Elasticsearch domain. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RemoveTags service method.</param> /// /// <returns>The response from the RemoveTags service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/RemoveTags">REST API Reference for RemoveTags Operation</seealso> public virtual RemoveTagsResponse RemoveTags(RemoveTagsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = RemoveTagsRequestMarshaller.Instance; options.ResponseUnmarshaller = RemoveTagsResponseUnmarshaller.Instance; return Invoke<RemoveTagsResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the RemoveTags operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RemoveTags operation on AmazonElasticsearchClient.</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 EndRemoveTags /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/RemoveTags">REST API Reference for RemoveTags Operation</seealso> public virtual IAsyncResult BeginRemoveTags(RemoveTagsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = RemoveTagsRequestMarshaller.Instance; options.ResponseUnmarshaller = RemoveTagsResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the RemoveTags operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginRemoveTags.</param> /// /// <returns>Returns a RemoveTagsResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/RemoveTags">REST API Reference for RemoveTags Operation</seealso> public virtual RemoveTagsResponse EndRemoveTags(IAsyncResult asyncResult) { return EndInvoke<RemoveTagsResponse>(asyncResult); } #endregion #region StartElasticsearchServiceSoftwareUpdate /// <summary> /// Schedules a service software update for an Amazon ES domain. /// </summary> /// <param name="request">Container for the necessary parameters to execute the StartElasticsearchServiceSoftwareUpdate service method.</param> /// /// <returns>The response from the StartElasticsearchServiceSoftwareUpdate service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/StartElasticsearchServiceSoftwareUpdate">REST API Reference for StartElasticsearchServiceSoftwareUpdate Operation</seealso> public virtual StartElasticsearchServiceSoftwareUpdateResponse StartElasticsearchServiceSoftwareUpdate(StartElasticsearchServiceSoftwareUpdateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = StartElasticsearchServiceSoftwareUpdateRequestMarshaller.Instance; options.ResponseUnmarshaller = StartElasticsearchServiceSoftwareUpdateResponseUnmarshaller.Instance; return Invoke<StartElasticsearchServiceSoftwareUpdateResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the StartElasticsearchServiceSoftwareUpdate operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the StartElasticsearchServiceSoftwareUpdate operation on AmazonElasticsearchClient.</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 EndStartElasticsearchServiceSoftwareUpdate /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/StartElasticsearchServiceSoftwareUpdate">REST API Reference for StartElasticsearchServiceSoftwareUpdate Operation</seealso> public virtual IAsyncResult BeginStartElasticsearchServiceSoftwareUpdate(StartElasticsearchServiceSoftwareUpdateRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = StartElasticsearchServiceSoftwareUpdateRequestMarshaller.Instance; options.ResponseUnmarshaller = StartElasticsearchServiceSoftwareUpdateResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the StartElasticsearchServiceSoftwareUpdate operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginStartElasticsearchServiceSoftwareUpdate.</param> /// /// <returns>Returns a StartElasticsearchServiceSoftwareUpdateResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/StartElasticsearchServiceSoftwareUpdate">REST API Reference for StartElasticsearchServiceSoftwareUpdate Operation</seealso> public virtual StartElasticsearchServiceSoftwareUpdateResponse EndStartElasticsearchServiceSoftwareUpdate(IAsyncResult asyncResult) { return EndInvoke<StartElasticsearchServiceSoftwareUpdateResponse>(asyncResult); } #endregion #region UpdateElasticsearchDomainConfig /// <summary> /// Modifies the cluster configuration of the specified Elasticsearch domain, setting /// as setting the instance type and the number of instances. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateElasticsearchDomainConfig service method.</param> /// /// <returns>The response from the UpdateElasticsearchDomainConfig service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InvalidTypeException"> /// An exception for trying to create or access sub-resource that is either invalid or /// not supported. Gives http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.LimitExceededException"> /// An exception for trying to create more than allowed resources or sub-resources. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/UpdateElasticsearchDomainConfig">REST API Reference for UpdateElasticsearchDomainConfig Operation</seealso> public virtual UpdateElasticsearchDomainConfigResponse UpdateElasticsearchDomainConfig(UpdateElasticsearchDomainConfigRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateElasticsearchDomainConfigRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateElasticsearchDomainConfigResponseUnmarshaller.Instance; return Invoke<UpdateElasticsearchDomainConfigResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the UpdateElasticsearchDomainConfig operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateElasticsearchDomainConfig operation on AmazonElasticsearchClient.</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 EndUpdateElasticsearchDomainConfig /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/UpdateElasticsearchDomainConfig">REST API Reference for UpdateElasticsearchDomainConfig Operation</seealso> public virtual IAsyncResult BeginUpdateElasticsearchDomainConfig(UpdateElasticsearchDomainConfigRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateElasticsearchDomainConfigRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateElasticsearchDomainConfigResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the UpdateElasticsearchDomainConfig operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateElasticsearchDomainConfig.</param> /// /// <returns>Returns a UpdateElasticsearchDomainConfigResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/UpdateElasticsearchDomainConfig">REST API Reference for UpdateElasticsearchDomainConfig Operation</seealso> public virtual UpdateElasticsearchDomainConfigResponse EndUpdateElasticsearchDomainConfig(IAsyncResult asyncResult) { return EndInvoke<UpdateElasticsearchDomainConfigResponse>(asyncResult); } #endregion #region UpdatePackage /// <summary> /// Updates a package for use with Amazon ES domains. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdatePackage service method.</param> /// /// <returns>The response from the UpdatePackage service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.AccessDeniedException"> /// An error occurred because user does not have permissions to access the resource. Returns /// HTTP status code 403. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.LimitExceededException"> /// An exception for trying to create more than allowed resources or sub-resources. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/UpdatePackage">REST API Reference for UpdatePackage Operation</seealso> public virtual UpdatePackageResponse UpdatePackage(UpdatePackageRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdatePackageRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdatePackageResponseUnmarshaller.Instance; return Invoke<UpdatePackageResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the UpdatePackage operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdatePackage operation on AmazonElasticsearchClient.</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 EndUpdatePackage /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/UpdatePackage">REST API Reference for UpdatePackage Operation</seealso> public virtual IAsyncResult BeginUpdatePackage(UpdatePackageRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = UpdatePackageRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdatePackageResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the UpdatePackage operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdatePackage.</param> /// /// <returns>Returns a UpdatePackageResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/UpdatePackage">REST API Reference for UpdatePackage Operation</seealso> public virtual UpdatePackageResponse EndUpdatePackage(IAsyncResult asyncResult) { return EndInvoke<UpdatePackageResponse>(asyncResult); } #endregion #region UpgradeElasticsearchDomain /// <summary> /// Allows you to either upgrade your domain or perform an Upgrade eligibility check to /// a compatible Elasticsearch version. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpgradeElasticsearchDomain service method.</param> /// /// <returns>The response from the UpgradeElasticsearchDomain service method, as returned by Elasticsearch.</returns> /// <exception cref="Amazon.Elasticsearch.Model.BaseException"> /// An error occurred while processing the request. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.DisabledOperationException"> /// An error occured because the client wanted to access a not supported operation. Gives /// http status code of 409. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.InternalException"> /// The request processing has failed because of an unknown error, exception or failure /// (the failure is internal to the service) . Gives http status code of 500. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceAlreadyExistsException"> /// An exception for creating a resource that already exists. Gives http status code of /// 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ResourceNotFoundException"> /// An exception for accessing or deleting a resource that does not exist. Gives http /// status code of 400. /// </exception> /// <exception cref="Amazon.Elasticsearch.Model.ValidationException"> /// An exception for missing / invalid input fields. Gives http status code of 400. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/UpgradeElasticsearchDomain">REST API Reference for UpgradeElasticsearchDomain Operation</seealso> public virtual UpgradeElasticsearchDomainResponse UpgradeElasticsearchDomain(UpgradeElasticsearchDomainRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpgradeElasticsearchDomainRequestMarshaller.Instance; options.ResponseUnmarshaller = UpgradeElasticsearchDomainResponseUnmarshaller.Instance; return Invoke<UpgradeElasticsearchDomainResponse>(request, options); } /// <summary> /// Initiates the asynchronous execution of the UpgradeElasticsearchDomain operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpgradeElasticsearchDomain operation on AmazonElasticsearchClient.</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 EndUpgradeElasticsearchDomain /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/UpgradeElasticsearchDomain">REST API Reference for UpgradeElasticsearchDomain Operation</seealso> public virtual IAsyncResult BeginUpgradeElasticsearchDomain(UpgradeElasticsearchDomainRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = UpgradeElasticsearchDomainRequestMarshaller.Instance; options.ResponseUnmarshaller = UpgradeElasticsearchDomainResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// <summary> /// Finishes the asynchronous execution of the UpgradeElasticsearchDomain operation. /// </summary> /// /// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpgradeElasticsearchDomain.</param> /// /// <returns>Returns a UpgradeElasticsearchDomainResult from Elasticsearch.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/es-2015-01-01/UpgradeElasticsearchDomain">REST API Reference for UpgradeElasticsearchDomain Operation</seealso> public virtual UpgradeElasticsearchDomainResponse EndUpgradeElasticsearchDomain(IAsyncResult asyncResult) { return EndInvoke<UpgradeElasticsearchDomainResponse>(asyncResult); } #endregion } }
62.058824
218
0.698866
[ "Apache-2.0" ]
ChristopherButtars/aws-sdk-net
sdk/src/Services/Elasticsearch/Generated/_bcl35/AmazonElasticsearchClient.cs
190,955
C#
using Microsoft.AspNetCore.Components; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Blazui.ClientRender.PWA.Demo.BasicRadio { public class RadioButtonBase : ComponentBase { protected int selectedValue = 1; } }
21
49
0.758503
[ "MIT" ]
188867052/Element-Blazor
src/Samples/Blazui/Blazui.ClientRender.PWA/Demo/BasicRadio/RadioButtonBase.cs
296
C#
namespace Org.BouncyCastle.Crypto.Engines { /// <remarks> /// An implementation of the Camellia key wrapper based on RFC 3657/RFC 3394. /// <p/> /// For further details see: <a href="http://www.ietf.org/rfc/rfc3657.txt">http://www.ietf.org/rfc/rfc3657.txt</a>. /// </remarks> public class CamelliaWrapEngine : Rfc3394WrapEngine { public CamelliaWrapEngine() : base(new CamelliaEngine()) { } } }
24.352941
116
0.683575
[ "MIT" ]
0x070696E65/Symnity
Assets/Plugins/Symnity/Pulgins/crypto/src/crypto/engines/CamelliaWrapEngine.cs
414
C#
//---------------------------------------------------------------------------------------------- // Copyright 2021 Microsoft Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. //--------------------------------------------------------------------------------------------- using System.Security.Cryptography.X509Certificates; namespace AMSExplorer { public class PFXCertificate { public string Password { get; set; } public X509Certificate2 Certificate { get; set; } } }
40.269231
97
0.578797
[ "Apache-2.0" ]
Azure/Azure-Media-Services-Explorer
AMSExplorer/Models/Drm/PFXCertificate.cs
1,049
C#
using System.IO; using System.Runtime.Serialization; using GameEstate.Formats.Red.CR2W.Reflection; using FastMember; using static GameEstate.Formats.Red.Records.Enums; namespace GameEstate.Formats.Red.Types { [DataContract(Namespace = "")] [REDMeta] public class SStorySceneEventGroupEntry : CVariable { [Ordinal(1)] [RED("time")] public CFloat Time { get; set;} [Ordinal(2)] [RED("event")] public CPtr<CStorySceneEvent> Event { get; set;} public SStorySceneEventGroupEntry(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name){ } public static CVariable Create(CR2WFile cr2w, CVariable parent, string name) => new SStorySceneEventGroupEntry(cr2w, parent, name); public override void Read(BinaryReader file, uint size) => base.Read(file, size); public override void Write(BinaryWriter file) => base.Write(file); } }
32.925926
134
0.727784
[ "MIT" ]
smorey2/GameEstate
src/GameEstate.Formats.Red/Formats/Red/W3/RTTIConvert/SStorySceneEventGroupEntry.cs
889
C#
using Emgu.CV; using Emgu.CV.CvEnum; using Emgu.CV.OCR; using Emgu.CV.Structure; using Emgu.CV.Util; using System; using System.Collections.Generic; using System.Drawing; using System.IO; using System.Text; using System.Windows; namespace OCRScanner.Classes { public static class OCR { //Declare a new Tesseract OCR engine private static Tesseract _ocr; /// <summary> /// Set the dictionary and whitelist for the Tesseract detection object /// </summary> /// <param name="dataPath">The path to the tessdata file</param> public static void SetTesseractObjects(string dataPath) { //create OCR engine _ocr = new Tesseract(dataPath, "eng", OcrEngineMode.TesseractLstmCombined, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-+.():'';1234567890/ "); } /// <summary> /// Pass the image through multiple filters and sort contours /// </summary> /// <param name="img">The image that will be proccessed</param> /// <returns>A list of Mat ROIs</returns> private static Mat ImageProccessing(Mat img) { //Resize the image for better uniformitty throughout the code CvInvoke.Resize(img, img, new System.Drawing.Size(600, 800)); Mat imgClone = img.Clone(); //Convert the image to grayscale CvInvoke.CvtColor(img, img, ColorConversion.Bgr2Gray); //Blur the image CvInvoke.GaussianBlur(img, img, new System.Drawing.Size(3, 3), 4, 4); CvInvoke.Imshow("GaussianBlur", img); CvInvoke.WaitKey(0); //Threshold the image CvInvoke.AdaptiveThreshold(img, img, 100, AdaptiveThresholdType.GaussianC, ThresholdType.BinaryInv, 5, 6); CvInvoke.Imshow("Thereshold", img); CvInvoke.WaitKey(0); /* //Canny the image CvInvoke.Canny(img, img, 75, 100); CvInvoke.Imshow("Canny", img); CvInvoke.WaitKey(0);*/ /* //Dilate the canny image CvInvoke.Dilate(img, img, null, new System.Drawing.Point(-1, -1), 8, BorderType.Constant, new MCvScalar(0, 255, 255)); CvInvoke.Imshow("Dilate", img); CvInvoke.WaitKey(0);*/ //Filter the contours to only find relevent ones /* List<Mat> foundOutput = FindandFilterContours(imgClone, img); for (int i = 0; i < foundOutput.Count; i++) { CvInvoke.Imshow("Found Output", foundOutput[i]); CvInvoke.WaitKey(0); }*/ return img; } /// <summary> /// Find and sort contours found on the filtered image /// </summary> /// <param name="originalImage">The original unaltered image</param> /// <param name="filteredImage">The filtered image</param> /// <returns>A list of ROI mat objects</returns> private static List<Mat> FindandFilterContours(Mat originalImage, Mat filteredImage) { //Clone the input image Image<Bgr, byte> originalImageClone = originalImage.Clone().ToImage<Bgr, byte>(); Mat filteredImage2 = filteredImage; //Declare a new vector that will store contours VectorOfVectorOfPoint contours = new VectorOfVectorOfPoint(); //Find and draw the contours on the blank image CvInvoke.FindContours(filteredImage, contours, null, RetrType.List, ChainApproxMethod.ChainApproxNone); CvInvoke.DrawContours(filteredImage2, contours, -1, new MCvScalar(255, 0, 0)); CvInvoke.Imshow("filteredImage2", filteredImage2); CvInvoke.WaitKey(0); //Create two copys of the cloned image of the input image Image<Bgr, byte> allContoursDrawn = originalImageClone.Copy(); Image<Bgr, byte> finalCopy = originalImageClone.Copy(); //Create two lists that will be used elsewhere in the algorithm List<Rectangle> listRectangles = new List<Rectangle>(); List<int> listXValues = new List<int>(); //Loop over all contours for (int i = 0; i < contours.Size; i++) { //Create a bounding rectangle around each contour Rectangle rect = CvInvoke.BoundingRectangle(contours[i]); originalImageClone.ROI = rect; //Add the bounding rectangle and its x value to their corresponding lists listRectangles.Add(rect); listXValues.Add(rect.X); //Draw the bounding rectangle on the image allContoursDrawn.Draw(rect, new Bgr(255, 0, 0), 5); } //Create two new lists that will hold data in the algorithms later on List<int> indexList = new List<int>(); List<int> smallerXValues = new List<int>(); //Loop over all relevent information for (int i = 0; i < listRectangles.Count; i++) { //If a bounding rectangle fits certain dementions, add it's x value to another list if ((listRectangles[i].Width < 400) && (listRectangles[i].Height < 400) && (listRectangles[i].Y > 200) && (listRectangles[i].Y < 300) && (listRectangles[i].Width > 50) && (listRectangles[i].Height > 40)) { originalImageClone.ROI = listRectangles[i]; finalCopy.Draw(listRectangles[i], new Bgr(255, 0, 0), 5); smallerXValues.Add(listRectangles[i].X); } } //Sort the smaller list into asending order smallerXValues.Sort(); //Loop over each value in the sorted list, and check if the same value is in the original list //If it is, add the index of the that value in the original list to a new list for (int i = 0; i < smallerXValues.Count; i++) { for (int j = 0; j < listXValues.Count; j++) { if (smallerXValues[i] == listXValues[j]) { indexList.Add(j); } } } //A list to hold the final ROIs List<Mat> outputImages = new List<Mat>(); //Loop over the sorted indexes, and add them to the final list for (int i = 0; i < indexList.Count; i++) { originalImageClone.ROI = listRectangles[indexList[i]]; outputImages.Add(originalImageClone.Mat.Clone()); } //Return the list of relevent images return outputImages; } /// <summary> /// Detects text on an image /// </summary> /// <param name="img">The image where text will be extracted from</param> /// <returns>A string of detected text</returns> public static List<string> RecognizeText(Mat img) { List<string> outputList = new List<string>(); //Change this file path to the path where the images you want to stich are located string filePath = Directory.GetParent(Directory.GetParent (Environment.CurrentDirectory).ToString()) + @"\Tessdata\"; //Declare the use of the dictonary SetTesseractObjects(filePath); //Get all cropped regions Mat croppedRegions = ImageProccessing(img); //String that will hold the output of the detected text string output = ""; Tesseract.Character[] words; try { StringBuilder strBuilder = new StringBuilder(); //Set and detect text on the image _ocr.SetImage(croppedRegions); _ocr.Recognize(); //Get the charactors of the detected words words = _ocr.GetCharacters(); //Pass each instance of the detected words to the string builder for (int j = 0; j < words.Length; j++) { strBuilder.Append(words[j].Text); } //Pass the stringbuilder into a string variable output += strBuilder.ToString() + " "; outputList.Add(output); } catch (AccessViolationException) { MessageBox.Show("There was a problem with the input image, please retake the image"); } //Return a string return outputList; } } }
38.116379
164
0.555581
[ "MIT" ]
CodeBoiz/OCRScanner
OCRScanner/OCRScanner/Classes/OCR.cs
8,845
C#
/* MIT License Copyright (c) 2018 Grega Mohorko 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. Project: GM.Tools Created: 2018-2-1 Author: GregaMohorko */ using System; using System.Collections.Generic; using System.Text; namespace GM.Tools.Google.API.Maps.Geocoding { /// <summary> /// Geocoding result. /// </summary> /// <typeparam name="T">The type of the result.</typeparam> public class GeocodingResult<T> : MapsResult<GeocodingStatusCode> { /// <summary> /// The result value. /// </summary> public T Value; } }
32.255319
78
0.769129
[ "MIT" ]
GregaMohorko/GM.Tools
src/GM.Tools/GM.Tools/Google/API/Maps/Geocoding/GeocodingResult.cs
1,518
C#
namespace ExperimentationLite.Configuration { public class DataContextSettings { public string ConnectionString { get; set; } public string Database { get; set; } } }
21.777778
52
0.668367
[ "MIT" ]
iby-dev/ExperimentationLite-API
src/ExperimentationLite.Configuration/DataContextSettings.cs
198
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("06.00 CottageScraper")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("06.00 CottageScraper")] [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("e48cd474-0fd2-4b2f-85bd-4deeb836b765")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
38.054054
84
0.747869
[ "MIT" ]
GabrielRezendi/Programming-Fundamentals-2017
02.Extented Fundamentals/25.LAMBDA AND LINQ - EXERCISES/06.00 CottageScraper/Properties/AssemblyInfo.cs
1,411
C#
// Copyright (c) Six Labors. // Licensed under the Apache License, Version 2.0. using System.Globalization; namespace SixLabors.ImageSharp.Metadata.Profiles.Exif { internal sealed class ExifLong : ExifValue<uint> { public ExifLong(ExifTag<uint> tag) : base(tag) { } public ExifLong(ExifTagValue tag) : base(tag) { } private ExifLong(ExifLong value) : base(value) { } public override ExifDataType DataType => ExifDataType.Long; protected override string StringValue => this.Value.ToString(CultureInfo.InvariantCulture); public override bool TrySetValue(object value) { if (base.TrySetValue(value)) { return true; } switch (value) { case int intValue: if (intValue >= uint.MinValue) { this.Value = (uint)intValue; return true; } return false; default: return false; } } public override IExifValue DeepClone() => new ExifLong(this); } }
23.703704
99
0.494531
[ "Apache-2.0" ]
0xced/ImageSharp
src/ImageSharp/Metadata/Profiles/Exif/Values/ExifLong.cs
1,280
C#
using System; using ElmSharp; using ElmSharp.Wearable; using Microsoft.Maui.Controls.Compatibility.Platform.TV; using static Microsoft.Maui.Controls.Compatibility.Platform.Tizen.Native.TableView; using EButton = ElmSharp.Button; using EColor = ElmSharp.Color; using EEntry = ElmSharp.Entry; using ELabel = ElmSharp.Label; using ELayout = ElmSharp.Layout; using EProgressBar = ElmSharp.ProgressBar; using ESize = ElmSharp.Size; using ESlider = ElmSharp.Slider; using EToolbarItem = ElmSharp.ToolbarItem; namespace Microsoft.Maui.Controls.Compatibility.Platform.Tizen { public static class ThemeManager { #region Layout public static EdjeTextPartObject GetContentPartEdjeObject(this ELayout layout) { return layout?.EdjeObject[ThemeConstants.Layout.Parts.Content]; } public static EdjeTextPartObject GetTextPartEdjeObject(this ELayout layout) { return layout?.EdjeObject[ThemeConstants.Layout.Parts.Text]; } public static bool SetTextPart(this ELayout layout, string text) { return layout.SetPartText(ThemeConstants.Layout.Parts.Text, text); } public static bool SetContentPart(this ELayout layout, EvasObject content, bool preserveOldContent = false) { var ret = layout.SetPartContent(ThemeConstants.Layout.Parts.Content, content, preserveOldContent); if (!ret) { // Restore theme to default if given layout is not available layout.SetTheme("layout", "application", "default"); ret = layout.SetPartContent(ThemeConstants.Layout.Parts.Content, content, preserveOldContent); } return ret; } public static bool SetBackgroundPart(this ELayout layout, EvasObject content, bool preserveOldContent = false) { return layout.SetPartContent(ThemeConstants.Layout.Parts.Background, content, preserveOldContent); } public static bool SetOverlayPart(this ELayout layout, EvasObject content, bool preserveOldContent = false) { return layout.SetPartContent(ThemeConstants.Layout.Parts.Overlay, content, preserveOldContent); } #endregion #region Entry public static bool SetPlaceHolderTextPart(this EEntry entry, string text) { return entry.SetPartText(ThemeConstants.Entry.Parts.PlaceHolderText, text); } public static void SetVerticalTextAlignment(this EEntry entry, double valign) { entry.SetVerticalTextAlignment(ThemeConstants.Common.Parts.Text, valign); } public static void SetVerticalPlaceHolderTextAlignment(this EEntry entry, double valign) { entry.SetVerticalTextAlignment(ThemeConstants.Entry.Parts.PlaceHolderText, valign); } public static ESize GetTextBlockFormattedSize(this EEntry entry) { var textPart = entry.EdjeObject[ThemeConstants.Common.Parts.Text]; if (textPart == null) { Log.Error("There is no elm.text part"); return new ESize(0, 0); } return textPart.TextBlockFormattedSize; } public static ESize GetTextBlockNativeSize(this EEntry entry) { var textPart = entry.EdjeObject[ThemeConstants.Common.Parts.Text]; if (textPart == null) { Log.Error("There is no elm.text part"); return new ESize(0, 0); } return textPart.TextBlockNativeSize; } public static ESize GetPlaceHolderTextBlockFormattedSize(this EEntry entry) { var textPart = entry.EdjeObject[ThemeConstants.Entry.Parts.PlaceHolderText]; if (textPart == null) { Log.Error("There is no elm.guide part"); return new ESize(0, 0); } return textPart.TextBlockFormattedSize; } public static ESize GetPlaceHolderTextBlockNativeSize(this EEntry entry) { var textPart = entry.EdjeObject[ThemeConstants.Entry.Parts.PlaceHolderText]; if (textPart == null) { Log.Error("There is no elm.guide part"); return new ESize(0, 0); } return textPart.TextBlockNativeSize; } #endregion #region Label public static void SetVerticalTextAlignment(this ELabel label, double valign) { label.SetVerticalTextAlignment(ThemeConstants.Common.Parts.Text, valign); } public static double GetVerticalTextAlignment(this ELabel label) { return label.GetVerticalTextAlignment(ThemeConstants.Common.Parts.Text); } public static ESize GetTextBlockFormattedSize(this ELabel label) { var textPart = label.EdjeObject[ThemeConstants.Common.Parts.Text]; if (textPart == null) { Log.Error("There is no elm.text part"); return new ESize(0, 0); } return textPart.TextBlockFormattedSize; } #endregion #region Button public static ESize GetTextBlockNativeSize(this EButton button) { var textPart = button.EdjeObject[ThemeConstants.Common.Parts.Text]; if (textPart == null) { Log.Error("There is no elm.text part"); return new ESize(0, 0); } return textPart.TextBlockNativeSize; } public static void SetTextBlockStyle(this EButton button, string style) { var textBlock = button.EdjeObject[ThemeConstants.Common.Parts.Text]; if (textBlock != null) { textBlock.TextStyle = style; } } public static void SendTextVisibleSignal(this EButton button, bool isVisible) { button.SignalEmit(isVisible ? ThemeConstants.Button.Signals.TextVisibleState : ThemeConstants.Button.Signals.TextHiddenState, ThemeConstants.Button.Signals.ElementaryCode); } public static EButton SetDefaultStyle(this EButton button) { button.Style = ThemeConstants.Button.Styles.Default; return button; } public static EButton SetBottomStyle(this EButton button) { button.Style = ThemeConstants.Button.Styles.Bottom; return button; } public static EButton SetPopupStyle(this EButton button) { button.Style = ThemeConstants.Button.Styles.Popup; return button; } public static EButton SetNavigationTitleRightStyle(this EButton button) { button.Style = ThemeConstants.Button.Styles.NavigationTitleRight; return button; } public static EButton SetNavigationTitleLeftStyle(this EButton button) { button.Style = ThemeConstants.Button.Styles.NavigationTitleLeft; return button; } public static EButton SetNavigationBackStyle(this EButton button) { button.Style = ThemeConstants.Button.Styles.NavigationBack; return button; } public static EButton SetNavigationDrawerStyle(this EButton button) { button.Style = ThemeConstants.Button.Styles.NavigationDrawers; return button; } public static EButton SetTransparentStyle(this EButton button) { button.Style = ThemeConstants.Button.Styles.Transparent; return button; } public static EButton SetWatchPopupRightStyle(this EButton button) { if (Device.Idiom != TargetIdiom.Watch) { Log.Error($"ToWatchPopupRightStyleButton is only supported on TargetIdiom.Watch : {0}", Device.Idiom); return button; } button.Style = ThemeConstants.Button.Styles.Watch.PopupRight; return button; } public static EButton SetWatchPopupLeftStyle(this EButton button) { if (Device.Idiom != TargetIdiom.Watch) { Log.Error($"WatchPopupLeftStyleButton is only supported on TargetIdiom.Watch : {0}", Device.Idiom); return button; } button.Style = ThemeConstants.Button.Styles.Watch.PopupLeft; return button; } public static EButton SetWatchTextStyle(this EButton button) { if (Device.Idiom != TargetIdiom.Watch) { Log.Error($"ToWatchPopupRightStyleButton is only supported on TargetIdiom.Watch : {0}", Device.Idiom); return button; } button.Style = ThemeConstants.Button.Styles.Watch.Text; return button; } public static bool SetIconPart(this EButton button, EvasObject content, bool preserveOldContent = false) { return button.SetPartContent(ThemeConstants.Button.Parts.Icon, content, preserveOldContent); } public static EButton SetEditFieldClearStyle(this EButton button) { button.Style = ThemeConstants.Button.Styles.EditFieldClear; return button; } public static EColor GetIconColor(this EButton button) { var ret = EColor.Default; if (button == null) return ret; ret = button.GetPartColor(ThemeConstants.Button.ColorClass.Icon); return ret; } public static void SetIconColor(this EButton button, EColor color) { if (button == null) return; button.SetPartColor(ThemeConstants.Button.ColorClass.Icon, color); button.SetPartColor(ThemeConstants.Button.ColorClass.IconPressed, color); } public static void SetEffectColor(this EButton button, EColor color) { if (button == null) return; button.SetPartColor(ThemeConstants.Button.ColorClass.Effect, color); button.SetPartColor(ThemeConstants.Button.ColorClass.EffectPressed, color); } #endregion #region Popup public static Popup SetWatchCircleStyle(this Popup popup) { if (Device.Idiom != TargetIdiom.Watch) { Log.Error($"WatchCircleStylePopup is only supported on TargetIdiom.Watch : {0}", Device.Idiom); return popup; } popup.Style = ThemeConstants.Popup.Styles.Watch.Circle; return popup; } public static void SetTitleColor(this Popup popup, EColor color) { popup.SetPartColor(Device.Idiom == TargetIdiom.TV ? ThemeConstants.Popup.ColorClass.TV.Title : ThemeConstants.Popup.ColorClass.Title, color); } public static void SetTitleBackgroundColor(this Popup popup, EColor color) { popup.SetPartColor(ThemeConstants.Popup.ColorClass.TitleBackground, color); } public static void SetContentBackgroundColor(this Popup popup, EColor color) { popup.SetPartColor(ThemeConstants.Popup.ColorClass.ContentBackground, color); } public static bool SetTitleTextPart(this Popup popup, string title) { return popup.SetPartText(ThemeConstants.Popup.Parts.Title, title); } public static bool SetButton1Part(this Popup popup, EvasObject content, bool preserveOldContent = false) { return popup.SetPartContent(ThemeConstants.Popup.Parts.Button1, content, preserveOldContent); } public static bool SetButton2Part(this Popup popup, EvasObject content, bool preserveOldContent = false) { return popup.SetPartContent(ThemeConstants.Popup.Parts.Button2, content, preserveOldContent); } public static bool SetButton3Part(this Popup popup, EvasObject content, bool preserveOldContent = false) { return popup.SetPartContent(ThemeConstants.Popup.Parts.Button3, content, preserveOldContent); } #endregion #region ProgressBar public static EProgressBar SetSmallStyle(this EProgressBar progressBar) { progressBar.Style = ThemeConstants.ProgressBar.Styles.Small; return progressBar; } public static EProgressBar SetLargeStyle(this EProgressBar progressBar) { progressBar.Style = ThemeConstants.ProgressBar.Styles.Large; return progressBar; } #endregion #region Check public static void SetOnColors(this Check check, EColor color) { foreach (string s in check.GetColorParts()) { check.SetPartColor(s, color); } } public static void DeleteOnColors(this Check check) { foreach (string s in check.GetColorEdjeParts()) { check.EdjeObject.DeleteColorClass(s); } } public static string[] GetColorParts(this Check check) { if (Device.Idiom == TargetIdiom.Watch) { if (check.Style == ThemeConstants.Check.Styles.Toggle) { return new string[] { ThemeConstants.Check.ColorClass.Watch.OuterBackgroundOn }; } else { return new string[] { ThemeConstants.Check.ColorClass.Watch.OuterBackgroundOn, ThemeConstants.Check.ColorClass.Watch.OuterBackgroundOnPressed, ThemeConstants.Check.ColorClass.Watch.CheckOn, ThemeConstants.Check.ColorClass.Watch.CheckOnPressed }; } } else if (Device.Idiom == TargetIdiom.TV) { if (check.Style == ThemeConstants.Check.Styles.Toggle) { return new string[] { ThemeConstants.Check.ColorClass.TV.SliderOn, ThemeConstants.Check.ColorClass.TV.SliderFocusedOn }; } else { return new string[] { ThemeConstants.Check.ColorClass.TV.SliderOn, ThemeConstants.Check.ColorClass.TV.SliderFocusedOn, }; } } else { if (check.Style == ThemeConstants.Check.Styles.Toggle) { return new string[] { ThemeConstants.Check.ColorClass.BackgroundOn }; } else { return new string[] { ThemeConstants.Check.ColorClass.BackgroundOn, ThemeConstants.Check.ColorClass.Stroke }; } } } public static string[] GetColorEdjeParts(this Check check) { string[] ret = check.GetColorParts(); for (int i = 0; i < ret.Length; i++) { ret[i] = check.ClassName.ToLower().Replace("elm_", "") + "/" + ret[i]; } return ret; } #endregion #region NaviItem public static void SetTitle(this NaviItem item, string text) { item.SetPartText(ThemeConstants.NaviItem.Parts.Title, text); } public static void SetBackButton(this NaviItem item, EvasObject content, bool preserveOldContent = false) { item.SetPartContent(ThemeConstants.NaviItem.Parts.BackButton, content, preserveOldContent); } public static void SetLeftToolbarButton(this NaviItem item, EvasObject content, bool preserveOldContent = false) { item.SetPartContent(ThemeConstants.NaviItem.Parts.LeftToolbarButton, content, preserveOldContent); } public static void SetRightToolbarButton(this NaviItem item, EvasObject content, bool preserveOldContent = false) { item.SetPartContent(ThemeConstants.NaviItem.Parts.RightToolbarButton, content, preserveOldContent); } public static void SetNavigationBar(this NaviItem item, EvasObject content, bool preserveOldContent = false) { item.SetPartContent(ThemeConstants.NaviItem.Parts.NavigationBar, content, preserveOldContent); } public static NaviItem SetNavigationBarStyle(this NaviItem item) { item.Style = ThemeConstants.NaviItem.Styles.NavigationBar; return item; } public static NaviItem SetTabBarStyle(this NaviItem item) { if (Device.Idiom == TargetIdiom.TV) { //According to TV UX Guideline, item style should be set to "tabbar" in case of TabbedPage only for TV profile. item.Style = ThemeConstants.NaviItem.Styles.TV.TabBar; } else { item.Style = ThemeConstants.NaviItem.Styles.Default; } return item; } #endregion #region Toolbar public static Toolbar SetNavigationBarStyle(this Toolbar toolbar) { toolbar.Style = ThemeConstants.Toolbar.Styles.NavigationBar; return toolbar; } public static Toolbar SetTVTabBarWithTitleStyle(this Toolbar toolbar) { if (Device.Idiom != TargetIdiom.TV) { Log.Error($"TabBarWithTitleStyle is only supported on TargetIdiom.TV : {0}", Device.Idiom); return toolbar; } toolbar.Style = ThemeConstants.Toolbar.Styles.TV.TabbarWithTitle; return toolbar; } #endregion #region ToolbarItem public static void SetIconPart(this EToolbarItem item, EvasObject content, bool preserveOldContent = false) { item.SetPartContent(ThemeConstants.ToolbarItem.Parts.Icon, content, preserveOldContent); } public static void SetBackgroundColor(this EToolbarItem item, EColor color) { item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.Background, color); } public static void SetUnderlineColor(this EToolbarItem item, EColor color) { item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.Underline, color); } public static void SetTextColor(this EToolbarItem item, EColor color) { if (string.IsNullOrEmpty(item.Icon)) { item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.Text, color); item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.TextPressed, color); item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.TextSelected, color); } else { item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.TextUnderIcon, color); item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.TextUnderIconPressed, color); item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.TextUnderIconSelected, color); } item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.Underline, color); } public static void SetSelectedTabColor(this EToolbarItem item, EColor color) { if (string.IsNullOrEmpty(item.Icon)) { item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.TextSelected, color); } else { item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.TextUnderIconSelected, color); item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.IconSelected, color); } item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.Underline, color); } public static void SetUnselectedTabColor(this EToolbarItem item, EColor color) { if (string.IsNullOrEmpty(item.Icon)) { item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.Text, color); item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.TextPressed, color); } else { item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.TextUnderIcon, color); item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.TextUnderIconPressed, color); item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.Icon, color); item.SetPartColor(ThemeConstants.ToolbarItem.ColorClass.IconPressed, color); } } public static void DeleteBackgroundColor(this EToolbarItem item) { item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.Background); } public static void DeleteUnderlineColor(this EToolbarItem item) { item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.Underline); } public static void DeleteTextColor(this EToolbarItem item) { if (string.IsNullOrEmpty(item.Icon)) { item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.Text); item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.TextPressed); item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.TextSelected); } else { item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.TextUnderIcon); item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.TextUnderIconPressed); item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.TextUnderIconSelected); } item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.Underline); } public static void DeleteSelectedTabColor(this EToolbarItem item) { if (string.IsNullOrEmpty(item.Icon)) { item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.TextSelected); } else { item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.TextUnderIconSelected); item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.IconSelected); } item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.Underline); } public static void DeleteUnselectedTabColor(this EToolbarItem item) { if (string.IsNullOrEmpty(item.Icon)) { item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.Text); item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.TextPressed); } else { item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.TextUnderIcon); item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.TextUnderIconPressed); item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.Icon); item.DeletePartColor(ThemeConstants.ToolbarItem.ColorClass.IconPressed); } } #endregion #region Background public static bool SetOverlayPart(this Background bg, EvasObject content, bool preserveOldContent = false) { return bg.SetPartContent(ThemeConstants.Background.Parts.Overlay, content, preserveOldContent); } #endregion #region Panes public static bool SetLeftPart(this Panes panes, EvasObject content, bool preserveOldContent = false) { return panes.SetPartContent(ThemeConstants.Panes.Parts.Left, content, preserveOldContent); } public static bool SetRightPart(this Panes panes, EvasObject content, bool preserveOldContent = false) { return panes.SetPartContent(ThemeConstants.Panes.Parts.Right, content, preserveOldContent); } #endregion #region Cell public static void SendSignalToItem(this Cell cell, GenListItem item) { // This is only required for TV profile. if (Device.Idiom != TargetIdiom.TV) return; if (cell is ImageCell) { item.EmitSignal(ThemeConstants.GenListItem.Signals.TV.SinglelineIconTextTheme, ""); } else if (cell is SwitchCell) { item.EmitSignal(ThemeConstants.GenListItem.Signals.TV.SinglelineTextIconTheme, ""); } } #endregion #region CellRenderer public static string GetTextCellRendererStyle() { return Device.Idiom == TargetIdiom.TV ? ThemeConstants.GenItemClass.Styles.Default : ThemeConstants.GenItemClass.Styles.DoubleLabel; } public static string GetTextCellGroupModeStyle(bool isGroupMode) { return isGroupMode ? ThemeConstants.GenItemClass.Styles.GroupIndex : GetTextCellRendererStyle(); } public static string GetMainPart(this CellRenderer cell) { switch (cell.Style) { default: return ThemeConstants.GenItemClass.Parts.Text; } } public static string GetDetailPart(this TextCellRenderer textCell) { // TextCell.Detail property is not supported on TV profile due to UX limitation. switch (textCell.Style) { case ThemeConstants.GenItemClass.Styles.Watch.TwoText1Icon1: case ThemeConstants.GenItemClass.Styles.Watch.Icon2Text: return ThemeConstants.GenItemClass.Parts.Watch.Text; case ThemeConstants.GenItemClass.Styles.GroupIndex: return textCell is SectionCellRenderer ? ThemeConstants.GenItemClass.Parts.Ignore : ThemeConstants.GenItemClass.Parts.EndText; default: return ThemeConstants.GenItemClass.Parts.SubText; } } public static string GetSwitchCellRendererStyle() { return Device.Idiom == TargetIdiom.Watch ? ThemeConstants.GenItemClass.Styles.Watch.Text1Icon1 : ThemeConstants.GenItemClass.Styles.Default; } public static string GetSwitchPart(this SwitchCellRenderer switchCell) { return Device.Idiom == TargetIdiom.Watch ? ThemeConstants.GenItemClass.Parts.Watch.Icon : ThemeConstants.GenItemClass.Parts.End; } public static int GetDefaultHeightPixel(this EntryCellRenderer entryCell) { return Forms.ConvertToScaledPixel(ThemeConstants.EntryCell.Resources.DefaultHeight); } public static string GetImageCellRendererStyle() { return Device.Idiom == TargetIdiom.Watch ? ThemeConstants.GenItemClass.Styles.Watch.Icon2Text : Device.Idiom == TargetIdiom.TV ? ThemeConstants.GenItemClass.Styles.Default : ThemeConstants.GenItemClass.Styles.DoubleLabel; } public static string GetImagePart(this ImageCellRenderer imageCell) { return Device.Idiom == TargetIdiom.Watch ? ThemeConstants.GenItemClass.Parts.Watch.Icon : ThemeConstants.GenItemClass.Parts.Icon; } public static int GetDefaultHeightPixel(this ImageCellRenderer imageCell) { return Forms.ConvertToScaledPixel(ThemeConstants.ImageCell.Resources.DefaultHeight); } public static string GetViewCellRendererStyle() { return ThemeConstants.GenItemClass.Styles.Full; } public static string GetMainContentPart(this ViewCellRenderer viewCell) { return ThemeConstants.GenItemClass.Parts.Content; } #endregion #region GenItemClass //public static string GetMainPart() #endregion #region GenList public static GenList SetSolidStyle(this GenList list) { list.Style = ThemeConstants.GenList.Styles.Solid; return list; } #endregion #region GenListItem public static void SetBottomlineColor(this GenListItem item, EColor color) { item.SetPartColor(ThemeConstants.GenListItem.ColorClass.BottomLine, color); } public static void SetBackgroundColor(this GenListItem item, EColor color) { item.SetPartColor(ThemeConstants.GenListItem.ColorClass.Background, color); } public static void DeleteBottomlineColor(this GenListItem item) { item.DeletePartColor(ThemeConstants.GenListItem.ColorClass.BottomLine); } public static void DeleteBackgroundColor(this GenListItem item) { item.DeletePartColor(ThemeConstants.GenListItem.ColorClass.Background); } #endregion #region Radio public static ESize GetTextBlockFormattedSize(this Radio radio) { return radio.EdjeObject[ThemeConstants.Common.Parts.Text].TextBlockFormattedSize; } public static void SetTextBlockStyle(this Radio radio, string style) { var textBlock = radio.EdjeObject[ThemeConstants.Common.Parts.Text]; if (textBlock != null) { textBlock.TextStyle = style; } } public static void SendTextVisibleSignal(this Radio radio, bool isVisible) { radio.SignalEmit(isVisible ? ThemeConstants.Radio.Signals.TextVisibleState : ThemeConstants.Radio.Signals.TextHiddenState, ThemeConstants.Radio.Signals.ElementaryCode); } #endregion #region Slider public static EColor GetBarColor(this ESlider slider) { return slider.GetPartColor(ThemeConstants.Slider.ColorClass.Bar); } public static void SetBarColor(this ESlider slider, EColor color) { slider.SetPartColor(ThemeConstants.Slider.ColorClass.Bar, color); slider.SetPartColor(ThemeConstants.Slider.ColorClass.BarPressed, color); } public static EColor GetBackgroundColor(this ESlider slider) { return slider.GetPartColor(ThemeConstants.Slider.ColorClass.Background); } public static void SetBackgroundColor(this ESlider slider, EColor color) { slider.SetPartColor(ThemeConstants.Slider.ColorClass.Background, color); } public static EColor GetHandlerColor(this ESlider slider) { return slider.GetPartColor(ThemeConstants.Slider.ColorClass.Handler); } public static void SetHandlerColor(this ESlider slider, EColor color) { slider.SetPartColor(ThemeConstants.Slider.ColorClass.Handler, color); slider.SetPartColor(ThemeConstants.Slider.ColorClass.HandlerPressed, color); } #endregion #region Index public static Index SetStyledIndex(this Index index) { index.Style = Device.Idiom == TargetIdiom.Watch ? ThemeConstants.Index.Styles.Circle : ThemeConstants.Index.Styles.PageControl; return index; } #endregion #region IndexItem public static void SetIndexItemStyle(this IndexItem item, int itemCount, int offset, int evenMiddleItem, int oddMiddleItem) { string style; int position; if (itemCount % 2 == 0) //Item count is even. { position = evenMiddleItem - itemCount / 2 + offset; style = ThemeConstants.IndexItem.Styles.EvenItemPrefix + position; } else //Item count is odd. { position = oddMiddleItem - itemCount / 2 + offset; style = ThemeConstants.IndexItem.Styles.OddItemPrefix + position; } item.Style = style; } #endregion #region CircleSpinner public static bool SetTitleTextPart(this CircleSpinner spinner, string title) { return spinner.SetPartText(ThemeConstants.Common.Parts.Text, title); } #endregion #region BaseScale public static double GetBaseScale(string deviceType) { if (deviceType.StartsWith("Mobile")) { return ThemeConstants.Common.Resource.Mobile.BaseScale; } else if (deviceType.StartsWith("TV")) { return ThemeConstants.Common.Resource.TV.BaseScale; } else if (deviceType.StartsWith("Wearable")) { return ThemeConstants.Common.Resource.Watch.BaseScale; } else if (deviceType.StartsWith("Refrigerator")) { return ThemeConstants.Common.Resource.Refrigerator.BaseScale; } else if (deviceType.StartsWith("TizenIOT")) { return ThemeConstants.Common.Resource.Iot.BaseScale; } return 1.0; } #endregion #region ShellNavBar static double s_shellNavBarDefaultHeight = -1; public static double GetDefaultHeight(this ShellNavBar navBar) { if (s_shellNavBarDefaultHeight > 0) return s_shellNavBarDefaultHeight; return s_shellNavBarDefaultHeight = CalculateDoubleScaledSizeInLargeScreen(70); } static double s_shellNavBarDefaultMenuSize = -1; public static double GetDefaultMenuSize(this ShellNavBar navBar) { if (s_shellNavBarDefaultMenuSize > 0) return s_shellNavBarDefaultMenuSize; return s_shellNavBarDefaultMenuSize = CalculateDoubleScaledSizeInLargeScreen(Device.Idiom == TargetIdiom.TV ? 70 : 40); } static double s_shellNavBarDefaultMargin = -1; public static double GetDefaultMargin(this ShellNavBar navBar) { if (s_shellNavBarDefaultMargin > 0) return s_shellNavBarDefaultMargin; return s_shellNavBarDefaultMargin = CalculateDoubleScaledSizeInLargeScreen(10); } static double s_shellNavBarTitleFontSize = -1; public static double GetDefaultTitleFontSize(this ShellNavBar navBar) { if (s_shellNavBarTitleFontSize > 0) return s_shellNavBarTitleFontSize; return s_shellNavBarTitleFontSize = CalculateDoubleScaledSizeInLargeScreen(23); } #endregion #region INavigationView static double s_navigationViewFlyoutItemHeight = -1; public static double GetFlyoutItemHeight(this INavigationView nav) { if (s_navigationViewFlyoutItemHeight > 0) return s_navigationViewFlyoutItemHeight; return s_navigationViewFlyoutItemHeight = CalculateDoubleScaledSizeInLargeScreen(60); } static double s_navigationViewFlyoutItemWidth = -1; public static double GetFlyoutItemWidth(this INavigationView nav) { if (s_navigationViewFlyoutItemWidth > 0) return s_navigationViewFlyoutItemWidth; return s_navigationViewFlyoutItemWidth = CalculateDoubleScaledSizeInLargeScreen(200); } static double s_navigationViewFlyoutIconColumnSize = -1; public static double GetFlyoutIconColumnSize(this INavigationView nav) { if (s_navigationViewFlyoutIconColumnSize > 0) return s_navigationViewFlyoutIconColumnSize; return s_navigationViewFlyoutIconColumnSize = CalculateDoubleScaledSizeInLargeScreen(40); } static double s_navigationViewFlyoutIconSize = -1; public static double GetFlyoutIconSize(this INavigationView nav) { if (s_navigationViewFlyoutIconSize > 0) return s_navigationViewFlyoutIconSize; return s_navigationViewFlyoutIconSize = CalculateDoubleScaledSizeInLargeScreen(25); } static double s_navigationViewFlyoutMargin = -1; public static double GetFlyoutMargin(this INavigationView nav) { if (s_navigationViewFlyoutMargin > 0) return s_navigationViewFlyoutMargin; return s_navigationViewFlyoutMargin = CalculateDoubleScaledSizeInLargeScreen(10); } static double s_navigationViewFlyoutItemFontSize = -1; public static double GetFlyoutItemFontSize(this INavigationView nav) { if (s_navigationViewFlyoutItemFontSize > 0) return s_navigationViewFlyoutItemFontSize; return s_navigationViewFlyoutItemFontSize = CalculateDoubleScaledSizeInLargeScreen(25); } public static Color GetTvFlyoutItemDefaultColor(this INavigationView nav) { return Color.Transparent; } public static Color GetTvFlyoutItemFocusedColor(this INavigationView nav) { return new Color(0.95); } public static Color GetTvFlyoutItemTextDefaultColor(this INavigationView nav) { return Color.White; } public static Color GetTvFlyoutItemTextFocusedColor(this INavigationView nav) { return Color.Black; } #endregion #region INavigationDrawer static double s_navigationDrawerRatio = -1; public static double GetFlyoutRatio(this INavigationDrawer drawer, int width, int height) { return s_navigationDrawerRatio = (width > height) ? 0.4 : 0.83; } public static double GetFlyoutCollapseRatio(this INavigationDrawer drawer) { return 0.05; } #endregion #region ShellMoreToolbar static double s_shellMoreToolBarIconPadding = -1; public static double GetIconPadding(this ShellMoreToolbar self) { if (s_shellMoreToolBarIconPadding > 0) return s_shellMoreToolBarIconPadding; return s_shellMoreToolBarIconPadding = CalculateDoubleScaledSizeInLargeScreen(15); } static double s_shellMoreToolBarIconSize = -1; public static double GetIconSize(this ShellMoreToolbar self) { if (s_shellMoreToolBarIconSize > 0) return s_shellMoreToolBarIconSize; return s_shellMoreToolBarIconSize = CalculateDoubleScaledSizeInLargeScreen(30); } #endregion public static double GetPhysicalPortraitSizeInDP() { var screenSize = Forms.PhysicalScreenSize; return Math.Min(screenSize.Width, screenSize.Height); } static double CalculateDoubleScaledSizeInLargeScreen(double size) { if (Forms.DisplayResolutionUnit.UseVP) return size; if (!Forms.DisplayResolutionUnit.UseDeviceScale && GetPhysicalPortraitSizeInDP() > 1000) { size *= 2.5; } if (!Forms.DisplayResolutionUnit.UseDP) { size = Forms.ConvertToPixel(size); } return size; } } }
31.138063
224
0.760785
[ "MIT" ]
3DSX/maui
src/Compatibility/Core/src/Tizen/ThemeManager.cs
32,477
C#
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the ec2-2016-04-01.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.EC2.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; namespace Amazon.EC2.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for HostInstance Object /// </summary> public class HostInstanceUnmarshaller : IUnmarshaller<HostInstance, XmlUnmarshallerContext>, IUnmarshaller<HostInstance, JsonUnmarshallerContext> { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public HostInstance Unmarshall(XmlUnmarshallerContext context) { HostInstance unmarshalledObject = new HostInstance(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) targetDepth += 2; while (context.ReadAtDepth(originalDepth)) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("instanceId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.InstanceId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("instanceType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; unmarshalledObject.InstanceType = unmarshaller.Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return unmarshalledObject; } } return unmarshalledObject; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <returns></returns> public HostInstance Unmarshall(JsonUnmarshallerContext context) { return null; } private static HostInstanceUnmarshaller _instance = new HostInstanceUnmarshaller(); /// <summary> /// Gets the singleton. /// </summary> public static HostInstanceUnmarshaller Instance { get { return _instance; } } } }
34.524272
149
0.595613
[ "Apache-2.0" ]
SaschaHaertel/AmazonAWS
sdk/src/Services/EC2/Generated/Model/Internal/MarshallTransformations/HostInstanceUnmarshaller.cs
3,556
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _05.WildFarm.Models { public class Tiger : Feline { public Tiger(string animalName, string animalType, double animalWeight, string livingRegion) : base(animalName, animalType, animalWeight, livingRegion) { } public override string MakeSound() { return "ROAAR!!!"; } public override void Eat(string foodType, int quantity) { if (foodType != "Meat") { throw new ArgumentException("Tigers are not eating that type of food!"); } this.FoodEaten += quantity; } } }
22.676471
100
0.581064
[ "MIT" ]
sotirona/SoftUni
CSharpOOPBasicsJune2017/04.Polymorphism/05.WildFarm/AnimalModels/Tiger.cs
773
C#
namespace ShortcutsGrid.Services.Image; using Models; using System; using System.Drawing; using System.IO; using System.Windows; using System.Windows.Interop; using System.Windows.Media; using System.Windows.Media.Imaging; internal static class ImageUtilities { public static ImageSource Base64StringToImage(string base64ImageString) { byte[] b; b = Convert.FromBase64String(base64ImageString); var ms = new MemoryStream(b); var img = Image.FromStream(ms); var bmp = new Bitmap(img); IntPtr hBitmap = bmp.GetHbitmap(); ImageSource imageSource = Imaging.CreateBitmapSourceFromHBitmap( hBitmap, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); return imageSource; } public static ImageSource? GetImageFromPaths(string? imgPath, string exePath) { if (string.IsNullOrWhiteSpace(imgPath)) { if (imgPath != null) { Icon icon = ExtractIcon.ExtractIconFromExecutable(exePath); return icon.ToImageSource(); } return null; } else { if (imgPath.IsBase64()) { return ImageUtilities.Base64StringToImage(imgPath); } else if (File.Exists(imgPath)) { var _image = imgPath.PathToImageSource(); if (_image == null) { var combinedSubPath = AppValues.GetSubPath(imgPath); return combinedSubPath?.PathToImageSource(); } return _image; } else if (imgPath.StartsWith("http")) { return imgPath.PathToImageSource(); } return null; } } }
28.292308
89
0.569331
[ "MIT" ]
minkostaev/ShortcutsGrid
ShortcutsGrid/Services/Image/ImageUtilities.cs
1,841
C#
using System; using BilSimser.GeoJson.GeoJson; using Newtonsoft.Json; namespace BilSimser.GeoJson.JsonConverters { public class LineStringConverter : JsonConverter { private readonly Type _type; public LineStringConverter(Type type) { _type = type; } public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { var lineString = value as LineString; writer.WriteStartArray(); foreach (var position in lineString.coordinates) { writer.WriteStartArray(); writer.WriteValue(position.x); writer.WriteValue(position.y); writer.WriteValue(position.z); writer.WriteEndArray(); } writer.WriteEndArray(); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { throw new NotImplementedException(); } public override bool CanConvert(Type objectType) { return objectType == _type; } } }
28.404762
98
0.590947
[ "MIT" ]
bsimser/GeoJSON.NET
src/BilSimser.GeoJson/JsonConverters/LineStringConverter.cs
1,193
C#
using System.Collections.Generic; namespace Reports.PluginPackager { public class Context { public string AssemblyPath { get; set; } public string OutputPath { get; set; } public string DeployedFolderName { get; set; } public bool Subfolders { get; set; } = true; public List<string> Include { get; } = new List<string> {"*.*"}; public List<string> ForceInclude { get; } = new List<string> { "PerpetuumSoft.Reporting.Export.Csv.dll", "PerpetuumSoft.Reporting.Export.OpenXML.dll" }; public List<string> Exclude { get; } = new List<string> { "*.xml", "*.pdb", "*.dll.config", "ReportPluginFramework.dll", "Server.Services.PublishService.ServiceModel.dll", "ServiceStack.*", "NodaTime.*", "ComponentFactory.*", "PerpetuumSoft.*", "NewtonSoft.*", "System.*", "Microsoft.*" }; } }
29.111111
72
0.525763
[ "Apache-2.0" ]
AquaticInformatics/time-series-custom-reports
src/Reports.PluginPackager/Context.cs
1,050
C#
using HotChocolate.Data.Neo4J.Language; using HotChocolate.Data.Neo4J.Sorting; namespace HotChocolate.Data.Neo4J.Execution; /// <summary> /// Represents a executable for Neo4j database. /// </summary> public interface INeo4JExecutable : IExecutable { /// <summary> /// Applies the filter definition to the executable /// </summary> /// <param name="filters">The filter definition</param> /// <returns>A executable that contains the filter definition</returns> INeo4JExecutable WithFiltering(CompoundCondition filters); /// <summary> /// Applies the sorting definition to the executable /// </summary> /// <param name="sorting">The sorting definition</param> /// <returns>A executable that contains the sorting definition</returns> INeo4JExecutable WithSorting(Neo4JSortDefinition[] sorting); /// <summary> /// Applies the projection definition to the executable /// </summary> /// <param name="projection">The projection definition</param> /// <returns>A executable that contains the projection definition</returns> INeo4JExecutable WithProjection(object[] projection); }
37
79
0.716652
[ "MIT" ]
ChilliCream/prometheus
src/HotChocolate/Neo4J/src/Data/Execution/INeo4JExecutable.cs
1,147
C#
using System; using System.Collections.Generic; using System.Windows.Forms; using Mage; namespace MageUIComponents { public partial class EntityFilePanel : UserControl, IModuleParameters { public event EventHandler<MageCommandEventArgs> OnAction; public EntityFilePanel() { InitializeComponent(); } /// <summary> /// Can be RegEx or FileSearch /// </summary> private string mSelectionMode = FileListFilter.FILE_SELECTOR_NORMAL; public string FileSelectionMode { get => mSelectionMode; set { mSelectionMode = value; if (mSelectionMode != FileListFilter.FILE_SELECTOR_REGEX) { FileSearchRadioBtn.Checked = true; } else { RegExRadioBtn.Checked = true; } } } /// <summary> /// This should be File or Directory or Folder /// </summary> public string IncludeFilesOrDirectories { set { IncludefilesCtl.Checked = false; IncludeDirectoriesCtl.Checked = false; if (value.Contains("File")) { IncludefilesCtl.Checked = true; } if (value.Contains("Directory") || value.Contains("Directories")) { IncludeDirectoriesCtl.Checked = true; } else if (value.Contains("Folder")) { IncludeDirectoriesCtl.Checked = true; } if (!IncludefilesCtl.Checked && !IncludeDirectoriesCtl.Checked) { // Search for files by default IncludefilesCtl.Checked = true; } } get { var state = string.Empty; if (IncludefilesCtl.Checked) { state += "File"; } if (IncludeDirectoriesCtl.Checked) { state += "Directory"; } if (string.IsNullOrWhiteSpace(state)) { // Search for files by default state = "File"; } return state; } } public string SearchInSubdirectories { get => SearchInSubdirectoriesCtl.Checked ? "Yes" : "No"; set => SearchInSubdirectoriesCtl.Checked = string.Equals(value, "Yes", StringComparison.OrdinalIgnoreCase); } public string SubdirectorySearchName { get => SubdirectorySearchNameCtl.Text; set => SubdirectorySearchNameCtl.Text = value; } public Dictionary<string, string> GetParameters() { return new Dictionary<string, string> { { "FileSelectors", FileSelectors }, { "FileSelectionMode", FileSelectionMode }, { "IncludeFilesOrDirectories", IncludeFilesOrDirectories}, { "SearchInSubdirectories", SearchInSubdirectories}, { "SubdirectorySearchName", SubdirectorySearchName} }; } public void SetParameters(Dictionary<string, string> paramList) { foreach (var paramDef in paramList) { switch (paramDef.Key) { case "FileSelectors": FileSelectors = paramDef.Value; break; case "FileSelectionMode": FileSelectionMode = paramDef.Value; break; case "IncludeFilesOrDirectories": IncludeFilesOrDirectories = paramDef.Value; break; case "SearchInSubdirectories": SearchInSubdirectories = paramDef.Value; break; case "SubdirectorySearchName": SubdirectorySearchName = paramDef.Value; break; } } } public string FileSelectors { get => FileSelectorsCtl.Text; set => FileSelectorsCtl.Text = value; } private void GetFilesForSelectedEntriesCtl_Click(object sender, EventArgs e) { OnAction?.Invoke(this, new MageCommandEventArgs("get_files_from_entities", "selected")); } private void GetFilesForAllEntriesCtl_Click(object sender, EventArgs e) { OnAction?.Invoke(this, new MageCommandEventArgs("get_files_from_entities", "all")); } private void RegExRadioBtn_CheckedChanged(object sender, EventArgs e) { mSelectionMode = FileListFilter.FILE_SELECTOR_REGEX; } private void FileSearchRadioBtn_CheckedChanged(object sender, EventArgs e) { mSelectionMode = FileListFilter.FILE_SELECTOR_NORMAL; } } }
32.526946
120
0.485272
[ "BSD-2-Clause" ]
PNNL-Comp-Mass-Spec/Mage
MageUIComponents/EntityFilePanel.cs
5,434
C#
namespace Atata { /// <summary> /// Specifies the verification of the <c>&lt;h5&gt;</c> element content. /// By default occurs upon the page object initialization. /// If no value is specified, it uses the class name as the expected value with the <see cref="TermCase.Title"/> casing applied. /// </summary> public class VerifyH5Attribute : VerifyHeadingTriggerAttribute { public VerifyH5Attribute(TermCase termCase) : base(termCase) { } public VerifyH5Attribute(TermMatch match, TermCase termCase) : base(match, termCase) { } public VerifyH5Attribute(TermMatch match, params string[] values) : base(match, values) { } public VerifyH5Attribute(params string[] values) : base(values) { } protected override void OnExecute<TOwner>(TriggerContext<TOwner> context, string[] values) => Verify<H5<TOwner>, TOwner>(context, values); } }
31.264706
133
0.590781
[ "Apache-2.0" ]
EvgeniyShunevich/Atata
src/Atata/Attributes/Triggers/VerifyH5Attribute.cs
1,063
C#
using System.Collections.Generic; using FluentAssertions; using Microsoft.AspNetCore.Razor.TagHelpers; using Xunit; namespace Winton.AspNetCore.Seo.HeaderMetadata.OpenGraph.Music { public class OpenGraphMusicRadioStationTagHelperTests { public sealed class Process : OpenGraphMusicRadioStationTagHelperTests { private static readonly MetaTag NamespaceMetaTag = new MetaTag( "OpenGraphNamespaceTagHelperComponent", "music: http://ogp.me/ns/music# og: http://ogp.me/ns#"); private static readonly MetaTag TypeMetaTag = new MetaTag("og:type", "music.radio_station"); public static IEnumerable<object[]> TestCases => new List<object[]> { new object[] { new OpenGraphMusicRadioStationTagHelper(), new List<MetaTag> { TypeMetaTag, NamespaceMetaTag } }, new object[] { new OpenGraphMusicRadioStationTagHelper { Creator = "https://example.com" }, new List<MetaTag> { new MetaTag("music:creator", "https://example.com"), TypeMetaTag, NamespaceMetaTag } } }; [Theory] [MemberData(nameof(TestCases))] private void ShouldContainCorrectMetaTags( OpenGraphMusicRadioStationTagHelper tagHelper, IEnumerable<MetaTag> expectedMetaTags) { TagHelperContext context = TagHelperTestUtils.CreateDefaultContext(); TagHelperOutput output = TagHelperTestUtils.CreateDefaultOutput(); tagHelper.Process(context, output); output .Should() .HaveMetaTagsEquivalentTo(expectedMetaTags, options => options.WithStrictOrdering()); } } public sealed class Type : OpenGraphMusicRadioStationTagHelperTests { [Fact] private void ShouldBeMusicRadioStation() { var tagHelper = new OpenGraphMusicRadioStationTagHelper(); string? type = tagHelper.Type; type.Should().Be("music.radio_station"); } } } }
35.042254
105
0.537379
[ "Apache-2.0" ]
wintoncode/Winton.AspNetCore.Seo
test/Winton.AspNetCore.Seo.Tests/HeaderMetadata/OpenGraph/Music/OpenGraphMusicRadioStationTagHelperTests.cs
2,488
C#
using System; using System.Threading.Tasks; using JustSaying.AwsTools; using JustSaying.AwsTools.QueueCreation; using Microsoft.Extensions.Logging; using Shouldly; using Xunit.Abstractions; namespace JustSaying.IntegrationTests.Fluent.AwsTools { public class WhenCreatingErrorQueue : IntegrationTestBase { public WhenCreatingErrorQueue(ITestOutputHelper outputHelper) : base(outputHelper) { } [AwsFact] public async Task Then_The_Message_Retention_Period_Is_Updated() { // Arrange ILoggerFactory loggerFactory = OutputHelper.ToLoggerFactory(); IAwsClientFactory clientFactory = CreateClientFactory(); var client = clientFactory.GetSqsClient(Region); var queue = new ErrorQueue( Region, UniqueName, client, loggerFactory); var queueConfig = new SqsBasicConfiguration() { ErrorQueueRetentionPeriod = JustSayingConstants.MaximumRetentionPeriod, ErrorQueueOptOut = true, }; // Act await queue.CreateAsync(queueConfig); queueConfig.ErrorQueueRetentionPeriod = TimeSpan.FromSeconds(100); await queue.UpdateQueueAttributeAsync(queueConfig); // Assert queue.MessageRetentionPeriod.ShouldBe(TimeSpan.FromSeconds(100)); } } }
28.803922
87
0.635126
[ "Apache-2.0" ]
brainmurphy/MyOriginalJustSayingForkArghWhyWhyWhy
JustSaying.IntegrationTests/Fluent/AwsTools/WhenCreatingErrorQueue.cs
1,469
C#