content stringlengths 5 1.04M | avg_line_length float64 1.75 12.9k | max_line_length int64 2 244k | alphanum_fraction float64 0 0.98 | licenses list | repository_name stringlengths 7 92 | path stringlengths 3 249 | size int64 5 1.04M | lang stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|
namespace AddressLoader.Mongo
{
using System;
using MongoDB.Bson.Serialization.Attributes;
[BsonIgnoreExtraElements]
public class MongoAddress
{
[BsonElement("property")]
public string AddressLine1 { get; set; }
[BsonElement("street")]
public string AddressLine2 { get; set; }
[BsonElement("town")]
public string AddressLine3 { get; set; }
[BsonElement("area")]
public string AddressLine4 { get; set; }
[BsonElement("postcode")]
public string Postcode { get; set; }
}
}
| 23.16 | 48 | 0.611399 | [
"MIT"
] | BugsUK/FindApprenticeship | tools/AddressLoader/AddressLoader/Mongo/MongoAddress.cs | 579 | C# |
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace NServiceKit.IntegrationTests.ServiceModel
{
[DataContract]
public class RequestInfo
{
}
[DataContract]
public class RequestInfoResponse
{
public RequestInfoResponse()
{
this.EnpointAttributes = new List<string>();
this.RequestAttributes = new List<string>();
this.Ipv4Addresses = new Dictionary<string, string>();
this.Ipv6Addresses = new List<string>();
}
[DataMember]
public List<string> EnpointAttributes { get; set; }
[DataMember]
public List<string> RequestAttributes { get; set; }
[DataMember]
public string IpAddress { get; set; }
public string IpAddressFamily { get; set; }
[DataMember]
public Dictionary<string, string> Ipv4Addresses { get; set; }
[DataMember]
public List<string> Ipv6Addresses { get; set; }
[DataMember]
public string NetworkLog { get; set; }
}
} | 22.738095 | 64 | 0.687958 | [
"BSD-3-Clause"
] | NServiceKit/NServiceKit | tests/NServiceKit.IntegrationTests/NServiceKit.IntegrationTests.ServiceModel/RequestInfo.cs | 914 | C# |
ο»Ώusing FluentValidation;
using MediatR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using ValidationException = Ordering.Application.Exceptions.ValidationException;
namespace Ordering.Application.Behaviours
{
public class ValidationBehaviour<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse>
{
private readonly IEnumerable<IValidator<TRequest>> _validators;
public ValidationBehaviour(IEnumerable<IValidator<TRequest>> validators)
{
_validators = validators ?? throw new ArgumentNullException(nameof(validators));
}
public async Task<TResponse> Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate<TResponse> next)
{
if (_validators.Any())
{
var context = new ValidationContext<TRequest>(request);
var validationResults = await Task.WhenAll(_validators.Select(v => v.ValidateAsync(context, cancellationToken)));
var failures = validationResults.SelectMany(r => r.Errors).Where(f => f != null).ToList();
if (failures.Count != 0)
throw new ValidationException(failures);
}
return await next();
}
}
}
| 35.184211 | 138 | 0.676889 | [
"MIT"
] | bmartens88/AspnetMicroservices | src/Services/Ordering/Ordering.Application/Behaviours/ValidationBehaviour.cs | 1,339 | C# |
ο»Ώusing Peedroca.DesignPattern.Exercise.Interfaces;
namespace Peedroca.DesignPattern.Exercise.Impostos
{
internal sealed class ICPP : Imposto
{
public ICPP()
{
}
public ICPP(IImposto outroImposto) : base(outroImposto)
{
}
protected override double CalcularMaiorImposto(Orcamento orcamento)
{
return orcamento.Valor * 0.07 + CalcularOutroImposto(orcamento);
}
protected override double CalcularMenorImposto(Orcamento orcamento)
{
return orcamento.Valor * 0.05 + CalcularOutroImposto(orcamento);
}
protected override bool DeveUsarMaiorImposto(Orcamento orcamento)
{
return orcamento.Valor >= 500;
}
}
}
| 23.484848 | 76 | 0.624516 | [
"MIT"
] | peedroca/alura-courses-exercises | source/design-patterns-I/Peedroca.DesignPattern.Exercise/Impostos/ICPP.cs | 777 | C# |
ο»Ώusing IIASA.FloodCitiSense.Security;
namespace IIASA.FloodCitiSense.Authorization.Users.Profile.Dto
{
public class GetPasswordComplexitySettingOutput
{
public PasswordComplexitySetting Setting { get; set; }
}
}
| 23.3 | 62 | 0.759657 | [
"MIT"
] | FloodCitiSense/FloodCitiSense | aspnet-core/src/IIASA.FloodCitiSense.Application.Shared/Authorization/Users/Profile/Dto/GetPasswordComplexitySettingOutput.cs | 235 | C# |
ο»Ώusing System;
using GTA;
using System.Collections.Generic;
namespace ChaosMod.Commands
{
/// <summary>
/// Cause the character to leave the current vehicle.
/// </summary>
public class Eject : Command
{
public void Handle(Chaos mod, String from, IEnumerable<String> rest)
{
var player = Game.Player.Character;
var vehicle = player?.CurrentVehicle;
if (player == null || vehicle == null)
{
mod.ShowText($"{from} tried to eject from vehicle :(");
return;
}
player.Task.LeaveVehicle();
mod.ShowText($"{from} caused you to eject from your vehicle!");
}
}
}
| 22.321429 | 71 | 0.6384 | [
"Apache-2.0",
"MIT"
] | udoprog/ChaosMod | ChaosMod/Commands/Eject.cs | 627 | C# |
ο»Ώusing System.Windows;
using System.Windows.Controls;
namespace TLRPResourceEditor.Views
{
/// <summary>
/// Interaktionslogik fΓΌr MapView.xaml
/// </summary>
public partial class MapView
{
public MapView()
{
InitializeComponent();
}
private void MonsterFormationFlyoutOpen(object sender, RoutedEventArgs e)
{
MonsterFormationChangeFlyout.IsOpen = true;
}
private void CloseFlyout(object sender, SelectionChangedEventArgs e)
{
MonsterFormationChangeFlyout.IsOpen = false;
ChangeFormation.IsEnabled = MapMonsterList.SelectedItem != null;
}
private void FlyoutDone(object sender, RoutedEventArgs e)
{
MonsterFormationChangeFlyout.IsOpen = false;
ChangeFormation.IsEnabled = MapMonsterList.SelectedItem != null;
}
}
}
| 27.764706 | 82 | 0.610169 | [
"MIT"
] | enceler/TLRPResourceEditor | TLRPResourceEditor/Views/MapView.xaml.cs | 947 | C# |
ο»Ώusing UnityEngine;
//https://docs.unity3d.com/2018.3/Documentation/Manual/StyledText.html
public class LoggerTool
{
public static void LogMessage(string _msg)
{
Debug.Log("<color=lime>" + _msg + "</color>");
}
public static void LogError(string _msg)
{
Debug.Log("<color=red>" + _msg + "</color>");
}
public static void LogWarning(string _msg)
{
Debug.Log("<color=yellow>" + _msg + "</color>");
}
public static void LogColorMessage(string _color, string _msg)
{
Debug.Log("<color=red>" + _msg + "</color>");
}
} | 22.961538 | 70 | 0.59799 | [
"MIT"
] | Arthur-Delacroix/Tutorial-HexMap | UnitySourceCode/Assets/__Temp/LoggerTool.cs | 599 | C# |
ο»Ώusing System.Web;
using System.Web.Mvc;
namespace _400_VideoGioco.MVC {
public class FilterConfig {
public static void RegisterGlobalFilters(GlobalFilterCollection filters) {
filters.Add(new HandleErrorAttribute());
}
}
}
| 24.545455 | 83 | 0.666667 | [
"MIT"
] | giuliobosco/CsharpSAMT | 04-VideoGioco/400-VideoGioco.MVC/App_Start/FilterConfig.cs | 272 | C# |
ο»Ώusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Decia.Business.Domain.Reporting.Dimensionality;
namespace Decia.Business.Domain.Reporting
{
internal class RepeatGroupData
{
private Guid m_GroupId;
private string m_GroupName;
private int m_GroupIndex;
private Nullable<Guid> m_ParentGroupId;
private List<IVariableTitleBox> m_GroupedBoxes;
public RepeatGroupData(string groupName, int groupIndex)
: this(groupName, groupIndex, (Nullable<Guid>)null)
{ }
public RepeatGroupData(string groupName, int groupIndex, RepeatGroupData parentGroup)
: this(groupName, groupIndex, (parentGroup == null) ? (Nullable<Guid>)null : (Nullable<Guid>)parentGroup.GroupId)
{ }
public RepeatGroupData(string groupName, int groupIndex, Nullable<Guid> parentGroupId)
{
m_GroupId = Guid.NewGuid();
m_GroupName = groupName;
m_GroupIndex = groupIndex;
m_ParentGroupId = parentGroupId;
m_GroupedBoxes = new List<IVariableTitleBox>();
if (!string.IsNullOrWhiteSpace(m_GroupName))
{
if (TokenizedLoweredCommonGroupName.Contains(string.Empty))
{ throw new InvalidOperationException("Invalid Repeat Group name encountered."); }
}
}
#region Properties
public Guid GroupId
{
get { return m_GroupId; }
}
public string GroupName
{
get { return m_GroupName; }
}
public int GroupIndex
{
get { return m_GroupIndex; }
}
public string CommonGroupName
{
get { return GetStandardizedGroupName(GroupName); }
}
public string LoweredCommonGroupName
{
get { return GroupName.ToLower(); }
}
public string[] TokenizedCommonGroupName
{
get { return CommonGroupName.Split(DimensionalRepeatGroup.ValidGroupNameSeparators); }
}
public string[] TokenizedLoweredCommonGroupName
{
get { return LoweredCommonGroupName.Split(DimensionalRepeatGroup.ValidGroupNameSeparators); }
}
public Nullable<Guid> ParentGroupId
{
get { return m_ParentGroupId; }
}
public IDictionary<ReportElementId, IVariableTitleBox> GroupedBoxes
{
get { return m_GroupedBoxes.ToDictionary(x => x.Key, x => x, ReportRenderingEngine.EqualityComparer_ReportElementId); }
}
#endregion
#region Methods
public void AddVariableTitleBox(IVariableTitleBox titleBox)
{
if (m_GroupedBoxes.Contains(titleBox))
{ throw new InvalidOperationException("The specified VariableTitleBox has already been added to the Repeat Group data."); }
m_GroupedBoxes.Add(titleBox);
}
public bool DoesGroupNameMatch(string otherGroupName)
{
return DoGroupNamesMatch(this.GroupName, otherGroupName);
}
public bool IsGroupNameAncestor(string otherGroupName)
{
if (string.IsNullOrWhiteSpace(m_GroupName) || string.IsNullOrWhiteSpace(otherGroupName))
{ return false; }
return IsGroupNameAncestor(this.LoweredCommonGroupName, GetStandardizedGroupName(otherGroupName).ToLower());
}
public bool IsGroupNameDescendant(string otherGroupName)
{
if (string.IsNullOrWhiteSpace(m_GroupName) || string.IsNullOrWhiteSpace(otherGroupName))
{ return false; }
return IsGroupNameAncestor(GetStandardizedGroupName(otherGroupName).ToLower(), this.LoweredCommonGroupName);
}
public bool IsGroupNameRelated(string otherGroupName)
{
return GetGroupNameRelationSeparationIndex(otherGroupName).HasValue;
}
public int? GetGroupNameRelationSeparationIndex(string otherGroupName)
{
if (string.IsNullOrWhiteSpace(m_GroupName) || string.IsNullOrWhiteSpace(otherGroupName))
{ return null; }
var thisTokens = TokenizedLoweredCommonGroupName;
var otherTokens = GetStandardizedGroupName(otherGroupName).ToLower().Split(DimensionalRepeatGroup.ValidGroupNameSeparators);
if (otherTokens.Contains(string.Empty))
{ throw new InvalidOperationException("Invalid Repeat Group name encountered."); }
if ((thisTokens.Count() < 2) || (otherTokens.Count() < 2))
{ return null; }
if (thisTokens.Count() != otherTokens.Count())
{ return null; }
int i = 0;
for (i = 0; i < (thisTokens.Count() - 1); i++)
{
if (thisTokens[i] != otherTokens[i])
{
if (i < 1)
{ return null; }
else
{ return i; }
}
}
return i;
}
#endregion
#region Static Methods
public static string GetStandardizedGroupName(string groupName)
{
var standardizedName = groupName;
foreach (char separator in DimensionalRepeatGroup.ValidGroupNameSeparators)
{ standardizedName = standardizedName.Replace(separator, DimensionalRepeatGroup.DefaultGroupNameSeparator); }
return standardizedName;
}
public static bool DoGroupNamesMatch(string thisGroupName, string otherGroupName)
{
if (string.IsNullOrWhiteSpace(thisGroupName) && string.IsNullOrWhiteSpace(otherGroupName))
{ return true; }
if (string.IsNullOrWhiteSpace(thisGroupName) || string.IsNullOrWhiteSpace(otherGroupName))
{ return false; }
var adjustedThisGroupName = RepeatGroupData.GetStandardizedGroupName(thisGroupName).ToLower();
var adjustedOtherGroupName = RepeatGroupData.GetStandardizedGroupName(otherGroupName).ToLower();
return (adjustedThisGroupName == adjustedOtherGroupName);
}
public static bool IsGroupNameAncestor(string thisLoweredGroupName, string otherLoweredGroupName)
{
if (thisLoweredGroupName.Length <= otherLoweredGroupName.Length)
{ return false; }
if (!thisLoweredGroupName.Contains(otherLoweredGroupName))
{ return false; }
var nextChar = thisLoweredGroupName.ElementAt(otherLoweredGroupName.Length);
return DimensionalRepeatGroup.ValidGroupNameSeparators.Contains(nextChar);
}
public static int GetTotalGroupDepth(RepeatGroupData thisData, IDictionary<Guid, RepeatGroupData> allDatas)
{
var currentData = thisData;
int depth = 0;
while (currentData.ParentGroupId.HasValue)
{
currentData = allDatas[currentData.ParentGroupId.Value];
depth++;
}
return depth;
}
public static RepeatGroupData GetAncesorAtDepth(RepeatGroupData thisData, IDictionary<Guid, RepeatGroupData> allDatas, int distanceFromRoot)
{
int depth = GetTotalGroupDepth(thisData, allDatas);
var currentData = thisData;
int downCount = depth - distanceFromRoot;
while (downCount > 0)
{
currentData = allDatas[currentData.ParentGroupId.Value];
downCount--;
}
return currentData;
}
#endregion
}
} | 34.026549 | 148 | 0.620676 | [
"MIT"
] | 1Schema/Open-Source | Decia.Business.Domain.Reporting/Elements/DimensionalTable/Containers/VariableTitleContainer/RepeatGroupData.cs | 7,692 | C# |
ο»Ώusing Loupedeck.PowerToysPlugin.Models.Awake;
namespace Loupedeck.PowerToysPlugin.Services
{
public class AwakeService : BaseSettingsService<AwakeSettings>
{
public AwakeService()
: base("Awake")
{
//
}
}
}
| 19.214286 | 66 | 0.605948 | [
"MIT"
] | oddbear/Loupedeck.PowerToys.Plugin | PowerToysPlugin/Services/AwakeService.cs | 271 | C# |
ο»Ώusing GW2Api.NET.V1.Recipes.Dto;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
namespace GW2Api.NET.V1
{
public partial class Gw2ApiV1
{
private static readonly string _recipesResource = "recipes.json";
private static readonly string _recipeDetailsResource = "recipe_details.json";
public async Task<IList<int>> GetAllRecipeIdsAsync(CancellationToken token = default)
=> (await GetAsync<GetAllRecipeIdsResponse>(
_recipesResource,
token
)).Recipes;
public Task<RecipeDetail> GetRecipeDetailAsync(int recipeId, CultureInfo lang = null, CancellationToken token = default)
=> GetAsync<RecipeDetail>(
_recipeDetailsResource,
new Dictionary<string, string>
{
{ "recipe_id", recipeId.ToString() },
{ "lang", lang?.TwoLetterISOLanguageName }
},
token
);
}
}
| 35.375 | 129 | 0.580389 | [
"MIT"
] | RyanClementsHax/GW2Api.NET | GW2Api.NET/V1/Recipes/Gw2ApiV1.Recipes.cs | 1,134 | C# |
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ββββ βββ βββββββ ββββββββββββ βββββββββββββββ
// βββββ ββββββββββββββββββββββββββββββββββββββββ
// ββββββ ββββββ βββ βββ ββββββ ββββββ
// βββββββββββββ βββ βββ ββββββ ββββββ
// βββ βββββββββββββββ βββ βββββββββββββββββββ
// βββ βββββ βββββββ βββ βββ βββββββββββββββ
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------
using Elastic.Transport;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;
#nullable restore
namespace Elastic.Clients.Elasticsearch.Ilm
{
public sealed class IlmPutLifecycleRequestParameters : RequestParameters<IlmPutLifecycleRequestParameters>
{
[JsonIgnore]
public Elastic.Clients.Elasticsearch.Time? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("master_timeout"); set => Q("master_timeout", value); }
[JsonIgnore]
public Elastic.Clients.Elasticsearch.Time? Timeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("timeout"); set => Q("timeout", value); }
}
public partial class IlmPutLifecycleRequest : PlainRequestBase<IlmPutLifecycleRequestParameters>
{
public IlmPutLifecycleRequest(Elastic.Clients.Elasticsearch.Name policy) : base(r => r.Required("policy", policy))
{
}
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexLifecycleManagementPutLifecycle;
protected override HttpMethod HttpMethod => HttpMethod.PUT;
protected override bool SupportsBody => false;
[JsonIgnore]
public Elastic.Clients.Elasticsearch.Time? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("master_timeout"); set => Q("master_timeout", value); }
[JsonIgnore]
public Elastic.Clients.Elasticsearch.Time? Timeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("timeout"); set => Q("timeout", value); }
}
public sealed partial class IlmPutLifecycleRequestDescriptor : RequestDescriptorBase<IlmPutLifecycleRequestDescriptor, IlmPutLifecycleRequestParameters>
{
internal IlmPutLifecycleRequestDescriptor(Action<IlmPutLifecycleRequestDescriptor> configure) => configure.Invoke(this);
public IlmPutLifecycleRequestDescriptor(Elastic.Clients.Elasticsearch.Name policy) : base(r => r.Required("policy", policy))
{
}
internal IlmPutLifecycleRequestDescriptor()
{
}
internal override ApiUrls ApiUrls => ApiUrlsLookups.IndexLifecycleManagementPutLifecycle;
protected override HttpMethod HttpMethod => HttpMethod.PUT;
protected override bool SupportsBody => false;
public IlmPutLifecycleRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Time? masterTimeout) => Qs("master_timeout", masterTimeout);
public IlmPutLifecycleRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Time? timeout) => Qs("timeout", timeout);
public IlmPutLifecycleRequestDescriptor Policy(Elastic.Clients.Elasticsearch.Name policy)
{
RouteValues.Required("policy", policy);
return Self;
}
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
{
}
}
} | 43.101266 | 162 | 0.694273 | [
"Apache-2.0"
] | SimonCropp/elasticsearch-net | src/Elastic.Clients.Elasticsearch/_Generated/Api/Ilm/IlmPutLifecycleRequest.g.cs | 3,851 | C# |
ο»Ώusing System;
using System.Collections.Generic;
namespace PAXSchedule.Models.Gudebook
{
public partial class GuidebookTourstopPoint
{
public GuidebookTourstopPoint()
{
GuidebookTourMedia = new HashSet<GuidebookTourMedium>();
}
public long Id { get; set; }
public double Longitude { get; set; }
public double Latitude { get; set; }
public double Rank { get; set; }
public long? StopId { get; set; }
public virtual GuidebookTourstop? Stop { get; set; }
public virtual ICollection<GuidebookTourMedium> GuidebookTourMedia { get; set; }
}
}
| 28 | 88 | 0.638199 | [
"MIT"
] | remyjette/PAXSchedule | Models/Guidebook/GuidebookTourstopPoint.cs | 646 | C# |
using System;
using System.Runtime.InteropServices;
namespace Toe
{
/// <summary>
/// Represents a 4D vector using four integer numbers.
/// </summary>
/// <remarks>
/// The Vector4i structure is suitable for interoperation with unmanaged code requiring three consecutive ints.
/// </remarks>
[StructLayout(LayoutKind.Sequential)]
public struct Vector4i : IEquatable<Vector4i>
{
#region Fields
/// <summary>
/// The X component of the Vector4i.
/// </summary>
public int X;
/// <summary>
/// The Y component of the Vector4i.
/// </summary>
public int Y;
/// <summary>
/// The Z component of the Vector4i.
/// </summary>
public int Z;
/// <summary>
/// The W component of the Vector4i.
/// </summary>
public int W;
#endregion
/// <summary>
/// Defines a zero-length Vector4.
/// </summary>
public static readonly Vector4i Zero = new Vector4i(0, 0, 0, 0);
#region Constructors
/// <summary>
/// Constructs a new instance.
/// </summary>
/// <param name="value">The value that will initialize this instance.</param>
public Vector4i(int value)
{
X = value;
Y = value;
Z = value;
W = value;
}
/// <summary>
/// Constructs a new Vector3i.
/// </summary>
/// <param name="x">The x component of the Vector4i.</param>
/// <param name="y">The y component of the Vector4i.</param>
/// <param name="z">The z component of the Vector4i.</param>
/// <param name="w">The w component of the Vector4i.</param>
public Vector4i(int x, int y, int z, int w)
{
X = x;
Y = y;
Z = z;
W = w;
}
/// <summary>
/// Constructs a new Vector3i.
/// </summary>
public Vector4i(Vector4 v)
{
X = (int)v.X;
Y = (int)v.Y;
Z = (int)v.Z;
W = (int)v.W;
}
#endregion
public bool Equals(Vector4i other)
{
return (X == other.X) && (Y == other.Y) && (Z == other.Z) && (W == other.W);
}
/// <summary>
/// Adds the specified instances.
/// </summary>
/// <param name="left">Left operand.</param>
/// <param name="right">Right operand.</param>
/// <returns>Result of addition.</returns>
public static Vector4i operator +(Vector4i left, Vector4i right)
{
left.X += right.X;
left.Y += right.Y;
left.Z += right.Z;
left.W += right.W;
return left;
}
public static Vector4i operator -(Vector4i left, Vector4i right)
{
left.X -= right.X;
left.Y -= right.Y;
left.Z -= right.Z;
left.W -= right.W;
return left;
}
public static Vector4i operator *(Vector4i left, Vector4i right)
{
left.X *= right.X;
left.Y *= right.Y;
left.Z *= right.Z;
left.W *= right.W;
return left;
}
public static Vector4i operator *(Vector4i left, int right)
{
left.X *= right;
left.Y *= right;
left.Z *= right;
left.W *= right;
return left;
}
/// <summary>
/// Gets or sets the value at the index of the Vector.
/// </summary>
public int this[int index]
{
get
{
if (index == 0)
{
return X;
}
if (index == 1)
{
return Y;
}
if (index == 2)
{
return Z;
}
if (index == 3)
{
return W;
}
throw new IndexOutOfRangeException("You tried to access this vector at index: " + index);
}
set
{
if (index == 0)
{
X = value;
}
else if (index == 1)
{
Y = value;
}
else if (index == 2)
{
Z = value;
}
else if (index == 3)
{
W = value;
}
else
{
throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
}
}
}
#region public float Length
public int LengthSquared
{
get { return X * X + Y * Y + Z * Z + W * W; }
}
public int Volume
{
get { return X * Y * Z * W; }
}
#endregion
}
} | 26.737113 | 119 | 0.412763 | [
"MIT"
] | gleblebedev/Toe.Math | src/Toe.Math/Vector4i.cs | 5,187 | C# |
ο»Ώ// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Screens;
namespace osu.Game.Screens.OnlinePlay
{
public abstract class OnlinePlaySubScreen : OsuScreen, IOnlinePlaySubScreen
{
public override bool DisallowExternalBeatmapRulesetChanges => false;
public virtual string ShortTitle => Title;
[Resolved(CanBeNull = true)]
protected IRoomManager RoomManager { get; private set; }
protected OnlinePlaySubScreen()
{
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
RelativeSizeAxes = Axes.Both;
}
public const double APPEAR_DURATION = 800;
public const double DISAPPEAR_DURATION = 500;
public override void OnEntering(IScreen last)
{
this.FadeInFromZero(APPEAR_DURATION, Easing.OutQuint);
}
public override bool OnExiting(IScreen next)
{
this.FadeOut(DISAPPEAR_DURATION, Easing.OutQuint);
return false;
}
public override void OnResuming(IScreen last)
{
this.FadeIn(APPEAR_DURATION, Easing.OutQuint);
}
public override void OnSuspending(IScreen next)
{
this.FadeOut(DISAPPEAR_DURATION, Easing.OutQuint);
}
public override string ToString() => Title;
}
}
| 28.690909 | 80 | 0.621673 | [
"MIT"
] | TheBicPen/osu | osu.Game/Screens/OnlinePlay/OnlinePlaySubScreen.cs | 1,526 | C# |
/*
* convertapi
*
* Convert API lets you effortlessly convert file formats and types.
*
* OpenAPI spec version: v1
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using SwaggerDateConverter = Cloudmersive.APIClient.NET.DocumentAndDataConvert.Client.SwaggerDateConverter;
namespace Cloudmersive.APIClient.NET.DocumentAndDataConvert.Model
{
/// <summary>
/// HTML template application request
/// </summary>
[DataContract]
public partial class HtmlTemplateApplicationRequest : IEquatable<HtmlTemplateApplicationRequest>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="HtmlTemplateApplicationRequest" /> class.
/// </summary>
/// <param name="htmlTemplate">HTML template input as a string.</param>
/// <param name="htmlTemplateUrl">URL to HTML template input.</param>
/// <param name="operations">Operations to apply to this template.</param>
public HtmlTemplateApplicationRequest(string htmlTemplate = default(string), string htmlTemplateUrl = default(string), List<HtmlTemplateOperation> operations = default(List<HtmlTemplateOperation>))
{
this.HtmlTemplate = htmlTemplate;
this.HtmlTemplateUrl = htmlTemplateUrl;
this.Operations = operations;
}
/// <summary>
/// HTML template input as a string
/// </summary>
/// <value>HTML template input as a string</value>
[DataMember(Name="HtmlTemplate", EmitDefaultValue=false)]
public string HtmlTemplate { get; set; }
/// <summary>
/// URL to HTML template input
/// </summary>
/// <value>URL to HTML template input</value>
[DataMember(Name="HtmlTemplateUrl", EmitDefaultValue=false)]
public string HtmlTemplateUrl { get; set; }
/// <summary>
/// Operations to apply to this template
/// </summary>
/// <value>Operations to apply to this template</value>
[DataMember(Name="Operations", EmitDefaultValue=false)]
public List<HtmlTemplateOperation> Operations { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class HtmlTemplateApplicationRequest {\n");
sb.Append(" HtmlTemplate: ").Append(HtmlTemplate).Append("\n");
sb.Append(" HtmlTemplateUrl: ").Append(HtmlTemplateUrl).Append("\n");
sb.Append(" Operations: ").Append(Operations).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as HtmlTemplateApplicationRequest);
}
/// <summary>
/// Returns true if HtmlTemplateApplicationRequest instances are equal
/// </summary>
/// <param name="input">Instance of HtmlTemplateApplicationRequest to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(HtmlTemplateApplicationRequest input)
{
if (input == null)
return false;
return
(
this.HtmlTemplate == input.HtmlTemplate ||
(this.HtmlTemplate != null &&
this.HtmlTemplate.Equals(input.HtmlTemplate))
) &&
(
this.HtmlTemplateUrl == input.HtmlTemplateUrl ||
(this.HtmlTemplateUrl != null &&
this.HtmlTemplateUrl.Equals(input.HtmlTemplateUrl))
) &&
(
this.Operations == input.Operations ||
this.Operations != null &&
this.Operations.SequenceEqual(input.Operations)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.HtmlTemplate != null)
hashCode = hashCode * 59 + this.HtmlTemplate.GetHashCode();
if (this.HtmlTemplateUrl != null)
hashCode = hashCode * 59 + this.HtmlTemplateUrl.GetHashCode();
if (this.Operations != null)
hashCode = hashCode * 59 + this.Operations.GetHashCode();
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}
| 37.66875 | 205 | 0.593828 | [
"Apache-2.0"
] | Cloudmersive/Cloudmersive.APIClient.NET.DocumentAndDataConvert | client/src/Cloudmersive.APIClient.NET.DocumentAndDataConvert/Model/HtmlTemplateApplicationRequest.cs | 6,027 | C# |
ο»Ώusing FubuMVC.Core.ServiceBus.Configuration;
using TestMessages.ScenarioSupport;
namespace FubuMVC.IntegrationTesting.Fixtures.ServiceBus.Subscriptions
{
public class HasGlobalSubscriptionsRegistry : FubuTransportRegistry<HarnessSettings>
{
public HasGlobalSubscriptionsRegistry()
{
NodeName = "GlobalSubscriber";
Channel(x => x.Website1).ReadIncoming();
SubscribeAt(x => x.Website1)
.ToSource(x => x.Service1)
.ToMessage<OneMessage>();
}
}
} | 30.5 | 88 | 0.655738 | [
"Apache-2.0"
] | DarthFubuMVC/fubumvc | src/FubuMVC.IntegrationTesting/Fixtures/ServiceBus/Subscriptions/HasGlobalSubscriptionsRegistry.cs | 551 | C# |
ο»Ώ// -----------------------------------------------------------------------------------
// Copyright (C) Riccardo De Agostini and Buildvana contributors. All rights reserved.
// Licensed under the MIT license.
// See LICENSE file in the project root for full license information.
//
// Part of this file may be third-party code, distributed under a compatible license.
// See THIRD-PARTY-NOTICES file in the project root for third-party copyright notices.
// -----------------------------------------------------------------------------------
using System;
using Buildvana.Sdk.Utilities;
namespace Buildvana.Sdk.Tasks.Base
{
public abstract class BuildvanaSdkIsolatedTask : ContextIsolatedTask
{
protected sealed override bool ExecuteIsolated()
{
try
{
Run();
}
catch (BuildErrorException ex)
{
Log.LogError(ex.Message);
}
catch (Exception e) when (!e.IsFatalException())
{
Log.LogErrorFromException(e, true, true, GetType().Name + ".cs");
}
return !Log.HasLoggedErrors;
}
protected abstract void Run();
}
}
| 32.210526 | 87 | 0.522059 | [
"MIT"
] | Buildvana/Buildvana.Sdk | src/Buildvana.Sdk.Tasks/Base/BuildvanaSdkIsolatedTask.cs | 1,226 | C# |
ο»Ώusing System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace Pchp.Core.Reflection
{
/// <summary>
/// Runtime information about a function.
/// </summary>
[DebuggerDisplay("{Name,nq}")]
public abstract class RoutineInfo : IPhpCallable
{
/// <summary>
/// Index to the routine slot.
/// <c>0</c> is an uninitialized index.
/// </summary>
public int Index { get { return _index; } internal set { _index = value; } }
protected int _index;
/// <summary>
/// Gets value indicating the routine was declared in a users code.
/// Otherwise the function is a library function.
/// </summary>
public bool IsUserFunction => _index > 0;
/// <summary>
/// Gets the routine name, cannot be <c>null</c> or empty.
/// </summary>
public string Name => _name;
protected readonly string _name;
/// <summary>
/// Gets routine callable delegate.
/// </summary>
public abstract PhpCallable PhpCallable { get; }
/// <summary>
/// Invokes the routine.
/// </summary>
public virtual PhpValue Invoke(Context ctx, object target, params PhpValue[] arguments) => PhpCallable(ctx, arguments);
//ulong _aliasedParams; // bit field corresponding to parameters that are passed by reference
//_routineFlags; // routine requirements, accessibility
// TODO: PHPDoc
/// <summary>
/// Gets methods representing the routine.
/// </summary>
public abstract MethodInfo[] Methods { get; }
/// <summary>
/// Gets the method declaring type.
/// Might get <c>null</c> if the routine represents a global function or a delegate.
/// </summary>
public abstract PhpTypeInfo DeclaringType { get; }
/// <summary>Target instance when binding the MethodInfo call.</summary>
internal virtual object Target => null;
protected RoutineInfo(int index, string name)
{
_index = index;
_name = name;
}
/// <summary>
/// Used by compiler generated code.
/// Creates instance of <see cref="RoutineInfo"/> representing a user PHP function.
/// </summary>
/// <param name="name">Function name.</param>
/// <param name="handle">CLR method handle.</param>
/// <param name="overloads">Additional method handles of the method overloads.</param>
/// <returns>Instance of routine info with uninitialized slot index and unbound delegate.</returns>
public static RoutineInfo CreateUserRoutine(string name, RuntimeMethodHandle handle, params RuntimeMethodHandle[] overloads) => PhpRoutineInfo.Create(name, handle, overloads);
/// <summary>
/// Creates instance of <see cref="RoutineInfo"/> representing a CLR methods (handling ovberloads).
/// </summary>
/// <param name="name">Function name.</param>
/// <param name="handles">CLR methods.</param>
/// <returns>Instance of routine info with uninitialized slot index and unbound delegate.</returns>
public static RoutineInfo CreateUserRoutine(string name, MethodInfo[] handles) => PhpMethodInfo.Create(0, name, handles);
/// <summary>
/// Creates user routine from a CLR delegate.
/// </summary>
/// <param name="name">PHP routine name.</param>
/// <param name="delegate">.NET delegate.</param>
/// <returns>Instance of routine info with uninitialized slot index and unbound delegate.</returns>
public static RoutineInfo CreateUserRoutine(string name, Delegate @delegate) => new DelegateRoutineInfo(name, @delegate);
#region IPhpCallable
PhpValue IPhpCallable.Invoke(Context ctx, params PhpValue[] arguments) => Invoke(ctx, Target, arguments);
PhpValue IPhpCallable.ToPhpValue() => PhpValue.Void;
#endregion
}
internal class PhpRoutineInfo : RoutineInfo
{
readonly RuntimeMethodHandle _handle;
PhpCallable _lazyDelegate;
/// <summary>
/// CLR method handle.
/// </summary>
protected RuntimeMethodHandle Handle => _handle;
public override int GetHashCode() => _handle.GetHashCode();
public override MethodInfo[] Methods => new[] { (MethodInfo)MethodBase.GetMethodFromHandle(_handle) };
public override PhpTypeInfo DeclaringType => null;
public override PhpCallable PhpCallable => _lazyDelegate ?? BindDelegate();
PhpCallable BindDelegate() => _lazyDelegate = Dynamic.BinderHelpers.BindToPhpCallable(Methods);
internal static PhpRoutineInfo Create(string name, RuntimeMethodHandle handle, params RuntimeMethodHandle[] overloads)
{
return (overloads.Length == 0)
? new PhpRoutineInfo(name, handle)
: new PhpRoutineInfoWithOverloads(name, handle, overloads);
}
protected PhpRoutineInfo(string name, RuntimeMethodHandle handle)
: base(0, name)
{
_handle = handle;
}
#region PhpRoutineInfoWithOverloads
sealed class PhpRoutineInfoWithOverloads : PhpRoutineInfo
{
readonly RuntimeMethodHandle[] _overloads;
public PhpRoutineInfoWithOverloads(string name, RuntimeMethodHandle handle, RuntimeMethodHandle[] overloads)
: base(name, handle)
{
_overloads = overloads ?? throw new ArgumentNullException(nameof(overloads));
}
public override MethodInfo[] Methods
{
get
{
var overloads = _overloads;
// [Method] + Overloads
var methods = new MethodInfo[1 + overloads.Length];
methods[0] = (MethodInfo)MethodBase.GetMethodFromHandle(Handle);
for (int i = 0; i < overloads.Length; i++)
{
methods[1 + i] = (MethodInfo)MethodBase.GetMethodFromHandle(overloads[i]);
}
//
return methods;
}
}
}
#endregion
}
/// <summary>Represents anonymous function with special <see cref="Closure"/> parameter.</summary>
internal sealed class PhpAnonymousRoutineInfo : PhpRoutineInfo
{
public PhpAnonymousRoutineInfo(string name, RuntimeMethodHandle handle)
: base(name, handle)
{
}
}
internal class DelegateRoutineInfo : RoutineInfo
{
Delegate _delegate;
PhpInvokable _lazyInvokable;
/// <summary>
/// Cache of already bound methods,
/// avoids unnecessary allocations and dynamic code emittion.
/// </summary>
static readonly Dictionary<MethodInfo, PhpInvokable> s_bound = new Dictionary<MethodInfo, PhpInvokable>();
public override MethodInfo[] Methods => new[] { _delegate.GetMethodInfo() };
public override PhpTypeInfo DeclaringType => null;
internal override object Target => _delegate.Target;
public override int GetHashCode() => _delegate.GetHashCode();
internal PhpInvokable PhpInvokable => _lazyInvokable ?? BindDelegate();
PhpInvokable BindDelegate()
{
var method = _delegate.GetMethodInfo();
if (!s_bound.TryGetValue(method, out _lazyInvokable)) // TODO: RW lock
{
lock (s_bound)
{
s_bound[method] = _lazyInvokable = Dynamic.BinderHelpers.BindToPhpInvokable(new[] { method });
}
}
//
return _lazyInvokable;
}
public override PhpCallable PhpCallable => (ctx, args) => Invoke(ctx, Target, args);
public override PhpValue Invoke(Context ctx, object target, params PhpValue[] arguments) => PhpInvokable(ctx, target, arguments);
public DelegateRoutineInfo(string name, Delegate @delegate)
: base(0, name)
{
_delegate = @delegate ?? throw new ArgumentNullException(nameof(@delegate));
}
}
internal class ClrRoutineInfo : RoutineInfo
{
PhpCallable _lazyDelegate;
MethodInfo[] _methods;
public override MethodInfo[] Methods => _methods;
public override PhpTypeInfo DeclaringType => null;
public override PhpCallable PhpCallable => _lazyDelegate ?? BindDelegate();
PhpCallable BindDelegate()
{
return _lazyDelegate = Dynamic.BinderHelpers.BindToPhpCallable(Methods);
}
public ClrRoutineInfo(int index, string name, MethodInfo method)
: base(index, name)
{
_methods = new MethodInfo[] { method };
}
internal void AddOverload(MethodInfo method)
{
if (Array.IndexOf(_methods, method) < 0)
{
Array.Resize(ref _methods, _methods.Length + 1);
_methods[_methods.Length - 1] = method;
//
_lazyDelegate = null;
}
}
}
/// <summary>
/// PHP routine representing class methods.
/// </summary>
internal class PhpMethodInfo : RoutineInfo
{
#region PhpMethodInfoWithBoundType
sealed class PhpMethodInfoWithBoundType : PhpMethodInfo
{
public override PhpTypeInfo LateStaticType => _lateStaticType;
readonly PhpTypeInfo _lateStaticType;
public PhpMethodInfoWithBoundType(int index, string name, MethodInfo[] methods, PhpTypeInfo lateStaticType)
: base(index, name, methods)
{
Debug.Assert(lateStaticType != null);
_lateStaticType = lateStaticType;
}
}
#endregion
/// <summary>
/// Creates instance of <see cref="PhpMethodInfo"/>.
/// </summary>
public static PhpMethodInfo Create(int index, string name, MethodInfo[] methods, PhpTypeInfo callertype = null)
{
if (callertype != null)
{
if (callertype.Type.IsClass && methods.Any(Dynamic.BinderHelpers.HasLateStaticParameter))
{
// if method requires late static bound type, remember it:
return new PhpMethodInfoWithBoundType(index, name, methods, lateStaticType: callertype);
}
// reuse PhpMethodInfo from base type if possible
if (AllDeclaredInBase(methods, callertype.Type) &&
callertype.BaseType != null &&
callertype.BaseType.RuntimeMethods[name] is PhpMethodInfo frombase)
{
return frombase;
}
}
return new PhpMethodInfo(index, name, methods);
}
static bool AllDeclaredInBase(MethodInfo[] methods, Type callertype)
{
for (int i = 0; i < methods.Length; i++)
{
if (methods[i].DeclaringType == callertype) return false;
}
return true;
}
PhpInvokable _lazyDelegate;
/// <summary>
/// Array of CLR methods. Cannot be <c>null</c> or empty.
/// </summary>
public override MethodInfo[] Methods => _methods;
readonly MethodInfo[] _methods;
public override PhpTypeInfo DeclaringType => _methods[0].DeclaringType.GetPhpTypeInfo();
/// <summary>Optional. Bound static type.</summary>
public virtual PhpTypeInfo LateStaticType => null;
protected PhpMethodInfo(int index, string name, MethodInfo[] methods)
: base(index, name)
{
_methods = methods;
}
internal PhpInvokable PhpInvokable => _lazyDelegate ?? BindDelegate();
PhpInvokable BindDelegate()
{
return _lazyDelegate = Dynamic.BinderHelpers.BindToPhpInvokable(_methods, LateStaticType);
}
public override PhpCallable PhpCallable
{
get
{
Debug.Assert(_methods.All(TypeMembersUtils.IsStatic));
return (ctx, args) => Invoke(ctx, null, args);
}
}
public override PhpValue Invoke(Context ctx, object target, params PhpValue[] arguments) => PhpInvokable(ctx, target, arguments);
}
}
| 34.967033 | 183 | 0.596245 | [
"Apache-2.0"
] | JiaFeiX/peachpie | src/Peachpie.Runtime/Reflection/PhpRoutineInfo.cs | 12,730 | C# |
ο»Ώusing UnityEngine;
using System.Collections;
public class FT_LineHitPoint : MonoBehaviour {
public bool freezeHeightPosition = true;
public float heightValue = 1.5f;
public Transform target;
void Update () {
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast (ray, out hit, 500f)) {
if (freezeHeightPosition == false) {
transform.position = new Vector3 (hit.point.x, hit.point.y, hit.point.z);
transform.LookAt (target.transform);
} else {
transform.position = new Vector3 (hit.point.x, heightValue, hit.point.z);
transform.LookAt (target.transform);
}
}
}
}
| 27 | 77 | 0.709877 | [
"Unlicense"
] | Avatarchik/rail-hunter | Assets/Packages/FT_Infinity_lite/Scripts/FT_LineHitPoint.cs | 650 | C# |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Http;
using Microsoft.IdentityModel.Protocols.OpenIdConnect;
namespace Microsoft.AspNetCore.Authentication.OpenIdConnect
{
/// <summary>
/// A context for <see cref="OpenIdConnectEvents.RemoteSignOut(RemoteSignOutContext)"/> event.
/// </summary>
public class RemoteSignOutContext : RemoteAuthenticationContext<OpenIdConnectOptions>
{
/// <summary>
/// Initializes a new instance of <see cref="RemoteSignOutContext"/>.
/// </summary>
/// <inheritdoc />
public RemoteSignOutContext(HttpContext context, AuthenticationScheme scheme, OpenIdConnectOptions options, OpenIdConnectMessage? message)
: base(context, scheme, options, new AuthenticationProperties())
=> ProtocolMessage = message;
/// <summary>
/// Gets or sets the <see cref="OpenIdConnectMessage"/>.
/// </summary>
public OpenIdConnectMessage? ProtocolMessage { get; set; }
}
}
| 41.178571 | 146 | 0.694709 | [
"Apache-2.0"
] | 1175169074/aspnetcore | src/Security/Authentication/OpenIdConnect/src/Events/RemoteSignoutContext.cs | 1,153 | C# |
ο»Ώusing System.Collections.Generic;
using AllReady.Areas.Admin.ViewModels.Campaign;
using MediatR;
namespace AllReady.Areas.Admin.Features.Campaigns
{
public class IndexQuery : IAsyncRequest<IEnumerable<IndexViewModel>>
{
public int? OrganizationId { get; set; }
}
} | 26 | 72 | 0.748252 | [
"MIT"
] | 7as8ydh/allReady | AllReadyApp/Web-App/AllReady/Areas/Admin/Features/Campaigns/IndexQuery.cs | 288 | C# |
ο»Ώnamespace _02._Command.Interfaces
{
public interface IExecutor
{
void ExecuteCommand(ICommand command);
}
} | 18.285714 | 46 | 0.679688 | [
"MIT"
] | thelad43/CSharp-OOP-Advanced-SoftUni | 11. Object Communication and Events - Lab/02. Command/Interfaces/IExecutor.cs | 130 | C# |
ο»Ώusing System.Linq;
using UAlbion.Core;
using UAlbion.Core.Events;
using UAlbion.Formats.Config;
using UAlbion.Game.Events;
using UAlbion.Game.Gui;
using Veldrid;
namespace UAlbion.Game.Input
{
public class ExclusiveMouseMode : Component
{
static readonly HandlerSet Handlers = new HandlerSet(
H<ExclusiveMouseMode, InputEvent>((x, e) => x.OnInput(e)),
H<ExclusiveMouseMode, UiSelectedEvent>((x,e) => x.OnSelect(e)),
H<ExclusiveMouseMode, SetExclusiveMouseModeEvent>((x, e) => x._exclusiveItem = e.ExclusiveElement)
);
public ExclusiveMouseMode() : base(Handlers) { }
void OnSelect(UiSelectedEvent e)
{
IUiEvent newEvent = new UiHoverEvent();
foreach (var element in e.FocusedItems.Where(x => x == _exclusiveItem))
element.Receive(newEvent, this);
newEvent = new UiBlurEvent();
foreach (var element in e.BlurredItems.Where(x => x == _exclusiveItem))
element.Receive(newEvent, this);
}
IUiElement _exclusiveItem;
void OnInput(InputEvent e)
{
Raise(new ScreenCoordinateSelectEvent(e.Snapshot.MousePosition, (t, selection) => {}));
if (e.Snapshot.MouseEvents.Any(x => x.MouseButton == MouseButton.Left && !x.Down))
{
Raise(new UiLeftReleaseEvent());
Raise(new SetMouseModeEvent(MouseMode.Normal));
}
if (e.Snapshot.MouseEvents.Any(x => x.MouseButton == MouseButton.Right && !x.Down))
{
Raise(new UiRightReleaseEvent());
Raise(new SetMouseModeEvent(MouseMode.Normal));
}
}
}
} | 34.039216 | 110 | 0.60023 | [
"MIT"
] | mrwillbarnz/ualbion | Game/Input/ExclusiveMouseMode.cs | 1,738 | 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.Runtime.CompilerServices;
using System.Diagnostics.Tracing;
using Internal.Runtime.CompilerServices;
namespace System.Threading.Tasks
{
/// <summary>Provides an event source for tracing TPL information.</summary>
[EventSource(
Name = "System.Threading.Tasks.TplEventSource",
Guid = "2e5dba47-a3d2-4d16-8ee0-6671ffdcd7b5",
LocalizationResources =
#if CORECLR
"System.Private.CoreLib.Strings"
#else
null
#endif
)]
internal sealed class TplEventSource : EventSource
{
/// Used to determine if tasks should generate Activity IDs for themselves
internal bool TasksSetActivityIds; // This keyword is set
internal bool Debug;
private bool DebugActivityId;
private const int DefaultAppDomainID = 1;
/// <summary>
/// Get callbacks when the ETW sends us commands`
/// </summary>
protected override void OnEventCommand(EventCommandEventArgs command)
{
// To get the AsyncCausality events, we need to inform the AsyncCausalityTracer
if (command.Command == EventCommand.Enable)
AsyncCausalityTracer.EnableToETW(true);
else if (command.Command == EventCommand.Disable)
AsyncCausalityTracer.EnableToETW(false);
if (IsEnabled(EventLevel.Informational, Keywords.TasksFlowActivityIds))
ActivityTracker.Instance.Enable();
else
TasksSetActivityIds = IsEnabled(EventLevel.Informational, Keywords.TasksSetActivityIds);
Debug = IsEnabled(EventLevel.Informational, Keywords.Debug);
DebugActivityId = IsEnabled(EventLevel.Informational, Keywords.DebugActivityId);
}
/// <summary>
/// Defines the singleton instance for the TPL ETW provider.
/// The TPL Event provider GUID is {2e5dba47-a3d2-4d16-8ee0-6671ffdcd7b5}.
/// </summary>
public static readonly TplEventSource Log = new TplEventSource();
/// <summary>Prevent external instantiation. All logging should go through the Log instance.</summary>
private TplEventSource() : base(new Guid(0x2e5dba47, 0xa3d2, 0x4d16, 0x8e, 0xe0, 0x66, 0x71, 0xff, 0xdc, 0xd7, 0xb5), "System.Threading.Tasks.TplEventSource") { }
/// <summary>Configured behavior of a task wait operation.</summary>
public enum TaskWaitBehavior : int
{
/// <summary>A synchronous wait.</summary>
Synchronous = 1,
/// <summary>An asynchronous await.</summary>
Asynchronous = 2
}
/// <summary>ETW tasks that have start/stop events.</summary>
public static class Tasks // this name is important for EventSource
{
/// <summary>A parallel loop.</summary>
public const EventTask Loop = (EventTask)1;
/// <summary>A parallel invoke.</summary>
public const EventTask Invoke = (EventTask)2;
/// <summary>Executing a Task.</summary>
public const EventTask TaskExecute = (EventTask)3;
/// <summary>Waiting on a Task.</summary>
public const EventTask TaskWait = (EventTask)4;
/// <summary>A fork/join task within a loop or invoke.</summary>
public const EventTask ForkJoin = (EventTask)5;
/// <summary>A task is scheduled to execute.</summary>
public const EventTask TaskScheduled = (EventTask)6;
/// <summary>An await task continuation is scheduled to execute.</summary>
public const EventTask AwaitTaskContinuationScheduled = (EventTask)7;
/// <summary>AsyncCausalityFunctionality.</summary>
public const EventTask TraceOperation = (EventTask)8;
public const EventTask TraceSynchronousWork = (EventTask)9;
}
public static class Keywords // this name is important for EventSource
{
/// <summary>
/// Only the most basic information about the workings of the task library
/// This sets activity IDS and logs when tasks are schedules (or waits begin)
/// But are otherwise silent
/// </summary>
public const EventKeywords TaskTransfer = (EventKeywords)1;
/// <summary>
/// TaskTranser events plus events when tasks start and stop
/// </summary>
public const EventKeywords Tasks = (EventKeywords)2;
/// <summary>
/// Events associted with the higher level parallel APIs
/// </summary>
public const EventKeywords Parallel = (EventKeywords)4;
/// <summary>
/// These are relatively verbose events that effectively just redirect
/// the windows AsyncCausalityTracer to ETW
/// </summary>
public const EventKeywords AsyncCausalityOperation = (EventKeywords)8;
public const EventKeywords AsyncCausalityRelation = (EventKeywords)0x10;
public const EventKeywords AsyncCausalitySynchronousWork = (EventKeywords)0x20;
/// <summary>
/// Emit the stops as well as the schedule/start events
/// </summary>
public const EventKeywords TaskStops = (EventKeywords)0x40;
/// <summary>
/// TasksFlowActivityIds indicate that activity ID flow from one task
/// to any task created by it.
/// </summary>
public const EventKeywords TasksFlowActivityIds = (EventKeywords)0x80;
/// <summary>
/// Events related to the happenings of async methods.
/// </summary>
public const EventKeywords AsyncMethod = (EventKeywords)0x100;
/// <summary>
/// TasksSetActivityIds will cause the task operations to set Activity Ids
/// This option is incompatible with TasksFlowActivityIds flow is ignored
/// if that keyword is set. This option is likely to be removed in the future
/// </summary>
public const EventKeywords TasksSetActivityIds = (EventKeywords)0x10000;
/// <summary>
/// Relatively Verbose logging meant for debugging the Task library itself. Will probably be removed in the future
/// </summary>
public const EventKeywords Debug = (EventKeywords)0x20000;
/// <summary>
/// Relatively Verbose logging meant for debugging the Task library itself. Will probably be removed in the future
/// </summary>
public const EventKeywords DebugActivityId = (EventKeywords)0x40000;
}
//-----------------------------------------------------------------------------------
//
// TPL Event IDs (must be unique)
//
/// <summary>A task is scheduled to a task scheduler.</summary>
private const int TASKSCHEDULED_ID = 7;
/// <summary>A task is about to execute.</summary>
private const int TASKSTARTED_ID = 8;
/// <summary>A task has finished executing.</summary>
private const int TASKCOMPLETED_ID = 9;
/// <summary>A wait on a task is beginning.</summary>
private const int TASKWAITBEGIN_ID = 10;
/// <summary>A wait on a task is ending.</summary>
private const int TASKWAITEND_ID = 11;
/// <summary>A continuation of a task is scheduled.</summary>
private const int AWAITTASKCONTINUATIONSCHEDULED_ID = 12;
/// <summary>A continuation of a taskWaitEnd is complete </summary>
private const int TASKWAITCONTINUATIONCOMPLETE_ID = 13;
/// <summary>A continuation of a taskWaitEnd is complete </summary>
private const int TASKWAITCONTINUATIONSTARTED_ID = 19;
private const int TRACEOPERATIONSTART_ID = 14;
private const int TRACEOPERATIONSTOP_ID = 15;
private const int TRACEOPERATIONRELATION_ID = 16;
private const int TRACESYNCHRONOUSWORKSTART_ID = 17;
private const int TRACESYNCHRONOUSWORKSTOP_ID = 18;
//-----------------------------------------------------------------------------------
//
// Task Events
//
// These are all verbose events, so we need to call IsEnabled(EventLevel.Verbose, ALL_KEYWORDS)
// call. However since the IsEnabled(l,k) call is more expensive than IsEnabled(), we only want
// to incur this cost when instrumentation is enabled. So the Task codepaths that call these
// event functions still do the check for IsEnabled()
#region TaskScheduled
/// <summary>
/// Fired when a task is queued to a TaskScheduler.
/// </summary>
/// <param name="OriginatingTaskSchedulerID">The scheduler ID.</param>
/// <param name="OriginatingTaskID">The task ID.</param>
/// <param name="TaskID">The task ID.</param>
/// <param name="CreatingTaskID">The task ID</param>
/// <param name="TaskCreationOptions">The options used to create the task.</param>
/// <param name="appDomain">The ID for the current AppDomain.</param>
[Event(TASKSCHEDULED_ID, Task = Tasks.TaskScheduled, Version = 1, Opcode = EventOpcode.Send,
Level = EventLevel.Informational, Keywords = Keywords.TaskTransfer | Keywords.Tasks)]
public void TaskScheduled(
int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER
int TaskID, int CreatingTaskID, int TaskCreationOptions, int appDomain = DefaultAppDomainID)
{
// IsEnabled() call is an inlined quick check that makes this very fast when provider is off
if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.TaskTransfer | Keywords.Tasks))
{
unsafe
{
EventData* eventPayload = stackalloc EventData[6];
eventPayload[0].Size = sizeof(int);
eventPayload[0].DataPointer = ((IntPtr)(&OriginatingTaskSchedulerID));
eventPayload[0].Reserved = 0;
eventPayload[1].Size = sizeof(int);
eventPayload[1].DataPointer = ((IntPtr)(&OriginatingTaskID));
eventPayload[1].Reserved = 0;
eventPayload[2].Size = sizeof(int);
eventPayload[2].DataPointer = ((IntPtr)(&TaskID));
eventPayload[2].Reserved = 0;
eventPayload[3].Size = sizeof(int);
eventPayload[3].DataPointer = ((IntPtr)(&CreatingTaskID));
eventPayload[3].Reserved = 0;
eventPayload[4].Size = sizeof(int);
eventPayload[4].DataPointer = ((IntPtr)(&TaskCreationOptions));
eventPayload[4].Reserved = 0;
eventPayload[5].Size = sizeof(int);
eventPayload[5].DataPointer = ((IntPtr)(&appDomain));
eventPayload[5].Reserved = 0;
if (TasksSetActivityIds)
{
Guid childActivityId = CreateGuidForTaskID(TaskID);
WriteEventWithRelatedActivityIdCore(TASKSCHEDULED_ID, &childActivityId, 6, eventPayload);
}
else
WriteEventCore(TASKSCHEDULED_ID, 6, eventPayload);
}
}
}
#endregion
#region TaskStarted
/// <summary>
/// Fired just before a task actually starts executing.
/// </summary>
/// <param name="OriginatingTaskSchedulerID">The scheduler ID.</param>
/// <param name="OriginatingTaskID">The task ID.</param>
/// <param name="TaskID">The task ID.</param>
[Event(TASKSTARTED_ID,
Level = EventLevel.Informational, Keywords = Keywords.Tasks)]
public void TaskStarted(
int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER
int TaskID)
{
if (IsEnabled(EventLevel.Informational, Keywords.Tasks))
WriteEvent(TASKSTARTED_ID, OriginatingTaskSchedulerID, OriginatingTaskID, TaskID);
}
#endregion
#region TaskCompleted
/// <summary>
/// Fired right after a task finished executing.
/// </summary>
/// <param name="OriginatingTaskSchedulerID">The scheduler ID.</param>
/// <param name="OriginatingTaskID">The task ID.</param>
/// <param name="TaskID">The task ID.</param>
/// <param name="IsExceptional">Whether the task completed due to an error.</param>
[Event(TASKCOMPLETED_ID, Version = 1,
Level = EventLevel.Informational, Keywords = Keywords.TaskStops)]
public void TaskCompleted(
int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER
int TaskID, bool IsExceptional)
{
if (IsEnabled(EventLevel.Informational, Keywords.Tasks))
{
unsafe
{
EventData* eventPayload = stackalloc EventData[4];
int isExceptionalInt = IsExceptional ? 1 : 0;
eventPayload[0].Size = sizeof(int);
eventPayload[0].DataPointer = ((IntPtr)(&OriginatingTaskSchedulerID));
eventPayload[0].Reserved = 0;
eventPayload[1].Size = sizeof(int);
eventPayload[1].DataPointer = ((IntPtr)(&OriginatingTaskID));
eventPayload[1].Reserved = 0;
eventPayload[2].Size = sizeof(int);
eventPayload[2].DataPointer = ((IntPtr)(&TaskID));
eventPayload[2].Reserved = 0;
eventPayload[3].Size = sizeof(int);
eventPayload[3].DataPointer = ((IntPtr)(&isExceptionalInt));
eventPayload[3].Reserved = 0;
WriteEventCore(TASKCOMPLETED_ID, 4, eventPayload);
}
}
}
#endregion
#region TaskWaitBegin
/// <summary>
/// Fired when starting to wait for a taks's completion explicitly or implicitly.
/// </summary>
/// <param name="OriginatingTaskSchedulerID">The scheduler ID.</param>
/// <param name="OriginatingTaskID">The task ID.</param>
/// <param name="TaskID">The task ID.</param>
/// <param name="Behavior">Configured behavior for the wait.</param>
/// <param name="ContinueWithTaskID">
/// If known, if 'TaskID' has a 'continueWith' task, mention give its ID here.
/// 0 means unknown. This allows better visualization of the common sequential chaining case.
/// </param>
[Event(TASKWAITBEGIN_ID, Version = 3, Task = TplEventSource.Tasks.TaskWait, Opcode = EventOpcode.Send,
Level = EventLevel.Informational, Keywords = Keywords.TaskTransfer | Keywords.Tasks)]
public void TaskWaitBegin(
int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER
int TaskID, TaskWaitBehavior Behavior, int ContinueWithTaskID)
{
if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.TaskTransfer | Keywords.Tasks))
{
unsafe
{
EventData* eventPayload = stackalloc EventData[5];
eventPayload[0].Size = sizeof(int);
eventPayload[0].DataPointer = ((IntPtr)(&OriginatingTaskSchedulerID));
eventPayload[0].Reserved = 0;
eventPayload[1].Size = sizeof(int);
eventPayload[1].DataPointer = ((IntPtr)(&OriginatingTaskID));
eventPayload[1].Reserved = 0;
eventPayload[2].Size = sizeof(int);
eventPayload[2].DataPointer = ((IntPtr)(&TaskID));
eventPayload[2].Reserved = 0;
eventPayload[3].Size = sizeof(int);
eventPayload[3].DataPointer = ((IntPtr)(&Behavior));
eventPayload[3].Reserved = 0;
eventPayload[4].Size = sizeof(int);
eventPayload[4].DataPointer = ((IntPtr)(&ContinueWithTaskID));
eventPayload[4].Reserved = 0;
if (TasksSetActivityIds)
{
Guid childActivityId = CreateGuidForTaskID(TaskID);
WriteEventWithRelatedActivityIdCore(TASKWAITBEGIN_ID, &childActivityId, 5, eventPayload);
}
else
{
WriteEventCore(TASKWAITBEGIN_ID, 5, eventPayload);
}
}
}
}
#endregion
/// <summary>
/// Fired when the wait for a tasks completion returns.
/// </summary>
/// <param name="OriginatingTaskSchedulerID">The scheduler ID.</param>
/// <param name="OriginatingTaskID">The task ID.</param>
/// <param name="TaskID">The task ID.</param>
[Event(TASKWAITEND_ID,
Level = EventLevel.Verbose, Keywords = Keywords.Tasks)]
public void TaskWaitEnd(
int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER
int TaskID)
{
// Log an event if indicated.
if (IsEnabled() && IsEnabled(EventLevel.Verbose, Keywords.Tasks))
WriteEvent(TASKWAITEND_ID, OriginatingTaskSchedulerID, OriginatingTaskID, TaskID);
}
/// <summary>
/// Fired when the work (method) associated with a TaskWaitEnd completes
/// </summary>
/// <param name="TaskID">The task ID.</param>
[Event(TASKWAITCONTINUATIONCOMPLETE_ID,
Level = EventLevel.Verbose, Keywords = Keywords.TaskStops)]
public void TaskWaitContinuationComplete(int TaskID)
{
// Log an event if indicated.
if (IsEnabled() && IsEnabled(EventLevel.Verbose, Keywords.Tasks))
WriteEvent(TASKWAITCONTINUATIONCOMPLETE_ID, TaskID);
}
/// <summary>
/// Fired when the work (method) associated with a TaskWaitEnd completes
/// </summary>
/// <param name="TaskID">The task ID.</param>
[Event(TASKWAITCONTINUATIONSTARTED_ID,
Level = EventLevel.Verbose, Keywords = Keywords.TaskStops)]
public void TaskWaitContinuationStarted(int TaskID)
{
// Log an event if indicated.
if (IsEnabled() && IsEnabled(EventLevel.Verbose, Keywords.Tasks))
WriteEvent(TASKWAITCONTINUATIONSTARTED_ID, TaskID);
}
/// <summary>
/// Fired when the an asynchronous continuation for a task is scheduled
/// </summary>
/// <param name="OriginatingTaskSchedulerID">The scheduler ID.</param>
/// <param name="OriginatingTaskID">The task ID.</param>
/// <param name="ContinueWithTaskId">The ID of the continuation object.</param>
[Event(AWAITTASKCONTINUATIONSCHEDULED_ID, Task = Tasks.AwaitTaskContinuationScheduled, Opcode = EventOpcode.Send,
Level = EventLevel.Informational, Keywords = Keywords.TaskTransfer | Keywords.Tasks)]
public void AwaitTaskContinuationScheduled(
int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER
int ContinueWithTaskId)
{
if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.TaskTransfer | Keywords.Tasks))
{
unsafe
{
EventData* eventPayload = stackalloc EventData[3];
eventPayload[0].Size = sizeof(int);
eventPayload[0].DataPointer = ((IntPtr)(&OriginatingTaskSchedulerID));
eventPayload[0].Reserved = 0;
eventPayload[1].Size = sizeof(int);
eventPayload[1].DataPointer = ((IntPtr)(&OriginatingTaskID));
eventPayload[1].Reserved = 0;
eventPayload[2].Size = sizeof(int);
eventPayload[2].DataPointer = ((IntPtr)(&ContinueWithTaskId));
eventPayload[2].Reserved = 0;
if (TasksSetActivityIds)
{
Guid continuationActivityId = CreateGuidForTaskID(ContinueWithTaskId);
WriteEventWithRelatedActivityIdCore(AWAITTASKCONTINUATIONSCHEDULED_ID, &continuationActivityId, 3, eventPayload);
}
else
WriteEventCore(AWAITTASKCONTINUATIONSCHEDULED_ID, 3, eventPayload);
}
}
}
[Event(TRACEOPERATIONSTART_ID, Version = 1,
Level = EventLevel.Informational, Keywords = Keywords.AsyncCausalityOperation)]
public void TraceOperationBegin(int TaskID, string OperationName, long RelatedContext)
{
if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.AsyncCausalityOperation))
{
unsafe
{
fixed (char* operationNamePtr = OperationName)
{
EventData* eventPayload = stackalloc EventData[3];
eventPayload[0].Size = sizeof(int);
eventPayload[0].DataPointer = ((IntPtr)(&TaskID));
eventPayload[0].Reserved = 0;
eventPayload[1].Size = ((OperationName.Length + 1) * 2);
eventPayload[1].DataPointer = ((IntPtr)operationNamePtr);
eventPayload[1].Reserved = 0;
eventPayload[2].Size = sizeof(long);
eventPayload[2].DataPointer = ((IntPtr)(&RelatedContext));
eventPayload[2].Reserved = 0;
WriteEventCore(TRACEOPERATIONSTART_ID, 3, eventPayload);
}
}
}
}
[Event(TRACEOPERATIONRELATION_ID, Version = 1,
Level = EventLevel.Informational, Keywords = Keywords.AsyncCausalityRelation)]
public void TraceOperationRelation(int TaskID, CausalityRelation Relation)
{
if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.AsyncCausalityRelation))
WriteEvent(TRACEOPERATIONRELATION_ID, TaskID, (int)Relation); // optimized overload for this exists
}
[Event(TRACEOPERATIONSTOP_ID, Version = 1,
Level = EventLevel.Informational, Keywords = Keywords.AsyncCausalityOperation)]
public void TraceOperationEnd(int TaskID, AsyncCausalityStatus Status)
{
if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.AsyncCausalityOperation))
WriteEvent(TRACEOPERATIONSTOP_ID, TaskID, (int)Status); // optimized overload for this exists
}
[Event(TRACESYNCHRONOUSWORKSTART_ID, Version = 1,
Level = EventLevel.Informational, Keywords = Keywords.AsyncCausalitySynchronousWork)]
public void TraceSynchronousWorkBegin(int TaskID, CausalitySynchronousWork Work)
{
if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.AsyncCausalitySynchronousWork))
WriteEvent(TRACESYNCHRONOUSWORKSTART_ID, TaskID, (int)Work); // optimized overload for this exists
}
[Event(TRACESYNCHRONOUSWORKSTOP_ID, Version = 1,
Level = EventLevel.Informational, Keywords = Keywords.AsyncCausalitySynchronousWork)]
public void TraceSynchronousWorkEnd(CausalitySynchronousWork Work)
{
if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.AsyncCausalitySynchronousWork))
{
unsafe
{
EventData* eventPayload = stackalloc EventData[1];
eventPayload[0].Size = sizeof(int);
eventPayload[0].DataPointer = ((IntPtr)(&Work));
eventPayload[0].Reserved = 0;
WriteEventCore(TRACESYNCHRONOUSWORKSTOP_ID, 1, eventPayload);
}
}
}
[NonEvent]
public unsafe void RunningContinuation(int TaskID, object Object) { RunningContinuation(TaskID, (long)*((void**)Unsafe.AsPointer(ref Object))); }
[Event(20, Keywords = Keywords.Debug)]
private void RunningContinuation(int TaskID, long Object)
{
if (Debug)
WriteEvent(20, TaskID, Object);
}
[NonEvent]
public unsafe void RunningContinuationList(int TaskID, int Index, object Object) { RunningContinuationList(TaskID, Index, (long)*((void**)Unsafe.AsPointer(ref Object))); }
[Event(21, Keywords = Keywords.Debug)]
public void RunningContinuationList(int TaskID, int Index, long Object)
{
if (Debug)
WriteEvent(21, TaskID, Index, Object);
}
[Event(23, Keywords = Keywords.Debug)]
public void DebugFacilityMessage(string Facility, string Message) { WriteEvent(23, Facility, Message); }
[Event(24, Keywords = Keywords.Debug)]
public void DebugFacilityMessage1(string Facility, string Message, string Value1) { WriteEvent(24, Facility, Message, Value1); }
[Event(25, Keywords = Keywords.DebugActivityId)]
public void SetActivityId(Guid NewId)
{
if (DebugActivityId)
WriteEvent(25, NewId);
}
[Event(26, Keywords = Keywords.Debug)]
public void NewID(int TaskID)
{
if (Debug)
WriteEvent(26, TaskID);
}
[NonEvent]
public void IncompleteAsyncMethod(IAsyncStateMachineBox stateMachineBox)
{
System.Diagnostics.Debug.Assert(stateMachineBox != null);
if (IsEnabled(EventLevel.Warning, Keywords.AsyncMethod))
{
IAsyncStateMachine stateMachine = stateMachineBox.GetStateMachineObject();
if (stateMachine != null)
{
string description = AsyncMethodBuilderCore.GetAsyncStateMachineDescription(stateMachine);
IncompleteAsyncMethod(description);
}
}
}
[Event(27, Level = EventLevel.Warning, Keywords = Keywords.AsyncMethod)]
private void IncompleteAsyncMethod(string stateMachineDescription) =>
WriteEvent(27, stateMachineDescription);
/// <summary>
/// Activity IDs are GUIDS but task IDS are integers (and are not unique across appdomains
/// This routine creates a process wide unique GUID given a task ID
/// </summary>
internal static Guid CreateGuidForTaskID(int taskID)
{
// The thread pool generated a process wide unique GUID from a task GUID by
// using the taskGuid, the appdomain ID, and 8 bytes of 'randomization' chosen by
// using the last 8 bytes as the provider GUID for this provider.
// These were generated by CreateGuid, and are reasonably random (and thus unlikely to collide
uint pid = EventSource.s_currentPid;
return new Guid(taskID,
(short)DefaultAppDomainID, (short)(DefaultAppDomainID >> 16),
(byte)pid, (byte)(pid >> 8), (byte)(pid >> 16), (byte)(pid >> 24),
0xff, 0xdc, 0xd7, 0xb5);
}
}
}
| 48.917976 | 179 | 0.592009 | [
"MIT"
] | AntonLapounov/corert | src/System.Private.CoreLib/shared/System/Threading/Tasks/TplEventSource.cs | 28,030 | C# |
ο»Ώnamespace Xilium.CefGlue
{
using System;
using System.Collections.Generic;
using System.Text;
public sealed class CefVersionMismatchException : CefRuntimeException
{
public CefVersionMismatchException(string message)
: base(message)
{
}
}
}
| 20.2 | 73 | 0.650165 | [
"MIT"
] | 00aj99/Chromely | src/CefGlue/Chromely.Unofficial.CefGlue.NetStd/Exceptions/CefVersionMismatchException.cs | 305 | C# |
// NVNC - .NET VNC Server Library
// Copyright (C) 2014 T!T@N
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using System.Drawing;
using NVNC.Utils;
namespace NVNC.Encodings
{
/// <summary>
/// Implementation of Raw encoding.
/// </summary>
public sealed class RawRectangle : EncodedRectangle
{
private int[] pixels;
public RawRectangle(VncHost rfb, Framebuffer framebuffer, int[] pixels, Rectangle rectangle)
: base(rfb, framebuffer, rectangle)
{
this.pixels = pixels;
}
public override void Encode()
{
/*
bytes = PixelGrabber.GrabPixels(bmp, PixelFormat.Format32bppArgb);
for (int i = 0; i < pixels.Length; i++)
framebuffer[i] = pixels[i];
*/
if(bytes == null)
{
//bytes = PixelGrabber.GrabPixels(pixels, new Rectangle(0, 0, rectangle.Width, rectangle.Height), framebuffer);
bytes = PixelGrabber.GrabPixels(pixels, rectangle, framebuffer);
}
}
public override void WriteData()
{
base.WriteData();
rfb.WriteUInt32(Convert.ToUInt32(VncHost.Encoding.RawEncoding));
rfb.Write(bytes);
/* Very slow, not practically usable
for (int i = 0; i < framebuffer.pixels.Length; i++)
pwriter.WritePixel(framebuffer[i]);
*/
}
}
}
| 34.333333 | 127 | 0.617198 | [
"BSD-3-Clause"
] | 0xe7/Empire | empire/server/csharp/Covenant/Data/ReferenceSourceLibraries/NVNC/Encodings/RawRectangle.cs | 2,163 | 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 waf-2015-08-24.normal.json service model.
*/
using System;
using System.Collections.Generic;
using Amazon.Runtime;
using Amazon.WAF.Model;
namespace Amazon.WAF
{
/// <summary>
/// Interface for accessing WAF
///
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// This is the <i>AWS WAF Classic API Reference</i> for using AWS WAF Classic with Amazon
/// CloudFront. The AWS WAF Classic actions and data types listed in the reference are
/// available for protecting Amazon CloudFront distributions. You can use these actions
/// and data types via the endpoint <i>waf.amazonaws.com</i>. This guide is for developers
/// who need detailed information about the AWS WAF Classic API actions, data types, and
/// errors. For detailed information about AWS WAF Classic features and an overview of
/// how to use the AWS WAF Classic API, see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
/// </summary>
public partial interface IAmazonWAF : IAmazonService, IDisposable
{
#region CreateByteMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates a <code>ByteMatchSet</code>. You then use <a>UpdateByteMatchSet</a> to identify
/// the part of a web request that you want AWS WAF to inspect, such as the values of
/// the <code>User-Agent</code> header or the query string. For example, you can create
/// a <code>ByteMatchSet</code> that matches any requests with <code>User-Agent</code>
/// headers that contain the string <code>BadBot</code>. You can then configure AWS WAF
/// to reject those requests.
/// </para>
///
/// <para>
/// To create and configure a <code>ByteMatchSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateByteMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateByteMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <code>UpdateByteMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <a>UpdateByteMatchSet</a> request to specify the part of the request that
/// you want AWS WAF to inspect (for example, the header or the URI) and the value that
/// you want AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="name">A friendly name or description of the <a>ByteMatchSet</a>. You can't change <code>Name</code> after you create a <code>ByteMatchSet</code>.</param>
/// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
///
/// <returns>The response from the CreateByteMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateByteMatchSet">REST API Reference for CreateByteMatchSet Operation</seealso>
CreateByteMatchSetResponse CreateByteMatchSet(string name, string changeToken);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates a <code>ByteMatchSet</code>. You then use <a>UpdateByteMatchSet</a> to identify
/// the part of a web request that you want AWS WAF to inspect, such as the values of
/// the <code>User-Agent</code> header or the query string. For example, you can create
/// a <code>ByteMatchSet</code> that matches any requests with <code>User-Agent</code>
/// headers that contain the string <code>BadBot</code>. You can then configure AWS WAF
/// to reject those requests.
/// </para>
///
/// <para>
/// To create and configure a <code>ByteMatchSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateByteMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateByteMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <code>UpdateByteMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <a>UpdateByteMatchSet</a> request to specify the part of the request that
/// you want AWS WAF to inspect (for example, the header or the URI) and the value that
/// you want AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateByteMatchSet service method.</param>
///
/// <returns>The response from the CreateByteMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateByteMatchSet">REST API Reference for CreateByteMatchSet Operation</seealso>
CreateByteMatchSetResponse CreateByteMatchSet(CreateByteMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateByteMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateByteMatchSet operation on AmazonWAFClient.</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 EndCreateByteMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateByteMatchSet">REST API Reference for CreateByteMatchSet Operation</seealso>
IAsyncResult BeginCreateByteMatchSet(CreateByteMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateByteMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateByteMatchSet.</param>
///
/// <returns>Returns a CreateByteMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateByteMatchSet">REST API Reference for CreateByteMatchSet Operation</seealso>
CreateByteMatchSetResponse EndCreateByteMatchSet(IAsyncResult asyncResult);
#endregion
#region CreateGeoMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates an <a>GeoMatchSet</a>, which you use to specify which web requests you want
/// to allow or block based on the country that the requests originate from. For example,
/// if you're receiving a lot of requests from one or more countries and you want to block
/// the requests, you can create an <code>GeoMatchSet</code> that contains those countries
/// and then configure AWS WAF to block the requests.
/// </para>
///
/// <para>
/// To create and configure a <code>GeoMatchSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateGeoMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateGeoMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateGeoMatchSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateGeoMatchSetSet</code> request to specify the countries that
/// you want AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateGeoMatchSet service method.</param>
///
/// <returns>The response from the CreateGeoMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateGeoMatchSet">REST API Reference for CreateGeoMatchSet Operation</seealso>
CreateGeoMatchSetResponse CreateGeoMatchSet(CreateGeoMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateGeoMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateGeoMatchSet operation on AmazonWAFClient.</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 EndCreateGeoMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateGeoMatchSet">REST API Reference for CreateGeoMatchSet Operation</seealso>
IAsyncResult BeginCreateGeoMatchSet(CreateGeoMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateGeoMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateGeoMatchSet.</param>
///
/// <returns>Returns a CreateGeoMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateGeoMatchSet">REST API Reference for CreateGeoMatchSet Operation</seealso>
CreateGeoMatchSetResponse EndCreateGeoMatchSet(IAsyncResult asyncResult);
#endregion
#region CreateIPSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates an <a>IPSet</a>, which you use to specify which web requests that you want
/// to allow or block based on the IP addresses that the requests originate from. For
/// example, if you're receiving a lot of requests from one or more individual IP addresses
/// or one or more ranges of IP addresses and you want to block the requests, you can
/// create an <code>IPSet</code> that contains those IP addresses and then configure AWS
/// WAF to block the requests.
/// </para>
///
/// <para>
/// To create and configure an <code>IPSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateIPSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateIPSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateIPSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateIPSet</code> request to specify the IP addresses that you want
/// AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="name">A friendly name or description of the <a>IPSet</a>. You can't change <code>Name</code> after you create the <code>IPSet</code>.</param>
/// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
///
/// <returns>The response from the CreateIPSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateIPSet">REST API Reference for CreateIPSet Operation</seealso>
CreateIPSetResponse CreateIPSet(string name, string changeToken);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates an <a>IPSet</a>, which you use to specify which web requests that you want
/// to allow or block based on the IP addresses that the requests originate from. For
/// example, if you're receiving a lot of requests from one or more individual IP addresses
/// or one or more ranges of IP addresses and you want to block the requests, you can
/// create an <code>IPSet</code> that contains those IP addresses and then configure AWS
/// WAF to block the requests.
/// </para>
///
/// <para>
/// To create and configure an <code>IPSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateIPSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateIPSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateIPSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateIPSet</code> request to specify the IP addresses that you want
/// AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateIPSet service method.</param>
///
/// <returns>The response from the CreateIPSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateIPSet">REST API Reference for CreateIPSet Operation</seealso>
CreateIPSetResponse CreateIPSet(CreateIPSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateIPSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateIPSet operation on AmazonWAFClient.</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 EndCreateIPSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateIPSet">REST API Reference for CreateIPSet Operation</seealso>
IAsyncResult BeginCreateIPSet(CreateIPSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateIPSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateIPSet.</param>
///
/// <returns>Returns a CreateIPSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateIPSet">REST API Reference for CreateIPSet Operation</seealso>
CreateIPSetResponse EndCreateIPSet(IAsyncResult asyncResult);
#endregion
#region CreateRateBasedRule
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates a <a>RateBasedRule</a>. The <code>RateBasedRule</code> contains a <code>RateLimit</code>,
/// which specifies the maximum number of requests that AWS WAF allows from a specified
/// IP address in a five-minute period. The <code>RateBasedRule</code> also contains the
/// <code>IPSet</code> objects, <code>ByteMatchSet</code> objects, and other predicates
/// that identify the requests that you want to count or block if these requests exceed
/// the <code>RateLimit</code>.
/// </para>
///
/// <para>
/// If you add more than one predicate to a <code>RateBasedRule</code>, a request not
/// only must exceed the <code>RateLimit</code>, but it also must match all the conditions
/// to be counted or blocked. For example, suppose you add the following to a <code>RateBasedRule</code>:
/// </para>
/// <ul> <li>
/// <para>
/// An <code>IPSet</code> that matches the IP address <code>192.0.2.44/32</code>
/// </para>
/// </li> <li>
/// <para>
/// A <code>ByteMatchSet</code> that matches <code>BadBot</code> in the <code>User-Agent</code>
/// header
/// </para>
/// </li> </ul>
/// <para>
/// Further, you specify a <code>RateLimit</code> of 1,000.
/// </para>
///
/// <para>
/// You then add the <code>RateBasedRule</code> to a <code>WebACL</code> and specify that
/// you want to block requests that meet the conditions in the rule. For a request to
/// be blocked, it must come from the IP address 192.0.2.44 <i>and</i> the <code>User-Agent</code>
/// header in the request must contain the value <code>BadBot</code>. Further, requests
/// that match these two conditions must be received at a rate of more than 1,000 requests
/// every five minutes. If both conditions are met and the rate is exceeded, AWS WAF blocks
/// the requests. If the rate drops below 1,000 for a five-minute period, AWS WAF no longer
/// blocks the requests.
/// </para>
///
/// <para>
/// As a second example, suppose you want to limit requests to a particular page on your
/// site. To do this, you could add the following to a <code>RateBasedRule</code>:
/// </para>
/// <ul> <li>
/// <para>
/// A <code>ByteMatchSet</code> with <code>FieldToMatch</code> of <code>URI</code>
/// </para>
/// </li> <li>
/// <para>
/// A <code>PositionalConstraint</code> of <code>STARTS_WITH</code>
/// </para>
/// </li> <li>
/// <para>
/// A <code>TargetString</code> of <code>login</code>
/// </para>
/// </li> </ul>
/// <para>
/// Further, you specify a <code>RateLimit</code> of 1,000.
/// </para>
///
/// <para>
/// By adding this <code>RateBasedRule</code> to a <code>WebACL</code>, you could limit
/// requests to your login page without affecting the rest of your site.
/// </para>
///
/// <para>
/// To create and configure a <code>RateBasedRule</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Create and update the predicates that you want to include in the rule. For more information,
/// see <a>CreateByteMatchSet</a>, <a>CreateIPSet</a>, and <a>CreateSqlInjectionMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateRule</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateRateBasedRule</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateRule</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateRateBasedRule</code> request to specify the predicates that
/// you want to include in the rule.
/// </para>
/// </li> <li>
/// <para>
/// Create and update a <code>WebACL</code> that contains the <code>RateBasedRule</code>.
/// For more information, see <a>CreateWebACL</a>.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateRateBasedRule service method.</param>
///
/// <returns>The response from the CreateRateBasedRule service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFBadRequestException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationInternalErrorException">
///
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRateBasedRule">REST API Reference for CreateRateBasedRule Operation</seealso>
CreateRateBasedRuleResponse CreateRateBasedRule(CreateRateBasedRuleRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateRateBasedRule operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateRateBasedRule operation on AmazonWAFClient.</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 EndCreateRateBasedRule
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRateBasedRule">REST API Reference for CreateRateBasedRule Operation</seealso>
IAsyncResult BeginCreateRateBasedRule(CreateRateBasedRuleRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateRateBasedRule operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateRateBasedRule.</param>
///
/// <returns>Returns a CreateRateBasedRuleResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRateBasedRule">REST API Reference for CreateRateBasedRule Operation</seealso>
CreateRateBasedRuleResponse EndCreateRateBasedRule(IAsyncResult asyncResult);
#endregion
#region CreateRegexMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates a <a>RegexMatchSet</a>. You then use <a>UpdateRegexMatchSet</a> to identify
/// the part of a web request that you want AWS WAF to inspect, such as the values of
/// the <code>User-Agent</code> header or the query string. For example, you can create
/// a <code>RegexMatchSet</code> that contains a <code>RegexMatchTuple</code> that looks
/// for any requests with <code>User-Agent</code> headers that match a <code>RegexPatternSet</code>
/// with pattern <code>B[a@]dB[o0]t</code>. You can then configure AWS WAF to reject those
/// requests.
/// </para>
///
/// <para>
/// To create and configure a <code>RegexMatchSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateRegexMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateRegexMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <code>UpdateRegexMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <a>UpdateRegexMatchSet</a> request to specify the part of the request that
/// you want AWS WAF to inspect (for example, the header or the URI) and the value, using
/// a <code>RegexPatternSet</code>, that you want AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateRegexMatchSet service method.</param>
///
/// <returns>The response from the CreateRegexMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRegexMatchSet">REST API Reference for CreateRegexMatchSet Operation</seealso>
CreateRegexMatchSetResponse CreateRegexMatchSet(CreateRegexMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateRegexMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateRegexMatchSet operation on AmazonWAFClient.</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 EndCreateRegexMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRegexMatchSet">REST API Reference for CreateRegexMatchSet Operation</seealso>
IAsyncResult BeginCreateRegexMatchSet(CreateRegexMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateRegexMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateRegexMatchSet.</param>
///
/// <returns>Returns a CreateRegexMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRegexMatchSet">REST API Reference for CreateRegexMatchSet Operation</seealso>
CreateRegexMatchSetResponse EndCreateRegexMatchSet(IAsyncResult asyncResult);
#endregion
#region CreateRegexPatternSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates a <code>RegexPatternSet</code>. You then use <a>UpdateRegexPatternSet</a>
/// to specify the regular expression (regex) pattern that you want AWS WAF to search
/// for, such as <code>B[a@]dB[o0]t</code>. You can then configure AWS WAF to reject those
/// requests.
/// </para>
///
/// <para>
/// To create and configure a <code>RegexPatternSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateRegexPatternSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateRegexPatternSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <code>UpdateRegexPatternSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <a>UpdateRegexPatternSet</a> request to specify the string that you want
/// AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateRegexPatternSet service method.</param>
///
/// <returns>The response from the CreateRegexPatternSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRegexPatternSet">REST API Reference for CreateRegexPatternSet Operation</seealso>
CreateRegexPatternSetResponse CreateRegexPatternSet(CreateRegexPatternSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateRegexPatternSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateRegexPatternSet operation on AmazonWAFClient.</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 EndCreateRegexPatternSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRegexPatternSet">REST API Reference for CreateRegexPatternSet Operation</seealso>
IAsyncResult BeginCreateRegexPatternSet(CreateRegexPatternSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateRegexPatternSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateRegexPatternSet.</param>
///
/// <returns>Returns a CreateRegexPatternSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRegexPatternSet">REST API Reference for CreateRegexPatternSet Operation</seealso>
CreateRegexPatternSetResponse EndCreateRegexPatternSet(IAsyncResult asyncResult);
#endregion
#region CreateRule
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates a <code>Rule</code>, which contains the <code>IPSet</code> objects, <code>ByteMatchSet</code>
/// objects, and other predicates that identify the requests that you want to block. If
/// you add more than one predicate to a <code>Rule</code>, a request must match all of
/// the specifications to be allowed or blocked. For example, suppose that you add the
/// following to a <code>Rule</code>:
/// </para>
/// <ul> <li>
/// <para>
/// An <code>IPSet</code> that matches the IP address <code>192.0.2.44/32</code>
/// </para>
/// </li> <li>
/// <para>
/// A <code>ByteMatchSet</code> that matches <code>BadBot</code> in the <code>User-Agent</code>
/// header
/// </para>
/// </li> </ul>
/// <para>
/// You then add the <code>Rule</code> to a <code>WebACL</code> and specify that you want
/// to blocks requests that satisfy the <code>Rule</code>. For a request to be blocked,
/// it must come from the IP address 192.0.2.44 <i>and</i> the <code>User-Agent</code>
/// header in the request must contain the value <code>BadBot</code>.
/// </para>
///
/// <para>
/// To create and configure a <code>Rule</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Create and update the predicates that you want to include in the <code>Rule</code>.
/// For more information, see <a>CreateByteMatchSet</a>, <a>CreateIPSet</a>, and <a>CreateSqlInjectionMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateRule</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateRule</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateRule</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateRule</code> request to specify the predicates that you want
/// to include in the <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// Create and update a <code>WebACL</code> that contains the <code>Rule</code>. For more
/// information, see <a>CreateWebACL</a>.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="name">A friendly name or description of the <a>Rule</a>. You can't change the name of a <code>Rule</code> after you create it.</param>
/// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
/// <param name="metricName">A friendly name or description for the metrics for this <code>Rule</code>. The name can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128 and minimum length one. It can't contain whitespace or metric names reserved for AWS WAF, including "All" and "Default_Action." You can't change the name of the metric after you create the <code>Rule</code>.</param>
///
/// <returns>The response from the CreateRule service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFBadRequestException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationInternalErrorException">
///
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRule">REST API Reference for CreateRule Operation</seealso>
CreateRuleResponse CreateRule(string name, string changeToken, string metricName);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates a <code>Rule</code>, which contains the <code>IPSet</code> objects, <code>ByteMatchSet</code>
/// objects, and other predicates that identify the requests that you want to block. If
/// you add more than one predicate to a <code>Rule</code>, a request must match all of
/// the specifications to be allowed or blocked. For example, suppose that you add the
/// following to a <code>Rule</code>:
/// </para>
/// <ul> <li>
/// <para>
/// An <code>IPSet</code> that matches the IP address <code>192.0.2.44/32</code>
/// </para>
/// </li> <li>
/// <para>
/// A <code>ByteMatchSet</code> that matches <code>BadBot</code> in the <code>User-Agent</code>
/// header
/// </para>
/// </li> </ul>
/// <para>
/// You then add the <code>Rule</code> to a <code>WebACL</code> and specify that you want
/// to blocks requests that satisfy the <code>Rule</code>. For a request to be blocked,
/// it must come from the IP address 192.0.2.44 <i>and</i> the <code>User-Agent</code>
/// header in the request must contain the value <code>BadBot</code>.
/// </para>
///
/// <para>
/// To create and configure a <code>Rule</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Create and update the predicates that you want to include in the <code>Rule</code>.
/// For more information, see <a>CreateByteMatchSet</a>, <a>CreateIPSet</a>, and <a>CreateSqlInjectionMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateRule</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateRule</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateRule</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateRule</code> request to specify the predicates that you want
/// to include in the <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// Create and update a <code>WebACL</code> that contains the <code>Rule</code>. For more
/// information, see <a>CreateWebACL</a>.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateRule service method.</param>
///
/// <returns>The response from the CreateRule service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFBadRequestException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationInternalErrorException">
///
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRule">REST API Reference for CreateRule Operation</seealso>
CreateRuleResponse CreateRule(CreateRuleRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateRule operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateRule operation on AmazonWAFClient.</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 EndCreateRule
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRule">REST API Reference for CreateRule Operation</seealso>
IAsyncResult BeginCreateRule(CreateRuleRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateRule operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateRule.</param>
///
/// <returns>Returns a CreateRuleResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRule">REST API Reference for CreateRule Operation</seealso>
CreateRuleResponse EndCreateRule(IAsyncResult asyncResult);
#endregion
#region CreateRuleGroup
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates a <code>RuleGroup</code>. A rule group is a collection of predefined rules
/// that you add to a web ACL. You use <a>UpdateRuleGroup</a> to add rules to the rule
/// group.
/// </para>
///
/// <para>
/// Rule groups are subject to the following limits:
/// </para>
/// <ul> <li>
/// <para>
/// Three rule groups per account. You can request an increase to this limit by contacting
/// customer support.
/// </para>
/// </li> <li>
/// <para>
/// One rule group per web ACL.
/// </para>
/// </li> <li>
/// <para>
/// Ten rules per rule group.
/// </para>
/// </li> </ul>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateRuleGroup service method.</param>
///
/// <returns>The response from the CreateRuleGroup service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFBadRequestException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationInternalErrorException">
///
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRuleGroup">REST API Reference for CreateRuleGroup Operation</seealso>
CreateRuleGroupResponse CreateRuleGroup(CreateRuleGroupRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateRuleGroup operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateRuleGroup operation on AmazonWAFClient.</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 EndCreateRuleGroup
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRuleGroup">REST API Reference for CreateRuleGroup Operation</seealso>
IAsyncResult BeginCreateRuleGroup(CreateRuleGroupRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateRuleGroup operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateRuleGroup.</param>
///
/// <returns>Returns a CreateRuleGroupResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRuleGroup">REST API Reference for CreateRuleGroup Operation</seealso>
CreateRuleGroupResponse EndCreateRuleGroup(IAsyncResult asyncResult);
#endregion
#region CreateSizeConstraintSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates a <code>SizeConstraintSet</code>. You then use <a>UpdateSizeConstraintSet</a>
/// to identify the part of a web request that you want AWS WAF to check for length, such
/// as the length of the <code>User-Agent</code> header or the length of the query string.
/// For example, you can create a <code>SizeConstraintSet</code> that matches any requests
/// that have a query string that is longer than 100 bytes. You can then configure AWS
/// WAF to reject those requests.
/// </para>
///
/// <para>
/// To create and configure a <code>SizeConstraintSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateSizeConstraintSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateSizeConstraintSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <code>UpdateSizeConstraintSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <a>UpdateSizeConstraintSet</a> request to specify the part of the request
/// that you want AWS WAF to inspect (for example, the header or the URI) and the value
/// that you want AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateSizeConstraintSet service method.</param>
///
/// <returns>The response from the CreateSizeConstraintSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSizeConstraintSet">REST API Reference for CreateSizeConstraintSet Operation</seealso>
CreateSizeConstraintSetResponse CreateSizeConstraintSet(CreateSizeConstraintSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateSizeConstraintSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateSizeConstraintSet operation on AmazonWAFClient.</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 EndCreateSizeConstraintSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSizeConstraintSet">REST API Reference for CreateSizeConstraintSet Operation</seealso>
IAsyncResult BeginCreateSizeConstraintSet(CreateSizeConstraintSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateSizeConstraintSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateSizeConstraintSet.</param>
///
/// <returns>Returns a CreateSizeConstraintSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSizeConstraintSet">REST API Reference for CreateSizeConstraintSet Operation</seealso>
CreateSizeConstraintSetResponse EndCreateSizeConstraintSet(IAsyncResult asyncResult);
#endregion
#region CreateSqlInjectionMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates a <a>SqlInjectionMatchSet</a>, which you use to allow, block, or count requests
/// that contain snippets of SQL code in a specified part of web requests. AWS WAF searches
/// for character sequences that are likely to be malicious strings.
/// </para>
///
/// <para>
/// To create and configure a <code>SqlInjectionMatchSet</code>, perform the following
/// steps:
/// </para>
/// <ol> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateSqlInjectionMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateSqlInjectionMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateSqlInjectionMatchSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <a>UpdateSqlInjectionMatchSet</a> request to specify the parts of web requests
/// in which you want to allow, block, or count malicious SQL code.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="name">A friendly name or description for the <a>SqlInjectionMatchSet</a> that you're creating. You can't change <code>Name</code> after you create the <code>SqlInjectionMatchSet</code>.</param>
/// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
///
/// <returns>The response from the CreateSqlInjectionMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSqlInjectionMatchSet">REST API Reference for CreateSqlInjectionMatchSet Operation</seealso>
CreateSqlInjectionMatchSetResponse CreateSqlInjectionMatchSet(string name, string changeToken);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates a <a>SqlInjectionMatchSet</a>, which you use to allow, block, or count requests
/// that contain snippets of SQL code in a specified part of web requests. AWS WAF searches
/// for character sequences that are likely to be malicious strings.
/// </para>
///
/// <para>
/// To create and configure a <code>SqlInjectionMatchSet</code>, perform the following
/// steps:
/// </para>
/// <ol> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateSqlInjectionMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateSqlInjectionMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateSqlInjectionMatchSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <a>UpdateSqlInjectionMatchSet</a> request to specify the parts of web requests
/// in which you want to allow, block, or count malicious SQL code.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateSqlInjectionMatchSet service method.</param>
///
/// <returns>The response from the CreateSqlInjectionMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSqlInjectionMatchSet">REST API Reference for CreateSqlInjectionMatchSet Operation</seealso>
CreateSqlInjectionMatchSetResponse CreateSqlInjectionMatchSet(CreateSqlInjectionMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateSqlInjectionMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateSqlInjectionMatchSet operation on AmazonWAFClient.</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 EndCreateSqlInjectionMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSqlInjectionMatchSet">REST API Reference for CreateSqlInjectionMatchSet Operation</seealso>
IAsyncResult BeginCreateSqlInjectionMatchSet(CreateSqlInjectionMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateSqlInjectionMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateSqlInjectionMatchSet.</param>
///
/// <returns>Returns a CreateSqlInjectionMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateSqlInjectionMatchSet">REST API Reference for CreateSqlInjectionMatchSet Operation</seealso>
CreateSqlInjectionMatchSetResponse EndCreateSqlInjectionMatchSet(IAsyncResult asyncResult);
#endregion
#region CreateWebACL
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates a <code>WebACL</code>, which contains the <code>Rules</code> that identify
/// the CloudFront web requests that you want to allow, block, or count. AWS WAF evaluates
/// <code>Rules</code> in order based on the value of <code>Priority</code> for each <code>Rule</code>.
/// </para>
///
/// <para>
/// You also specify a default action, either <code>ALLOW</code> or <code>BLOCK</code>.
/// If a web request doesn't match any of the <code>Rules</code> in a <code>WebACL</code>,
/// AWS WAF responds to the request with the default action.
/// </para>
///
/// <para>
/// To create and configure a <code>WebACL</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Create and update the <code>ByteMatchSet</code> objects and other predicates that
/// you want to include in <code>Rules</code>. For more information, see <a>CreateByteMatchSet</a>,
/// <a>UpdateByteMatchSet</a>, <a>CreateIPSet</a>, <a>UpdateIPSet</a>, <a>CreateSqlInjectionMatchSet</a>,
/// and <a>UpdateSqlInjectionMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Create and update the <code>Rules</code> that you want to include in the <code>WebACL</code>.
/// For more information, see <a>CreateRule</a> and <a>UpdateRule</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateWebACL</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateWebACL</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateWebACL</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <a>UpdateWebACL</a> request to specify the <code>Rules</code> that you want
/// to include in the <code>WebACL</code>, to specify the default action, and to associate
/// the <code>WebACL</code> with a CloudFront distribution.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API, see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS
/// WAF Developer Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateWebACL service method.</param>
///
/// <returns>The response from the CreateWebACL service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFBadRequestException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationInternalErrorException">
///
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateWebACL">REST API Reference for CreateWebACL Operation</seealso>
CreateWebACLResponse CreateWebACL(CreateWebACLRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateWebACL operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateWebACL operation on AmazonWAFClient.</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 EndCreateWebACL
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateWebACL">REST API Reference for CreateWebACL Operation</seealso>
IAsyncResult BeginCreateWebACL(CreateWebACLRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateWebACL operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateWebACL.</param>
///
/// <returns>Returns a CreateWebACLResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateWebACL">REST API Reference for CreateWebACL Operation</seealso>
CreateWebACLResponse EndCreateWebACL(IAsyncResult asyncResult);
#endregion
#region CreateWebACLMigrationStack
/// <summary>
/// Creates an AWS CloudFormation WAFV2 template for the specified web ACL in the specified
/// Amazon S3 bucket. Then, in CloudFormation, you create a stack from the template, to
/// create the web ACL and its resources in AWS WAFV2. Use this to migrate your AWS WAF
/// Classic web ACL to the latest version of AWS WAF.
///
///
/// <para>
/// This is part of a larger migration procedure for web ACLs from AWS WAF Classic to
/// the latest version of AWS WAF. For the full procedure, including caveats and manual
/// steps to complete the migration and switch over to the new web ACL, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-migrating-from-classic.html">Migrating
/// your AWS WAF Classic resources to AWS WAF</a> in the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateWebACLMigrationStack service method.</param>
///
/// <returns>The response from the CreateWebACLMigrationStack service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFEntityMigrationException">
/// The operation failed due to a problem with the migration. The failure cause is provided
/// in the exception, in the <code>MigrationErrorType</code>:
///
/// <ul> <li>
/// <para>
/// <code>ENTITY_NOT_SUPPORTED</code> - The web ACL has an unsupported entity but the
/// <code>IgnoreUnsupportedType</code> is not set to true.
/// </para>
/// </li> <li>
/// <para>
/// <code>ENTITY_NOT_FOUND</code> - The web ACL doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// <code>S3_BUCKET_NO_PERMISSION</code> - You don't have permission to perform the <code>PutObject</code>
/// action to the specified Amazon S3 bucket.
/// </para>
/// </li> <li>
/// <para>
/// <code>S3_BUCKET_NOT_ACCESSIBLE</code> - The bucket policy doesn't allow AWS WAF to
/// perform the <code>PutObject</code> action in the bucket.
/// </para>
/// </li> <li>
/// <para>
/// <code>S3_BUCKET_NOT_FOUND</code> - The S3 bucket doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// <code>S3_BUCKET_INVALID_REGION</code> - The S3 bucket is not in the same Region as
/// the web ACL.
/// </para>
/// </li> <li>
/// <para>
/// <code>S3_INTERNAL_ERROR</code> - AWS WAF failed to create the template in the S3
/// bucket for another reason.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateWebACLMigrationStack">REST API Reference for CreateWebACLMigrationStack Operation</seealso>
CreateWebACLMigrationStackResponse CreateWebACLMigrationStack(CreateWebACLMigrationStackRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateWebACLMigrationStack operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateWebACLMigrationStack operation on AmazonWAFClient.</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 EndCreateWebACLMigrationStack
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateWebACLMigrationStack">REST API Reference for CreateWebACLMigrationStack Operation</seealso>
IAsyncResult BeginCreateWebACLMigrationStack(CreateWebACLMigrationStackRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateWebACLMigrationStack operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateWebACLMigrationStack.</param>
///
/// <returns>Returns a CreateWebACLMigrationStackResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateWebACLMigrationStack">REST API Reference for CreateWebACLMigrationStack Operation</seealso>
CreateWebACLMigrationStackResponse EndCreateWebACLMigrationStack(IAsyncResult asyncResult);
#endregion
#region CreateXssMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Creates an <a>XssMatchSet</a>, which you use to allow, block, or count requests that
/// contain cross-site scripting attacks in the specified part of web requests. AWS WAF
/// searches for character sequences that are likely to be malicious strings.
/// </para>
///
/// <para>
/// To create and configure an <code>XssMatchSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>CreateXssMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>CreateXssMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateXssMatchSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <a>UpdateXssMatchSet</a> request to specify the parts of web requests in
/// which you want to allow, block, or count cross-site scripting attacks.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateXssMatchSet service method.</param>
///
/// <returns>The response from the CreateXssMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateXssMatchSet">REST API Reference for CreateXssMatchSet Operation</seealso>
CreateXssMatchSetResponse CreateXssMatchSet(CreateXssMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the CreateXssMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateXssMatchSet operation on AmazonWAFClient.</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 EndCreateXssMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateXssMatchSet">REST API Reference for CreateXssMatchSet Operation</seealso>
IAsyncResult BeginCreateXssMatchSet(CreateXssMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the CreateXssMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateXssMatchSet.</param>
///
/// <returns>Returns a CreateXssMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateXssMatchSet">REST API Reference for CreateXssMatchSet Operation</seealso>
CreateXssMatchSetResponse EndCreateXssMatchSet(IAsyncResult asyncResult);
#endregion
#region DeleteByteMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes a <a>ByteMatchSet</a>. You can't delete a <code>ByteMatchSet</code>
/// if it's still used in any <code>Rules</code> or if it still includes any <a>ByteMatchTuple</a>
/// objects (any filters).
/// </para>
///
/// <para>
/// If you just want to remove a <code>ByteMatchSet</code> from a <code>Rule</code>, use
/// <a>UpdateRule</a>.
/// </para>
///
/// <para>
/// To permanently delete a <code>ByteMatchSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>ByteMatchSet</code> to remove filters, if any. For more information,
/// see <a>UpdateByteMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteByteMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteByteMatchSet</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="byteMatchSetId">The <code>ByteMatchSetId</code> of the <a>ByteMatchSet</a> that you want to delete. <code>ByteMatchSetId</code> is returned by <a>CreateByteMatchSet</a> and by <a>ListByteMatchSets</a>.</param>
/// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
///
/// <returns>The response from the DeleteByteMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteByteMatchSet">REST API Reference for DeleteByteMatchSet Operation</seealso>
DeleteByteMatchSetResponse DeleteByteMatchSet(string byteMatchSetId, string changeToken);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes a <a>ByteMatchSet</a>. You can't delete a <code>ByteMatchSet</code>
/// if it's still used in any <code>Rules</code> or if it still includes any <a>ByteMatchTuple</a>
/// objects (any filters).
/// </para>
///
/// <para>
/// If you just want to remove a <code>ByteMatchSet</code> from a <code>Rule</code>, use
/// <a>UpdateRule</a>.
/// </para>
///
/// <para>
/// To permanently delete a <code>ByteMatchSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>ByteMatchSet</code> to remove filters, if any. For more information,
/// see <a>UpdateByteMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteByteMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteByteMatchSet</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteByteMatchSet service method.</param>
///
/// <returns>The response from the DeleteByteMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteByteMatchSet">REST API Reference for DeleteByteMatchSet Operation</seealso>
DeleteByteMatchSetResponse DeleteByteMatchSet(DeleteByteMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteByteMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteByteMatchSet operation on AmazonWAFClient.</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 EndDeleteByteMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteByteMatchSet">REST API Reference for DeleteByteMatchSet Operation</seealso>
IAsyncResult BeginDeleteByteMatchSet(DeleteByteMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteByteMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteByteMatchSet.</param>
///
/// <returns>Returns a DeleteByteMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteByteMatchSet">REST API Reference for DeleteByteMatchSet Operation</seealso>
DeleteByteMatchSetResponse EndDeleteByteMatchSet(IAsyncResult asyncResult);
#endregion
#region DeleteGeoMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes a <a>GeoMatchSet</a>. You can't delete a <code>GeoMatchSet</code>
/// if it's still used in any <code>Rules</code> or if it still includes any countries.
/// </para>
///
/// <para>
/// If you just want to remove a <code>GeoMatchSet</code> from a <code>Rule</code>, use
/// <a>UpdateRule</a>.
/// </para>
///
/// <para>
/// To permanently delete a <code>GeoMatchSet</code> from AWS WAF, perform the following
/// steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>GeoMatchSet</code> to remove any countries. For more information,
/// see <a>UpdateGeoMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteGeoMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteGeoMatchSet</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteGeoMatchSet service method.</param>
///
/// <returns>The response from the DeleteGeoMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteGeoMatchSet">REST API Reference for DeleteGeoMatchSet Operation</seealso>
DeleteGeoMatchSetResponse DeleteGeoMatchSet(DeleteGeoMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteGeoMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteGeoMatchSet operation on AmazonWAFClient.</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 EndDeleteGeoMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteGeoMatchSet">REST API Reference for DeleteGeoMatchSet Operation</seealso>
IAsyncResult BeginDeleteGeoMatchSet(DeleteGeoMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteGeoMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteGeoMatchSet.</param>
///
/// <returns>Returns a DeleteGeoMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteGeoMatchSet">REST API Reference for DeleteGeoMatchSet Operation</seealso>
DeleteGeoMatchSetResponse EndDeleteGeoMatchSet(IAsyncResult asyncResult);
#endregion
#region DeleteIPSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes an <a>IPSet</a>. You can't delete an <code>IPSet</code> if it's
/// still used in any <code>Rules</code> or if it still includes any IP addresses.
/// </para>
///
/// <para>
/// If you just want to remove an <code>IPSet</code> from a <code>Rule</code>, use <a>UpdateRule</a>.
/// </para>
///
/// <para>
/// To permanently delete an <code>IPSet</code> from AWS WAF, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>IPSet</code> to remove IP address ranges, if any. For more information,
/// see <a>UpdateIPSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteIPSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteIPSet</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="ipSetId">The <code>IPSetId</code> of the <a>IPSet</a> that you want to delete. <code>IPSetId</code> is returned by <a>CreateIPSet</a> and by <a>ListIPSets</a>.</param>
/// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
///
/// <returns>The response from the DeleteIPSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteIPSet">REST API Reference for DeleteIPSet Operation</seealso>
DeleteIPSetResponse DeleteIPSet(string ipSetId, string changeToken);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes an <a>IPSet</a>. You can't delete an <code>IPSet</code> if it's
/// still used in any <code>Rules</code> or if it still includes any IP addresses.
/// </para>
///
/// <para>
/// If you just want to remove an <code>IPSet</code> from a <code>Rule</code>, use <a>UpdateRule</a>.
/// </para>
///
/// <para>
/// To permanently delete an <code>IPSet</code> from AWS WAF, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>IPSet</code> to remove IP address ranges, if any. For more information,
/// see <a>UpdateIPSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteIPSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteIPSet</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteIPSet service method.</param>
///
/// <returns>The response from the DeleteIPSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteIPSet">REST API Reference for DeleteIPSet Operation</seealso>
DeleteIPSetResponse DeleteIPSet(DeleteIPSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteIPSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteIPSet operation on AmazonWAFClient.</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 EndDeleteIPSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteIPSet">REST API Reference for DeleteIPSet Operation</seealso>
IAsyncResult BeginDeleteIPSet(DeleteIPSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteIPSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteIPSet.</param>
///
/// <returns>Returns a DeleteIPSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteIPSet">REST API Reference for DeleteIPSet Operation</seealso>
DeleteIPSetResponse EndDeleteIPSet(IAsyncResult asyncResult);
#endregion
#region DeleteLoggingConfiguration
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes the <a>LoggingConfiguration</a> from the specified web ACL.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteLoggingConfiguration service method.</param>
///
/// <returns>The response from the DeleteLoggingConfiguration service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteLoggingConfiguration">REST API Reference for DeleteLoggingConfiguration Operation</seealso>
DeleteLoggingConfigurationResponse DeleteLoggingConfiguration(DeleteLoggingConfigurationRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteLoggingConfiguration operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteLoggingConfiguration operation on AmazonWAFClient.</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 EndDeleteLoggingConfiguration
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteLoggingConfiguration">REST API Reference for DeleteLoggingConfiguration Operation</seealso>
IAsyncResult BeginDeleteLoggingConfiguration(DeleteLoggingConfigurationRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteLoggingConfiguration operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteLoggingConfiguration.</param>
///
/// <returns>Returns a DeleteLoggingConfigurationResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteLoggingConfiguration">REST API Reference for DeleteLoggingConfiguration Operation</seealso>
DeleteLoggingConfigurationResponse EndDeleteLoggingConfiguration(IAsyncResult asyncResult);
#endregion
#region DeletePermissionPolicy
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes an IAM policy from the specified RuleGroup.
/// </para>
///
/// <para>
/// The user making the request must be the owner of the RuleGroup.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeletePermissionPolicy service method.</param>
///
/// <returns>The response from the DeletePermissionPolicy service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeletePermissionPolicy">REST API Reference for DeletePermissionPolicy Operation</seealso>
DeletePermissionPolicyResponse DeletePermissionPolicy(DeletePermissionPolicyRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeletePermissionPolicy operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeletePermissionPolicy operation on AmazonWAFClient.</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 EndDeletePermissionPolicy
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeletePermissionPolicy">REST API Reference for DeletePermissionPolicy Operation</seealso>
IAsyncResult BeginDeletePermissionPolicy(DeletePermissionPolicyRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeletePermissionPolicy operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeletePermissionPolicy.</param>
///
/// <returns>Returns a DeletePermissionPolicyResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeletePermissionPolicy">REST API Reference for DeletePermissionPolicy Operation</seealso>
DeletePermissionPolicyResponse EndDeletePermissionPolicy(IAsyncResult asyncResult);
#endregion
#region DeleteRateBasedRule
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes a <a>RateBasedRule</a>. You can't delete a rule if it's still
/// used in any <code>WebACL</code> objects or if it still includes any predicates, such
/// as <code>ByteMatchSet</code> objects.
/// </para>
///
/// <para>
/// If you just want to remove a rule from a <code>WebACL</code>, use <a>UpdateWebACL</a>.
/// </para>
///
/// <para>
/// To permanently delete a <code>RateBasedRule</code> from AWS WAF, perform the following
/// steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>RateBasedRule</code> to remove predicates, if any. For more information,
/// see <a>UpdateRateBasedRule</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteRateBasedRule</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteRateBasedRule</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteRateBasedRule service method.</param>
///
/// <returns>The response from the DeleteRateBasedRule service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationInternalErrorException">
///
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRateBasedRule">REST API Reference for DeleteRateBasedRule Operation</seealso>
DeleteRateBasedRuleResponse DeleteRateBasedRule(DeleteRateBasedRuleRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteRateBasedRule operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteRateBasedRule operation on AmazonWAFClient.</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 EndDeleteRateBasedRule
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRateBasedRule">REST API Reference for DeleteRateBasedRule Operation</seealso>
IAsyncResult BeginDeleteRateBasedRule(DeleteRateBasedRuleRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteRateBasedRule operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteRateBasedRule.</param>
///
/// <returns>Returns a DeleteRateBasedRuleResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRateBasedRule">REST API Reference for DeleteRateBasedRule Operation</seealso>
DeleteRateBasedRuleResponse EndDeleteRateBasedRule(IAsyncResult asyncResult);
#endregion
#region DeleteRegexMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes a <a>RegexMatchSet</a>. You can't delete a <code>RegexMatchSet</code>
/// if it's still used in any <code>Rules</code> or if it still includes any <code>RegexMatchTuples</code>
/// objects (any filters).
/// </para>
///
/// <para>
/// If you just want to remove a <code>RegexMatchSet</code> from a <code>Rule</code>,
/// use <a>UpdateRule</a>.
/// </para>
///
/// <para>
/// To permanently delete a <code>RegexMatchSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>RegexMatchSet</code> to remove filters, if any. For more information,
/// see <a>UpdateRegexMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteRegexMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteRegexMatchSet</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteRegexMatchSet service method.</param>
///
/// <returns>The response from the DeleteRegexMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRegexMatchSet">REST API Reference for DeleteRegexMatchSet Operation</seealso>
DeleteRegexMatchSetResponse DeleteRegexMatchSet(DeleteRegexMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteRegexMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteRegexMatchSet operation on AmazonWAFClient.</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 EndDeleteRegexMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRegexMatchSet">REST API Reference for DeleteRegexMatchSet Operation</seealso>
IAsyncResult BeginDeleteRegexMatchSet(DeleteRegexMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteRegexMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteRegexMatchSet.</param>
///
/// <returns>Returns a DeleteRegexMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRegexMatchSet">REST API Reference for DeleteRegexMatchSet Operation</seealso>
DeleteRegexMatchSetResponse EndDeleteRegexMatchSet(IAsyncResult asyncResult);
#endregion
#region DeleteRegexPatternSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes a <a>RegexPatternSet</a>. You can't delete a <code>RegexPatternSet</code>
/// if it's still used in any <code>RegexMatchSet</code> or if the <code>RegexPatternSet</code>
/// is not empty.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteRegexPatternSet service method.</param>
///
/// <returns>The response from the DeleteRegexPatternSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRegexPatternSet">REST API Reference for DeleteRegexPatternSet Operation</seealso>
DeleteRegexPatternSetResponse DeleteRegexPatternSet(DeleteRegexPatternSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteRegexPatternSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteRegexPatternSet operation on AmazonWAFClient.</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 EndDeleteRegexPatternSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRegexPatternSet">REST API Reference for DeleteRegexPatternSet Operation</seealso>
IAsyncResult BeginDeleteRegexPatternSet(DeleteRegexPatternSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteRegexPatternSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteRegexPatternSet.</param>
///
/// <returns>Returns a DeleteRegexPatternSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRegexPatternSet">REST API Reference for DeleteRegexPatternSet Operation</seealso>
DeleteRegexPatternSetResponse EndDeleteRegexPatternSet(IAsyncResult asyncResult);
#endregion
#region DeleteRule
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes a <a>Rule</a>. You can't delete a <code>Rule</code> if it's still
/// used in any <code>WebACL</code> objects or if it still includes any predicates, such
/// as <code>ByteMatchSet</code> objects.
/// </para>
///
/// <para>
/// If you just want to remove a <code>Rule</code> from a <code>WebACL</code>, use <a>UpdateWebACL</a>.
/// </para>
///
/// <para>
/// To permanently delete a <code>Rule</code> from AWS WAF, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>Rule</code> to remove predicates, if any. For more information, see
/// <a>UpdateRule</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteRule</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteRule</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="ruleId">The <code>RuleId</code> of the <a>Rule</a> that you want to delete. <code>RuleId</code> is returned by <a>CreateRule</a> and by <a>ListRules</a>.</param>
/// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
///
/// <returns>The response from the DeleteRule service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationInternalErrorException">
///
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRule">REST API Reference for DeleteRule Operation</seealso>
DeleteRuleResponse DeleteRule(string ruleId, string changeToken);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes a <a>Rule</a>. You can't delete a <code>Rule</code> if it's still
/// used in any <code>WebACL</code> objects or if it still includes any predicates, such
/// as <code>ByteMatchSet</code> objects.
/// </para>
///
/// <para>
/// If you just want to remove a <code>Rule</code> from a <code>WebACL</code>, use <a>UpdateWebACL</a>.
/// </para>
///
/// <para>
/// To permanently delete a <code>Rule</code> from AWS WAF, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>Rule</code> to remove predicates, if any. For more information, see
/// <a>UpdateRule</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteRule</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteRule</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteRule service method.</param>
///
/// <returns>The response from the DeleteRule service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationInternalErrorException">
///
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRule">REST API Reference for DeleteRule Operation</seealso>
DeleteRuleResponse DeleteRule(DeleteRuleRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteRule operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteRule operation on AmazonWAFClient.</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 EndDeleteRule
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRule">REST API Reference for DeleteRule Operation</seealso>
IAsyncResult BeginDeleteRule(DeleteRuleRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteRule operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteRule.</param>
///
/// <returns>Returns a DeleteRuleResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRule">REST API Reference for DeleteRule Operation</seealso>
DeleteRuleResponse EndDeleteRule(IAsyncResult asyncResult);
#endregion
#region DeleteRuleGroup
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes a <a>RuleGroup</a>. You can't delete a <code>RuleGroup</code>
/// if it's still used in any <code>WebACL</code> objects or if it still includes any
/// rules.
/// </para>
///
/// <para>
/// If you just want to remove a <code>RuleGroup</code> from a <code>WebACL</code>, use
/// <a>UpdateWebACL</a>.
/// </para>
///
/// <para>
/// To permanently delete a <code>RuleGroup</code> from AWS WAF, perform the following
/// steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>RuleGroup</code> to remove rules, if any. For more information, see
/// <a>UpdateRuleGroup</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteRuleGroup</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteRuleGroup</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteRuleGroup service method.</param>
///
/// <returns>The response from the DeleteRuleGroup service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationInternalErrorException">
///
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRuleGroup">REST API Reference for DeleteRuleGroup Operation</seealso>
DeleteRuleGroupResponse DeleteRuleGroup(DeleteRuleGroupRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteRuleGroup operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteRuleGroup operation on AmazonWAFClient.</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 EndDeleteRuleGroup
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRuleGroup">REST API Reference for DeleteRuleGroup Operation</seealso>
IAsyncResult BeginDeleteRuleGroup(DeleteRuleGroupRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteRuleGroup operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteRuleGroup.</param>
///
/// <returns>Returns a DeleteRuleGroupResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRuleGroup">REST API Reference for DeleteRuleGroup Operation</seealso>
DeleteRuleGroupResponse EndDeleteRuleGroup(IAsyncResult asyncResult);
#endregion
#region DeleteSizeConstraintSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes a <a>SizeConstraintSet</a>. You can't delete a <code>SizeConstraintSet</code>
/// if it's still used in any <code>Rules</code> or if it still includes any <a>SizeConstraint</a>
/// objects (any filters).
/// </para>
///
/// <para>
/// If you just want to remove a <code>SizeConstraintSet</code> from a <code>Rule</code>,
/// use <a>UpdateRule</a>.
/// </para>
///
/// <para>
/// To permanently delete a <code>SizeConstraintSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>SizeConstraintSet</code> to remove filters, if any. For more information,
/// see <a>UpdateSizeConstraintSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteSizeConstraintSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteSizeConstraintSet</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteSizeConstraintSet service method.</param>
///
/// <returns>The response from the DeleteSizeConstraintSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSizeConstraintSet">REST API Reference for DeleteSizeConstraintSet Operation</seealso>
DeleteSizeConstraintSetResponse DeleteSizeConstraintSet(DeleteSizeConstraintSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteSizeConstraintSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteSizeConstraintSet operation on AmazonWAFClient.</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 EndDeleteSizeConstraintSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSizeConstraintSet">REST API Reference for DeleteSizeConstraintSet Operation</seealso>
IAsyncResult BeginDeleteSizeConstraintSet(DeleteSizeConstraintSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteSizeConstraintSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteSizeConstraintSet.</param>
///
/// <returns>Returns a DeleteSizeConstraintSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSizeConstraintSet">REST API Reference for DeleteSizeConstraintSet Operation</seealso>
DeleteSizeConstraintSetResponse EndDeleteSizeConstraintSet(IAsyncResult asyncResult);
#endregion
#region DeleteSqlInjectionMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes a <a>SqlInjectionMatchSet</a>. You can't delete a <code>SqlInjectionMatchSet</code>
/// if it's still used in any <code>Rules</code> or if it still contains any <a>SqlInjectionMatchTuple</a>
/// objects.
/// </para>
///
/// <para>
/// If you just want to remove a <code>SqlInjectionMatchSet</code> from a <code>Rule</code>,
/// use <a>UpdateRule</a>.
/// </para>
///
/// <para>
/// To permanently delete a <code>SqlInjectionMatchSet</code> from AWS WAF, perform the
/// following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>SqlInjectionMatchSet</code> to remove filters, if any. For more information,
/// see <a>UpdateSqlInjectionMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteSqlInjectionMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteSqlInjectionMatchSet</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="sqlInjectionMatchSetId">The <code>SqlInjectionMatchSetId</code> of the <a>SqlInjectionMatchSet</a> that you want to delete. <code>SqlInjectionMatchSetId</code> is returned by <a>CreateSqlInjectionMatchSet</a> and by <a>ListSqlInjectionMatchSets</a>.</param>
/// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
///
/// <returns>The response from the DeleteSqlInjectionMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSqlInjectionMatchSet">REST API Reference for DeleteSqlInjectionMatchSet Operation</seealso>
DeleteSqlInjectionMatchSetResponse DeleteSqlInjectionMatchSet(string sqlInjectionMatchSetId, string changeToken);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes a <a>SqlInjectionMatchSet</a>. You can't delete a <code>SqlInjectionMatchSet</code>
/// if it's still used in any <code>Rules</code> or if it still contains any <a>SqlInjectionMatchTuple</a>
/// objects.
/// </para>
///
/// <para>
/// If you just want to remove a <code>SqlInjectionMatchSet</code> from a <code>Rule</code>,
/// use <a>UpdateRule</a>.
/// </para>
///
/// <para>
/// To permanently delete a <code>SqlInjectionMatchSet</code> from AWS WAF, perform the
/// following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>SqlInjectionMatchSet</code> to remove filters, if any. For more information,
/// see <a>UpdateSqlInjectionMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteSqlInjectionMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteSqlInjectionMatchSet</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteSqlInjectionMatchSet service method.</param>
///
/// <returns>The response from the DeleteSqlInjectionMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSqlInjectionMatchSet">REST API Reference for DeleteSqlInjectionMatchSet Operation</seealso>
DeleteSqlInjectionMatchSetResponse DeleteSqlInjectionMatchSet(DeleteSqlInjectionMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteSqlInjectionMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteSqlInjectionMatchSet operation on AmazonWAFClient.</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 EndDeleteSqlInjectionMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSqlInjectionMatchSet">REST API Reference for DeleteSqlInjectionMatchSet Operation</seealso>
IAsyncResult BeginDeleteSqlInjectionMatchSet(DeleteSqlInjectionMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteSqlInjectionMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteSqlInjectionMatchSet.</param>
///
/// <returns>Returns a DeleteSqlInjectionMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteSqlInjectionMatchSet">REST API Reference for DeleteSqlInjectionMatchSet Operation</seealso>
DeleteSqlInjectionMatchSetResponse EndDeleteSqlInjectionMatchSet(IAsyncResult asyncResult);
#endregion
#region DeleteWebACL
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes a <a>WebACL</a>. You can't delete a <code>WebACL</code> if it
/// still contains any <code>Rules</code>.
/// </para>
///
/// <para>
/// To delete a <code>WebACL</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>WebACL</code> to remove <code>Rules</code>, if any. For more information,
/// see <a>UpdateWebACL</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteWebACL</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteWebACL</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="webACLId">The <code>WebACLId</code> of the <a>WebACL</a> that you want to delete. <code>WebACLId</code> is returned by <a>CreateWebACL</a> and by <a>ListWebACLs</a>.</param>
/// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
///
/// <returns>The response from the DeleteWebACL service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationInternalErrorException">
///
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteWebACL">REST API Reference for DeleteWebACL Operation</seealso>
DeleteWebACLResponse DeleteWebACL(string webACLId, string changeToken);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes a <a>WebACL</a>. You can't delete a <code>WebACL</code> if it
/// still contains any <code>Rules</code>.
/// </para>
///
/// <para>
/// To delete a <code>WebACL</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>WebACL</code> to remove <code>Rules</code>, if any. For more information,
/// see <a>UpdateWebACL</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteWebACL</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteWebACL</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteWebACL service method.</param>
///
/// <returns>The response from the DeleteWebACL service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationInternalErrorException">
///
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteWebACL">REST API Reference for DeleteWebACL Operation</seealso>
DeleteWebACLResponse DeleteWebACL(DeleteWebACLRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteWebACL operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteWebACL operation on AmazonWAFClient.</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 EndDeleteWebACL
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteWebACL">REST API Reference for DeleteWebACL Operation</seealso>
IAsyncResult BeginDeleteWebACL(DeleteWebACLRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteWebACL operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteWebACL.</param>
///
/// <returns>Returns a DeleteWebACLResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteWebACL">REST API Reference for DeleteWebACL Operation</seealso>
DeleteWebACLResponse EndDeleteWebACL(IAsyncResult asyncResult);
#endregion
#region DeleteXssMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Permanently deletes an <a>XssMatchSet</a>. You can't delete an <code>XssMatchSet</code>
/// if it's still used in any <code>Rules</code> or if it still contains any <a>XssMatchTuple</a>
/// objects.
/// </para>
///
/// <para>
/// If you just want to remove an <code>XssMatchSet</code> from a <code>Rule</code>, use
/// <a>UpdateRule</a>.
/// </para>
///
/// <para>
/// To permanently delete an <code>XssMatchSet</code> from AWS WAF, perform the following
/// steps:
/// </para>
/// <ol> <li>
/// <para>
/// Update the <code>XssMatchSet</code> to remove filters, if any. For more information,
/// see <a>UpdateXssMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of a <code>DeleteXssMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit a <code>DeleteXssMatchSet</code> request.
/// </para>
/// </li> </ol>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteXssMatchSet service method.</param>
///
/// <returns>The response from the DeleteXssMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException">
/// The operation failed because you tried to delete an object that isn't empty. For example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>WebACL</code> that still contains one or more <code>Rule</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that still contains one or more <code>ByteMatchSet</code>
/// objects or other predicates.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code>
/// objects.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete an <code>IPSet</code> that references one or more IP addresses.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteXssMatchSet">REST API Reference for DeleteXssMatchSet Operation</seealso>
DeleteXssMatchSetResponse DeleteXssMatchSet(DeleteXssMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the DeleteXssMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteXssMatchSet operation on AmazonWAFClient.</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 EndDeleteXssMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteXssMatchSet">REST API Reference for DeleteXssMatchSet Operation</seealso>
IAsyncResult BeginDeleteXssMatchSet(DeleteXssMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the DeleteXssMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteXssMatchSet.</param>
///
/// <returns>Returns a DeleteXssMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteXssMatchSet">REST API Reference for DeleteXssMatchSet Operation</seealso>
DeleteXssMatchSetResponse EndDeleteXssMatchSet(IAsyncResult asyncResult);
#endregion
#region GetByteMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>ByteMatchSet</a> specified by <code>ByteMatchSetId</code>.
/// </para>
/// </summary>
/// <param name="byteMatchSetId">The <code>ByteMatchSetId</code> of the <a>ByteMatchSet</a> that you want to get. <code>ByteMatchSetId</code> is returned by <a>CreateByteMatchSet</a> and by <a>ListByteMatchSets</a>.</param>
///
/// <returns>The response from the GetByteMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetByteMatchSet">REST API Reference for GetByteMatchSet Operation</seealso>
GetByteMatchSetResponse GetByteMatchSet(string byteMatchSetId);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>ByteMatchSet</a> specified by <code>ByteMatchSetId</code>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetByteMatchSet service method.</param>
///
/// <returns>The response from the GetByteMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetByteMatchSet">REST API Reference for GetByteMatchSet Operation</seealso>
GetByteMatchSetResponse GetByteMatchSet(GetByteMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetByteMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetByteMatchSet operation on AmazonWAFClient.</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 EndGetByteMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetByteMatchSet">REST API Reference for GetByteMatchSet Operation</seealso>
IAsyncResult BeginGetByteMatchSet(GetByteMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetByteMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetByteMatchSet.</param>
///
/// <returns>Returns a GetByteMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetByteMatchSet">REST API Reference for GetByteMatchSet Operation</seealso>
GetByteMatchSetResponse EndGetByteMatchSet(IAsyncResult asyncResult);
#endregion
#region GetChangeToken
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// When you want to create, update, or delete AWS WAF objects, get a change token and
/// include the change token in the create, update, or delete request. Change tokens ensure
/// that your application doesn't submit conflicting requests to AWS WAF.
/// </para>
///
/// <para>
/// Each create, update, or delete request must use a unique change token. If your application
/// submits a <code>GetChangeToken</code> request and then submits a second <code>GetChangeToken</code>
/// request before submitting a create, update, or delete request, the second <code>GetChangeToken</code>
/// request returns the same value as the first <code>GetChangeToken</code> request.
/// </para>
///
/// <para>
/// When you use a change token in a create, update, or delete request, the status of
/// the change token changes to <code>PENDING</code>, which indicates that AWS WAF is
/// propagating the change to all AWS WAF servers. Use <code>GetChangeTokenStatus</code>
/// to determine the status of your change token.
/// </para>
/// </summary>
///
/// <returns>The response from the GetChangeToken service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeToken">REST API Reference for GetChangeToken Operation</seealso>
GetChangeTokenResponse GetChangeToken();
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// When you want to create, update, or delete AWS WAF objects, get a change token and
/// include the change token in the create, update, or delete request. Change tokens ensure
/// that your application doesn't submit conflicting requests to AWS WAF.
/// </para>
///
/// <para>
/// Each create, update, or delete request must use a unique change token. If your application
/// submits a <code>GetChangeToken</code> request and then submits a second <code>GetChangeToken</code>
/// request before submitting a create, update, or delete request, the second <code>GetChangeToken</code>
/// request returns the same value as the first <code>GetChangeToken</code> request.
/// </para>
///
/// <para>
/// When you use a change token in a create, update, or delete request, the status of
/// the change token changes to <code>PENDING</code>, which indicates that AWS WAF is
/// propagating the change to all AWS WAF servers. Use <code>GetChangeTokenStatus</code>
/// to determine the status of your change token.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetChangeToken service method.</param>
///
/// <returns>The response from the GetChangeToken service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeToken">REST API Reference for GetChangeToken Operation</seealso>
GetChangeTokenResponse GetChangeToken(GetChangeTokenRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetChangeToken operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetChangeToken operation on AmazonWAFClient.</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 EndGetChangeToken
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeToken">REST API Reference for GetChangeToken Operation</seealso>
IAsyncResult BeginGetChangeToken(GetChangeTokenRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetChangeToken operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetChangeToken.</param>
///
/// <returns>Returns a GetChangeTokenResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeToken">REST API Reference for GetChangeToken Operation</seealso>
GetChangeTokenResponse EndGetChangeToken(IAsyncResult asyncResult);
#endregion
#region GetChangeTokenStatus
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the status of a <code>ChangeToken</code> that you got by calling <a>GetChangeToken</a>.
/// <code>ChangeTokenStatus</code> is one of the following values:
/// </para>
/// <ul> <li>
/// <para>
/// <code>PROVISIONED</code>: You requested the change token by calling <code>GetChangeToken</code>,
/// but you haven't used it yet in a call to create, update, or delete an AWS WAF object.
/// </para>
/// </li> <li>
/// <para>
/// <code>PENDING</code>: AWS WAF is propagating the create, update, or delete request
/// to all AWS WAF servers.
/// </para>
/// </li> <li>
/// <para>
/// <code>INSYNC</code>: Propagation is complete.
/// </para>
/// </li> </ul>
/// </summary>
/// <param name="changeToken">The change token for which you want to get the status. This change token was previously returned in the <code>GetChangeToken</code> response.</param>
///
/// <returns>The response from the GetChangeTokenStatus service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeTokenStatus">REST API Reference for GetChangeTokenStatus Operation</seealso>
GetChangeTokenStatusResponse GetChangeTokenStatus(string changeToken);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the status of a <code>ChangeToken</code> that you got by calling <a>GetChangeToken</a>.
/// <code>ChangeTokenStatus</code> is one of the following values:
/// </para>
/// <ul> <li>
/// <para>
/// <code>PROVISIONED</code>: You requested the change token by calling <code>GetChangeToken</code>,
/// but you haven't used it yet in a call to create, update, or delete an AWS WAF object.
/// </para>
/// </li> <li>
/// <para>
/// <code>PENDING</code>: AWS WAF is propagating the create, update, or delete request
/// to all AWS WAF servers.
/// </para>
/// </li> <li>
/// <para>
/// <code>INSYNC</code>: Propagation is complete.
/// </para>
/// </li> </ul>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetChangeTokenStatus service method.</param>
///
/// <returns>The response from the GetChangeTokenStatus service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeTokenStatus">REST API Reference for GetChangeTokenStatus Operation</seealso>
GetChangeTokenStatusResponse GetChangeTokenStatus(GetChangeTokenStatusRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetChangeTokenStatus operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetChangeTokenStatus operation on AmazonWAFClient.</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 EndGetChangeTokenStatus
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeTokenStatus">REST API Reference for GetChangeTokenStatus Operation</seealso>
IAsyncResult BeginGetChangeTokenStatus(GetChangeTokenStatusRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetChangeTokenStatus operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetChangeTokenStatus.</param>
///
/// <returns>Returns a GetChangeTokenStatusResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeTokenStatus">REST API Reference for GetChangeTokenStatus Operation</seealso>
GetChangeTokenStatusResponse EndGetChangeTokenStatus(IAsyncResult asyncResult);
#endregion
#region GetGeoMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>GeoMatchSet</a> that is specified by <code>GeoMatchSetId</code>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetGeoMatchSet service method.</param>
///
/// <returns>The response from the GetGeoMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetGeoMatchSet">REST API Reference for GetGeoMatchSet Operation</seealso>
GetGeoMatchSetResponse GetGeoMatchSet(GetGeoMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetGeoMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetGeoMatchSet operation on AmazonWAFClient.</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 EndGetGeoMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetGeoMatchSet">REST API Reference for GetGeoMatchSet Operation</seealso>
IAsyncResult BeginGetGeoMatchSet(GetGeoMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetGeoMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetGeoMatchSet.</param>
///
/// <returns>Returns a GetGeoMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetGeoMatchSet">REST API Reference for GetGeoMatchSet Operation</seealso>
GetGeoMatchSetResponse EndGetGeoMatchSet(IAsyncResult asyncResult);
#endregion
#region GetIPSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>IPSet</a> that is specified by <code>IPSetId</code>.
/// </para>
/// </summary>
/// <param name="ipSetId">The <code>IPSetId</code> of the <a>IPSet</a> that you want to get. <code>IPSetId</code> is returned by <a>CreateIPSet</a> and by <a>ListIPSets</a>.</param>
///
/// <returns>The response from the GetIPSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetIPSet">REST API Reference for GetIPSet Operation</seealso>
GetIPSetResponse GetIPSet(string ipSetId);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>IPSet</a> that is specified by <code>IPSetId</code>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetIPSet service method.</param>
///
/// <returns>The response from the GetIPSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetIPSet">REST API Reference for GetIPSet Operation</seealso>
GetIPSetResponse GetIPSet(GetIPSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetIPSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetIPSet operation on AmazonWAFClient.</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 EndGetIPSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetIPSet">REST API Reference for GetIPSet Operation</seealso>
IAsyncResult BeginGetIPSet(GetIPSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetIPSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetIPSet.</param>
///
/// <returns>Returns a GetIPSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetIPSet">REST API Reference for GetIPSet Operation</seealso>
GetIPSetResponse EndGetIPSet(IAsyncResult asyncResult);
#endregion
#region GetLoggingConfiguration
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>LoggingConfiguration</a> for the specified web ACL.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetLoggingConfiguration service method.</param>
///
/// <returns>The response from the GetLoggingConfiguration service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetLoggingConfiguration">REST API Reference for GetLoggingConfiguration Operation</seealso>
GetLoggingConfigurationResponse GetLoggingConfiguration(GetLoggingConfigurationRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetLoggingConfiguration operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetLoggingConfiguration operation on AmazonWAFClient.</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 EndGetLoggingConfiguration
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetLoggingConfiguration">REST API Reference for GetLoggingConfiguration Operation</seealso>
IAsyncResult BeginGetLoggingConfiguration(GetLoggingConfigurationRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetLoggingConfiguration operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetLoggingConfiguration.</param>
///
/// <returns>Returns a GetLoggingConfigurationResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetLoggingConfiguration">REST API Reference for GetLoggingConfiguration Operation</seealso>
GetLoggingConfigurationResponse EndGetLoggingConfiguration(IAsyncResult asyncResult);
#endregion
#region GetPermissionPolicy
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the IAM policy attached to the RuleGroup.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetPermissionPolicy service method.</param>
///
/// <returns>The response from the GetPermissionPolicy service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetPermissionPolicy">REST API Reference for GetPermissionPolicy Operation</seealso>
GetPermissionPolicyResponse GetPermissionPolicy(GetPermissionPolicyRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetPermissionPolicy operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetPermissionPolicy operation on AmazonWAFClient.</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 EndGetPermissionPolicy
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetPermissionPolicy">REST API Reference for GetPermissionPolicy Operation</seealso>
IAsyncResult BeginGetPermissionPolicy(GetPermissionPolicyRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetPermissionPolicy operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetPermissionPolicy.</param>
///
/// <returns>Returns a GetPermissionPolicyResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetPermissionPolicy">REST API Reference for GetPermissionPolicy Operation</seealso>
GetPermissionPolicyResponse EndGetPermissionPolicy(IAsyncResult asyncResult);
#endregion
#region GetRateBasedRule
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>RateBasedRule</a> that is specified by the <code>RuleId</code> that
/// you included in the <code>GetRateBasedRule</code> request.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRateBasedRule service method.</param>
///
/// <returns>The response from the GetRateBasedRule service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRateBasedRule">REST API Reference for GetRateBasedRule Operation</seealso>
GetRateBasedRuleResponse GetRateBasedRule(GetRateBasedRuleRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetRateBasedRule operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRateBasedRule operation on AmazonWAFClient.</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 EndGetRateBasedRule
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRateBasedRule">REST API Reference for GetRateBasedRule Operation</seealso>
IAsyncResult BeginGetRateBasedRule(GetRateBasedRuleRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetRateBasedRule operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRateBasedRule.</param>
///
/// <returns>Returns a GetRateBasedRuleResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRateBasedRule">REST API Reference for GetRateBasedRule Operation</seealso>
GetRateBasedRuleResponse EndGetRateBasedRule(IAsyncResult asyncResult);
#endregion
#region GetRateBasedRuleManagedKeys
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of IP addresses currently being blocked by the <a>RateBasedRule</a>
/// that is specified by the <code>RuleId</code>. The maximum number of managed keys that
/// will be blocked is 10,000. If more than 10,000 addresses exceed the rate limit, the
/// 10,000 addresses with the highest rates will be blocked.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRateBasedRuleManagedKeys service method.</param>
///
/// <returns>The response from the GetRateBasedRuleManagedKeys service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRateBasedRuleManagedKeys">REST API Reference for GetRateBasedRuleManagedKeys Operation</seealso>
GetRateBasedRuleManagedKeysResponse GetRateBasedRuleManagedKeys(GetRateBasedRuleManagedKeysRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetRateBasedRuleManagedKeys operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRateBasedRuleManagedKeys operation on AmazonWAFClient.</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 EndGetRateBasedRuleManagedKeys
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRateBasedRuleManagedKeys">REST API Reference for GetRateBasedRuleManagedKeys Operation</seealso>
IAsyncResult BeginGetRateBasedRuleManagedKeys(GetRateBasedRuleManagedKeysRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetRateBasedRuleManagedKeys operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRateBasedRuleManagedKeys.</param>
///
/// <returns>Returns a GetRateBasedRuleManagedKeysResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRateBasedRuleManagedKeys">REST API Reference for GetRateBasedRuleManagedKeys Operation</seealso>
GetRateBasedRuleManagedKeysResponse EndGetRateBasedRuleManagedKeys(IAsyncResult asyncResult);
#endregion
#region GetRegexMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>RegexMatchSet</a> specified by <code>RegexMatchSetId</code>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRegexMatchSet service method.</param>
///
/// <returns>The response from the GetRegexMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRegexMatchSet">REST API Reference for GetRegexMatchSet Operation</seealso>
GetRegexMatchSetResponse GetRegexMatchSet(GetRegexMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetRegexMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRegexMatchSet operation on AmazonWAFClient.</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 EndGetRegexMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRegexMatchSet">REST API Reference for GetRegexMatchSet Operation</seealso>
IAsyncResult BeginGetRegexMatchSet(GetRegexMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetRegexMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRegexMatchSet.</param>
///
/// <returns>Returns a GetRegexMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRegexMatchSet">REST API Reference for GetRegexMatchSet Operation</seealso>
GetRegexMatchSetResponse EndGetRegexMatchSet(IAsyncResult asyncResult);
#endregion
#region GetRegexPatternSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>RegexPatternSet</a> specified by <code>RegexPatternSetId</code>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRegexPatternSet service method.</param>
///
/// <returns>The response from the GetRegexPatternSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRegexPatternSet">REST API Reference for GetRegexPatternSet Operation</seealso>
GetRegexPatternSetResponse GetRegexPatternSet(GetRegexPatternSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetRegexPatternSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRegexPatternSet operation on AmazonWAFClient.</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 EndGetRegexPatternSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRegexPatternSet">REST API Reference for GetRegexPatternSet Operation</seealso>
IAsyncResult BeginGetRegexPatternSet(GetRegexPatternSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetRegexPatternSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRegexPatternSet.</param>
///
/// <returns>Returns a GetRegexPatternSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRegexPatternSet">REST API Reference for GetRegexPatternSet Operation</seealso>
GetRegexPatternSetResponse EndGetRegexPatternSet(IAsyncResult asyncResult);
#endregion
#region GetRule
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>Rule</a> that is specified by the <code>RuleId</code> that you included
/// in the <code>GetRule</code> request.
/// </para>
/// </summary>
/// <param name="ruleId">The <code>RuleId</code> of the <a>Rule</a> that you want to get. <code>RuleId</code> is returned by <a>CreateRule</a> and by <a>ListRules</a>.</param>
///
/// <returns>The response from the GetRule service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRule">REST API Reference for GetRule Operation</seealso>
GetRuleResponse GetRule(string ruleId);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>Rule</a> that is specified by the <code>RuleId</code> that you included
/// in the <code>GetRule</code> request.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRule service method.</param>
///
/// <returns>The response from the GetRule service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRule">REST API Reference for GetRule Operation</seealso>
GetRuleResponse GetRule(GetRuleRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetRule operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRule operation on AmazonWAFClient.</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 EndGetRule
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRule">REST API Reference for GetRule Operation</seealso>
IAsyncResult BeginGetRule(GetRuleRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetRule operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRule.</param>
///
/// <returns>Returns a GetRuleResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRule">REST API Reference for GetRule Operation</seealso>
GetRuleResponse EndGetRule(IAsyncResult asyncResult);
#endregion
#region GetRuleGroup
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>RuleGroup</a> that is specified by the <code>RuleGroupId</code> that
/// you included in the <code>GetRuleGroup</code> request.
/// </para>
///
/// <para>
/// To view the rules in a rule group, use <a>ListActivatedRulesInRuleGroup</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetRuleGroup service method.</param>
///
/// <returns>The response from the GetRuleGroup service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRuleGroup">REST API Reference for GetRuleGroup Operation</seealso>
GetRuleGroupResponse GetRuleGroup(GetRuleGroupRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetRuleGroup operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetRuleGroup operation on AmazonWAFClient.</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 EndGetRuleGroup
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRuleGroup">REST API Reference for GetRuleGroup Operation</seealso>
IAsyncResult BeginGetRuleGroup(GetRuleGroupRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetRuleGroup operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetRuleGroup.</param>
///
/// <returns>Returns a GetRuleGroupResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRuleGroup">REST API Reference for GetRuleGroup Operation</seealso>
GetRuleGroupResponse EndGetRuleGroup(IAsyncResult asyncResult);
#endregion
#region GetSampledRequests
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Gets detailed information about a specified number of requests--a sample--that AWS
/// WAF randomly selects from among the first 5,000 requests that your AWS resource received
/// during a time range that you choose. You can specify a sample size of up to 500 requests,
/// and you can specify any time range in the previous three hours.
/// </para>
///
/// <para>
/// <code>GetSampledRequests</code> returns a time range, which is usually the time range
/// that you specified. However, if your resource (such as a CloudFront distribution)
/// received 5,000 requests before the specified time range elapsed, <code>GetSampledRequests</code>
/// returns an updated time range. This new time range indicates the actual period during
/// which AWS WAF selected the requests in the sample.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetSampledRequests service method.</param>
///
/// <returns>The response from the GetSampledRequests service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSampledRequests">REST API Reference for GetSampledRequests Operation</seealso>
GetSampledRequestsResponse GetSampledRequests(GetSampledRequestsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetSampledRequests operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetSampledRequests operation on AmazonWAFClient.</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 EndGetSampledRequests
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSampledRequests">REST API Reference for GetSampledRequests Operation</seealso>
IAsyncResult BeginGetSampledRequests(GetSampledRequestsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetSampledRequests operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetSampledRequests.</param>
///
/// <returns>Returns a GetSampledRequestsResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSampledRequests">REST API Reference for GetSampledRequests Operation</seealso>
GetSampledRequestsResponse EndGetSampledRequests(IAsyncResult asyncResult);
#endregion
#region GetSizeConstraintSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>SizeConstraintSet</a> specified by <code>SizeConstraintSetId</code>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetSizeConstraintSet service method.</param>
///
/// <returns>The response from the GetSizeConstraintSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSizeConstraintSet">REST API Reference for GetSizeConstraintSet Operation</seealso>
GetSizeConstraintSetResponse GetSizeConstraintSet(GetSizeConstraintSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetSizeConstraintSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetSizeConstraintSet operation on AmazonWAFClient.</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 EndGetSizeConstraintSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSizeConstraintSet">REST API Reference for GetSizeConstraintSet Operation</seealso>
IAsyncResult BeginGetSizeConstraintSet(GetSizeConstraintSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetSizeConstraintSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetSizeConstraintSet.</param>
///
/// <returns>Returns a GetSizeConstraintSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSizeConstraintSet">REST API Reference for GetSizeConstraintSet Operation</seealso>
GetSizeConstraintSetResponse EndGetSizeConstraintSet(IAsyncResult asyncResult);
#endregion
#region GetSqlInjectionMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>SqlInjectionMatchSet</a> that is specified by <code>SqlInjectionMatchSetId</code>.
/// </para>
/// </summary>
/// <param name="sqlInjectionMatchSetId">The <code>SqlInjectionMatchSetId</code> of the <a>SqlInjectionMatchSet</a> that you want to get. <code>SqlInjectionMatchSetId</code> is returned by <a>CreateSqlInjectionMatchSet</a> and by <a>ListSqlInjectionMatchSets</a>.</param>
///
/// <returns>The response from the GetSqlInjectionMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSqlInjectionMatchSet">REST API Reference for GetSqlInjectionMatchSet Operation</seealso>
GetSqlInjectionMatchSetResponse GetSqlInjectionMatchSet(string sqlInjectionMatchSetId);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>SqlInjectionMatchSet</a> that is specified by <code>SqlInjectionMatchSetId</code>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetSqlInjectionMatchSet service method.</param>
///
/// <returns>The response from the GetSqlInjectionMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSqlInjectionMatchSet">REST API Reference for GetSqlInjectionMatchSet Operation</seealso>
GetSqlInjectionMatchSetResponse GetSqlInjectionMatchSet(GetSqlInjectionMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetSqlInjectionMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetSqlInjectionMatchSet operation on AmazonWAFClient.</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 EndGetSqlInjectionMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSqlInjectionMatchSet">REST API Reference for GetSqlInjectionMatchSet Operation</seealso>
IAsyncResult BeginGetSqlInjectionMatchSet(GetSqlInjectionMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetSqlInjectionMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetSqlInjectionMatchSet.</param>
///
/// <returns>Returns a GetSqlInjectionMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSqlInjectionMatchSet">REST API Reference for GetSqlInjectionMatchSet Operation</seealso>
GetSqlInjectionMatchSetResponse EndGetSqlInjectionMatchSet(IAsyncResult asyncResult);
#endregion
#region GetWebACL
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>WebACL</a> that is specified by <code>WebACLId</code>.
/// </para>
/// </summary>
/// <param name="webACLId">The <code>WebACLId</code> of the <a>WebACL</a> that you want to get. <code>WebACLId</code> is returned by <a>CreateWebACL</a> and by <a>ListWebACLs</a>.</param>
///
/// <returns>The response from the GetWebACL service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetWebACL">REST API Reference for GetWebACL Operation</seealso>
GetWebACLResponse GetWebACL(string webACLId);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>WebACL</a> that is specified by <code>WebACLId</code>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetWebACL service method.</param>
///
/// <returns>The response from the GetWebACL service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetWebACL">REST API Reference for GetWebACL Operation</seealso>
GetWebACLResponse GetWebACL(GetWebACLRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetWebACL operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetWebACL operation on AmazonWAFClient.</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 EndGetWebACL
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetWebACL">REST API Reference for GetWebACL Operation</seealso>
IAsyncResult BeginGetWebACL(GetWebACLRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetWebACL operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetWebACL.</param>
///
/// <returns>Returns a GetWebACLResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetWebACL">REST API Reference for GetWebACL Operation</seealso>
GetWebACLResponse EndGetWebACL(IAsyncResult asyncResult);
#endregion
#region GetXssMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns the <a>XssMatchSet</a> that is specified by <code>XssMatchSetId</code>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetXssMatchSet service method.</param>
///
/// <returns>The response from the GetXssMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetXssMatchSet">REST API Reference for GetXssMatchSet Operation</seealso>
GetXssMatchSetResponse GetXssMatchSet(GetXssMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the GetXssMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetXssMatchSet operation on AmazonWAFClient.</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 EndGetXssMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetXssMatchSet">REST API Reference for GetXssMatchSet Operation</seealso>
IAsyncResult BeginGetXssMatchSet(GetXssMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the GetXssMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetXssMatchSet.</param>
///
/// <returns>Returns a GetXssMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetXssMatchSet">REST API Reference for GetXssMatchSet Operation</seealso>
GetXssMatchSetResponse EndGetXssMatchSet(IAsyncResult asyncResult);
#endregion
#region ListActivatedRulesInRuleGroup
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>ActivatedRule</a> objects.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListActivatedRulesInRuleGroup service method.</param>
///
/// <returns>The response from the ListActivatedRulesInRuleGroup service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListActivatedRulesInRuleGroup">REST API Reference for ListActivatedRulesInRuleGroup Operation</seealso>
ListActivatedRulesInRuleGroupResponse ListActivatedRulesInRuleGroup(ListActivatedRulesInRuleGroupRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListActivatedRulesInRuleGroup operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListActivatedRulesInRuleGroup operation on AmazonWAFClient.</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 EndListActivatedRulesInRuleGroup
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListActivatedRulesInRuleGroup">REST API Reference for ListActivatedRulesInRuleGroup Operation</seealso>
IAsyncResult BeginListActivatedRulesInRuleGroup(ListActivatedRulesInRuleGroupRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListActivatedRulesInRuleGroup operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListActivatedRulesInRuleGroup.</param>
///
/// <returns>Returns a ListActivatedRulesInRuleGroupResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListActivatedRulesInRuleGroup">REST API Reference for ListActivatedRulesInRuleGroup Operation</seealso>
ListActivatedRulesInRuleGroupResponse EndListActivatedRulesInRuleGroup(IAsyncResult asyncResult);
#endregion
#region ListByteMatchSets
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>ByteMatchSetSummary</a> objects.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListByteMatchSets service method.</param>
///
/// <returns>The response from the ListByteMatchSets service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListByteMatchSets">REST API Reference for ListByteMatchSets Operation</seealso>
ListByteMatchSetsResponse ListByteMatchSets(ListByteMatchSetsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListByteMatchSets operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListByteMatchSets operation on AmazonWAFClient.</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 EndListByteMatchSets
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListByteMatchSets">REST API Reference for ListByteMatchSets Operation</seealso>
IAsyncResult BeginListByteMatchSets(ListByteMatchSetsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListByteMatchSets operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListByteMatchSets.</param>
///
/// <returns>Returns a ListByteMatchSetsResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListByteMatchSets">REST API Reference for ListByteMatchSets Operation</seealso>
ListByteMatchSetsResponse EndListByteMatchSets(IAsyncResult asyncResult);
#endregion
#region ListGeoMatchSets
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>GeoMatchSetSummary</a> objects in the response.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListGeoMatchSets service method.</param>
///
/// <returns>The response from the ListGeoMatchSets service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListGeoMatchSets">REST API Reference for ListGeoMatchSets Operation</seealso>
ListGeoMatchSetsResponse ListGeoMatchSets(ListGeoMatchSetsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListGeoMatchSets operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListGeoMatchSets operation on AmazonWAFClient.</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 EndListGeoMatchSets
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListGeoMatchSets">REST API Reference for ListGeoMatchSets Operation</seealso>
IAsyncResult BeginListGeoMatchSets(ListGeoMatchSetsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListGeoMatchSets operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListGeoMatchSets.</param>
///
/// <returns>Returns a ListGeoMatchSetsResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListGeoMatchSets">REST API Reference for ListGeoMatchSets Operation</seealso>
ListGeoMatchSetsResponse EndListGeoMatchSets(IAsyncResult asyncResult);
#endregion
#region ListIPSets
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>IPSetSummary</a> objects in the response.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListIPSets service method.</param>
///
/// <returns>The response from the ListIPSets service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListIPSets">REST API Reference for ListIPSets Operation</seealso>
ListIPSetsResponse ListIPSets(ListIPSetsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListIPSets operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListIPSets operation on AmazonWAFClient.</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 EndListIPSets
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListIPSets">REST API Reference for ListIPSets Operation</seealso>
IAsyncResult BeginListIPSets(ListIPSetsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListIPSets operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListIPSets.</param>
///
/// <returns>Returns a ListIPSetsResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListIPSets">REST API Reference for ListIPSets Operation</seealso>
ListIPSetsResponse EndListIPSets(IAsyncResult asyncResult);
#endregion
#region ListLoggingConfigurations
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>LoggingConfiguration</a> objects.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListLoggingConfigurations service method.</param>
///
/// <returns>The response from the ListLoggingConfigurations service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListLoggingConfigurations">REST API Reference for ListLoggingConfigurations Operation</seealso>
ListLoggingConfigurationsResponse ListLoggingConfigurations(ListLoggingConfigurationsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListLoggingConfigurations operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListLoggingConfigurations operation on AmazonWAFClient.</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 EndListLoggingConfigurations
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListLoggingConfigurations">REST API Reference for ListLoggingConfigurations Operation</seealso>
IAsyncResult BeginListLoggingConfigurations(ListLoggingConfigurationsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListLoggingConfigurations operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListLoggingConfigurations.</param>
///
/// <returns>Returns a ListLoggingConfigurationsResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListLoggingConfigurations">REST API Reference for ListLoggingConfigurations Operation</seealso>
ListLoggingConfigurationsResponse EndListLoggingConfigurations(IAsyncResult asyncResult);
#endregion
#region ListRateBasedRules
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>RuleSummary</a> objects.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListRateBasedRules service method.</param>
///
/// <returns>The response from the ListRateBasedRules service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRateBasedRules">REST API Reference for ListRateBasedRules Operation</seealso>
ListRateBasedRulesResponse ListRateBasedRules(ListRateBasedRulesRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListRateBasedRules operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListRateBasedRules operation on AmazonWAFClient.</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 EndListRateBasedRules
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRateBasedRules">REST API Reference for ListRateBasedRules Operation</seealso>
IAsyncResult BeginListRateBasedRules(ListRateBasedRulesRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListRateBasedRules operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListRateBasedRules.</param>
///
/// <returns>Returns a ListRateBasedRulesResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRateBasedRules">REST API Reference for ListRateBasedRules Operation</seealso>
ListRateBasedRulesResponse EndListRateBasedRules(IAsyncResult asyncResult);
#endregion
#region ListRegexMatchSets
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>RegexMatchSetSummary</a> objects.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListRegexMatchSets service method.</param>
///
/// <returns>The response from the ListRegexMatchSets service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRegexMatchSets">REST API Reference for ListRegexMatchSets Operation</seealso>
ListRegexMatchSetsResponse ListRegexMatchSets(ListRegexMatchSetsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListRegexMatchSets operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListRegexMatchSets operation on AmazonWAFClient.</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 EndListRegexMatchSets
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRegexMatchSets">REST API Reference for ListRegexMatchSets Operation</seealso>
IAsyncResult BeginListRegexMatchSets(ListRegexMatchSetsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListRegexMatchSets operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListRegexMatchSets.</param>
///
/// <returns>Returns a ListRegexMatchSetsResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRegexMatchSets">REST API Reference for ListRegexMatchSets Operation</seealso>
ListRegexMatchSetsResponse EndListRegexMatchSets(IAsyncResult asyncResult);
#endregion
#region ListRegexPatternSets
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>RegexPatternSetSummary</a> objects.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListRegexPatternSets service method.</param>
///
/// <returns>The response from the ListRegexPatternSets service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRegexPatternSets">REST API Reference for ListRegexPatternSets Operation</seealso>
ListRegexPatternSetsResponse ListRegexPatternSets(ListRegexPatternSetsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListRegexPatternSets operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListRegexPatternSets operation on AmazonWAFClient.</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 EndListRegexPatternSets
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRegexPatternSets">REST API Reference for ListRegexPatternSets Operation</seealso>
IAsyncResult BeginListRegexPatternSets(ListRegexPatternSetsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListRegexPatternSets operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListRegexPatternSets.</param>
///
/// <returns>Returns a ListRegexPatternSetsResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRegexPatternSets">REST API Reference for ListRegexPatternSets Operation</seealso>
ListRegexPatternSetsResponse EndListRegexPatternSets(IAsyncResult asyncResult);
#endregion
#region ListRuleGroups
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>RuleGroup</a> objects.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListRuleGroups service method.</param>
///
/// <returns>The response from the ListRuleGroups service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRuleGroups">REST API Reference for ListRuleGroups Operation</seealso>
ListRuleGroupsResponse ListRuleGroups(ListRuleGroupsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListRuleGroups operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListRuleGroups operation on AmazonWAFClient.</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 EndListRuleGroups
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRuleGroups">REST API Reference for ListRuleGroups Operation</seealso>
IAsyncResult BeginListRuleGroups(ListRuleGroupsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListRuleGroups operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListRuleGroups.</param>
///
/// <returns>Returns a ListRuleGroupsResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRuleGroups">REST API Reference for ListRuleGroups Operation</seealso>
ListRuleGroupsResponse EndListRuleGroups(IAsyncResult asyncResult);
#endregion
#region ListRules
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>RuleSummary</a> objects.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListRules service method.</param>
///
/// <returns>The response from the ListRules service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRules">REST API Reference for ListRules Operation</seealso>
ListRulesResponse ListRules(ListRulesRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListRules operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListRules operation on AmazonWAFClient.</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 EndListRules
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRules">REST API Reference for ListRules Operation</seealso>
IAsyncResult BeginListRules(ListRulesRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListRules operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListRules.</param>
///
/// <returns>Returns a ListRulesResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListRules">REST API Reference for ListRules Operation</seealso>
ListRulesResponse EndListRules(IAsyncResult asyncResult);
#endregion
#region ListSizeConstraintSets
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>SizeConstraintSetSummary</a> objects.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListSizeConstraintSets service method.</param>
///
/// <returns>The response from the ListSizeConstraintSets service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSizeConstraintSets">REST API Reference for ListSizeConstraintSets Operation</seealso>
ListSizeConstraintSetsResponse ListSizeConstraintSets(ListSizeConstraintSetsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListSizeConstraintSets operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListSizeConstraintSets operation on AmazonWAFClient.</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 EndListSizeConstraintSets
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSizeConstraintSets">REST API Reference for ListSizeConstraintSets Operation</seealso>
IAsyncResult BeginListSizeConstraintSets(ListSizeConstraintSetsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListSizeConstraintSets operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListSizeConstraintSets.</param>
///
/// <returns>Returns a ListSizeConstraintSetsResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSizeConstraintSets">REST API Reference for ListSizeConstraintSets Operation</seealso>
ListSizeConstraintSetsResponse EndListSizeConstraintSets(IAsyncResult asyncResult);
#endregion
#region ListSqlInjectionMatchSets
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>SqlInjectionMatchSet</a> objects.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListSqlInjectionMatchSets service method.</param>
///
/// <returns>The response from the ListSqlInjectionMatchSets service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSqlInjectionMatchSets">REST API Reference for ListSqlInjectionMatchSets Operation</seealso>
ListSqlInjectionMatchSetsResponse ListSqlInjectionMatchSets(ListSqlInjectionMatchSetsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListSqlInjectionMatchSets operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListSqlInjectionMatchSets operation on AmazonWAFClient.</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 EndListSqlInjectionMatchSets
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSqlInjectionMatchSets">REST API Reference for ListSqlInjectionMatchSets Operation</seealso>
IAsyncResult BeginListSqlInjectionMatchSets(ListSqlInjectionMatchSetsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListSqlInjectionMatchSets operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListSqlInjectionMatchSets.</param>
///
/// <returns>Returns a ListSqlInjectionMatchSetsResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSqlInjectionMatchSets">REST API Reference for ListSqlInjectionMatchSets Operation</seealso>
ListSqlInjectionMatchSetsResponse EndListSqlInjectionMatchSets(IAsyncResult asyncResult);
#endregion
#region ListSubscribedRuleGroups
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>RuleGroup</a> objects that you are subscribed to.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListSubscribedRuleGroups service method.</param>
///
/// <returns>The response from the ListSubscribedRuleGroups service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSubscribedRuleGroups">REST API Reference for ListSubscribedRuleGroups Operation</seealso>
ListSubscribedRuleGroupsResponse ListSubscribedRuleGroups(ListSubscribedRuleGroupsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListSubscribedRuleGroups operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListSubscribedRuleGroups operation on AmazonWAFClient.</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 EndListSubscribedRuleGroups
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSubscribedRuleGroups">REST API Reference for ListSubscribedRuleGroups Operation</seealso>
IAsyncResult BeginListSubscribedRuleGroups(ListSubscribedRuleGroupsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListSubscribedRuleGroups operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListSubscribedRuleGroups.</param>
///
/// <returns>Returns a ListSubscribedRuleGroupsResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListSubscribedRuleGroups">REST API Reference for ListSubscribedRuleGroups Operation</seealso>
ListSubscribedRuleGroupsResponse EndListSubscribedRuleGroups(IAsyncResult asyncResult);
#endregion
#region ListTagsForResource
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Retrieves the tags associated with the specified AWS resource. Tags are key:value
/// pairs that you can use to categorize and manage your resources, for purposes like
/// billing. For example, you might set the tag key to "customer" and the value to the
/// customer name or ID. You can specify one or more tags to add to each AWS resource,
/// up to 50 tags for a resource.
/// </para>
///
/// <para>
/// Tagging is only available through the API, SDKs, and CLI. You can't manage or view
/// tags through the AWS WAF Classic console. You can tag the AWS resources that you manage
/// through AWS WAF Classic: web ACLs, rule groups, and rules.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListTagsForResource service method.</param>
///
/// <returns>The response from the ListTagsForResource service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFBadRequestException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationInternalErrorException">
///
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListTagsForResource">REST API Reference for ListTagsForResource Operation</seealso>
ListTagsForResourceResponse ListTagsForResource(ListTagsForResourceRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListTagsForResource operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListTagsForResource operation on AmazonWAFClient.</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 EndListTagsForResource
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListTagsForResource">REST API Reference for ListTagsForResource Operation</seealso>
IAsyncResult BeginListTagsForResource(ListTagsForResourceRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListTagsForResource operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListTagsForResource.</param>
///
/// <returns>Returns a ListTagsForResourceResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListTagsForResource">REST API Reference for ListTagsForResource Operation</seealso>
ListTagsForResourceResponse EndListTagsForResource(IAsyncResult asyncResult);
#endregion
#region ListWebACLs
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>WebACLSummary</a> objects in the response.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListWebACLs service method.</param>
///
/// <returns>The response from the ListWebACLs service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListWebACLs">REST API Reference for ListWebACLs Operation</seealso>
ListWebACLsResponse ListWebACLs(ListWebACLsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListWebACLs operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListWebACLs operation on AmazonWAFClient.</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 EndListWebACLs
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListWebACLs">REST API Reference for ListWebACLs Operation</seealso>
IAsyncResult BeginListWebACLs(ListWebACLsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListWebACLs operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListWebACLs.</param>
///
/// <returns>Returns a ListWebACLsResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListWebACLs">REST API Reference for ListWebACLs Operation</seealso>
ListWebACLsResponse EndListWebACLs(IAsyncResult asyncResult);
#endregion
#region ListXssMatchSets
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Returns an array of <a>XssMatchSet</a> objects.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListXssMatchSets service method.</param>
///
/// <returns>The response from the ListXssMatchSets service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListXssMatchSets">REST API Reference for ListXssMatchSets Operation</seealso>
ListXssMatchSetsResponse ListXssMatchSets(ListXssMatchSetsRequest request);
/// <summary>
/// Initiates the asynchronous execution of the ListXssMatchSets operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListXssMatchSets operation on AmazonWAFClient.</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 EndListXssMatchSets
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListXssMatchSets">REST API Reference for ListXssMatchSets Operation</seealso>
IAsyncResult BeginListXssMatchSets(ListXssMatchSetsRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the ListXssMatchSets operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListXssMatchSets.</param>
///
/// <returns>Returns a ListXssMatchSetsResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListXssMatchSets">REST API Reference for ListXssMatchSets Operation</seealso>
ListXssMatchSetsResponse EndListXssMatchSets(IAsyncResult asyncResult);
#endregion
#region PutLoggingConfiguration
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Associates a <a>LoggingConfiguration</a> with a specified web ACL.
/// </para>
///
/// <para>
/// You can access information about all traffic that AWS WAF inspects using the following
/// steps:
/// </para>
/// <ol> <li>
/// <para>
/// Create an Amazon Kinesis Data Firehose.
/// </para>
///
/// <para>
/// Create the data firehose with a PUT source and in the region that you are operating.
/// However, if you are capturing logs for Amazon CloudFront, always create the firehose
/// in US East (N. Virginia).
/// </para>
/// <note>
/// <para>
/// Do not create the data firehose using a <code>Kinesis stream</code> as your source.
/// </para>
/// </note> </li> <li>
/// <para>
/// Associate that firehose to your web ACL using a <code>PutLoggingConfiguration</code>
/// request.
/// </para>
/// </li> </ol>
/// <para>
/// When you successfully enable logging using a <code>PutLoggingConfiguration</code>
/// request, AWS WAF will create a service linked role with the necessary permissions
/// to write logs to the Amazon Kinesis Data Firehose. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/logging.html">Logging
/// Web ACL Traffic Information</a> in the <i>AWS WAF Developer Guide</i>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the PutLoggingConfiguration service method.</param>
///
/// <returns>The response from the PutLoggingConfiguration service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFServiceLinkedRoleErrorException">
/// AWS WAF is not able to access the service linked role. This can be caused by a previous
/// <code>PutLoggingConfiguration</code> request, which can lock the service linked role
/// for about 20 seconds. Please try your request again. The service linked role can also
/// be locked by a previous <code>DeleteServiceLinkedRole</code> request, which can lock
/// the role for 15 minutes or more. If you recently made a <code>DeleteServiceLinkedRole</code>,
/// wait at least 15 minutes and try the request again. If you receive this same exception
/// again, you will have to wait additional time until the role is unlocked.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/PutLoggingConfiguration">REST API Reference for PutLoggingConfiguration Operation</seealso>
PutLoggingConfigurationResponse PutLoggingConfiguration(PutLoggingConfigurationRequest request);
/// <summary>
/// Initiates the asynchronous execution of the PutLoggingConfiguration operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the PutLoggingConfiguration operation on AmazonWAFClient.</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 EndPutLoggingConfiguration
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/PutLoggingConfiguration">REST API Reference for PutLoggingConfiguration Operation</seealso>
IAsyncResult BeginPutLoggingConfiguration(PutLoggingConfigurationRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the PutLoggingConfiguration operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginPutLoggingConfiguration.</param>
///
/// <returns>Returns a PutLoggingConfigurationResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/PutLoggingConfiguration">REST API Reference for PutLoggingConfiguration Operation</seealso>
PutLoggingConfigurationResponse EndPutLoggingConfiguration(IAsyncResult asyncResult);
#endregion
#region PutPermissionPolicy
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Attaches an IAM policy to the specified resource. The only supported use for this
/// action is to share a RuleGroup across accounts.
/// </para>
///
/// <para>
/// The <code>PutPermissionPolicy</code> is subject to the following restrictions:
/// </para>
/// <ul> <li>
/// <para>
/// You can attach only one policy with each <code>PutPermissionPolicy</code> request.
/// </para>
/// </li> <li>
/// <para>
/// The policy must include an <code>Effect</code>, <code>Action</code> and <code>Principal</code>.
///
/// </para>
/// </li> <li>
/// <para>
/// <code>Effect</code> must specify <code>Allow</code>.
/// </para>
/// </li> <li>
/// <para>
/// The <code>Action</code> in the policy must be <code>waf:UpdateWebACL</code>, <code>waf-regional:UpdateWebACL</code>,
/// <code>waf:GetRuleGroup</code> and <code>waf-regional:GetRuleGroup</code> . Any extra
/// or wildcard actions in the policy will be rejected.
/// </para>
/// </li> <li>
/// <para>
/// The policy cannot include a <code>Resource</code> parameter.
/// </para>
/// </li> <li>
/// <para>
/// The ARN in the request must be a valid WAF RuleGroup ARN and the RuleGroup must exist
/// in the same region.
/// </para>
/// </li> <li>
/// <para>
/// The user making the request must be the owner of the RuleGroup.
/// </para>
/// </li> <li>
/// <para>
/// Your policy must be composed using IAM Policy version 2012-10-17.
/// </para>
/// </li> </ul>
/// <para>
/// For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html">IAM
/// Policies</a>.
/// </para>
///
/// <para>
/// An example of a valid policy parameter is shown in the Examples section below.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the PutPermissionPolicy service method.</param>
///
/// <returns>The response from the PutPermissionPolicy service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidPermissionPolicyException">
/// The operation failed because the specified policy is not in the proper format.
///
///
/// <para>
/// The policy is subject to the following restrictions:
/// </para>
/// <ul> <li>
/// <para>
/// You can attach only one policy with each <code>PutPermissionPolicy</code> request.
/// </para>
/// </li> <li>
/// <para>
/// The policy must include an <code>Effect</code>, <code>Action</code> and <code>Principal</code>.
///
/// </para>
/// </li> <li>
/// <para>
/// <code>Effect</code> must specify <code>Allow</code>.
/// </para>
/// </li> <li>
/// <para>
/// The <code>Action</code> in the policy must be <code>waf:UpdateWebACL</code>, <code>waf-regional:UpdateWebACL</code>,
/// <code>waf:GetRuleGroup</code> and <code>waf-regional:GetRuleGroup</code> . Any extra
/// or wildcard actions in the policy will be rejected.
/// </para>
/// </li> <li>
/// <para>
/// The policy cannot include a <code>Resource</code> parameter.
/// </para>
/// </li> <li>
/// <para>
/// The ARN in the request must be a valid WAF RuleGroup ARN and the RuleGroup must exist
/// in the same region.
/// </para>
/// </li> <li>
/// <para>
/// The user making the request must be the owner of the RuleGroup.
/// </para>
/// </li> <li>
/// <para>
/// Your policy must be composed using IAM Policy version 2012-10-17.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/PutPermissionPolicy">REST API Reference for PutPermissionPolicy Operation</seealso>
PutPermissionPolicyResponse PutPermissionPolicy(PutPermissionPolicyRequest request);
/// <summary>
/// Initiates the asynchronous execution of the PutPermissionPolicy operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the PutPermissionPolicy operation on AmazonWAFClient.</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 EndPutPermissionPolicy
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/PutPermissionPolicy">REST API Reference for PutPermissionPolicy Operation</seealso>
IAsyncResult BeginPutPermissionPolicy(PutPermissionPolicyRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the PutPermissionPolicy operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginPutPermissionPolicy.</param>
///
/// <returns>Returns a PutPermissionPolicyResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/PutPermissionPolicy">REST API Reference for PutPermissionPolicy Operation</seealso>
PutPermissionPolicyResponse EndPutPermissionPolicy(IAsyncResult asyncResult);
#endregion
#region TagResource
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Associates tags with the specified AWS resource. Tags are key:value pairs that you
/// can use to categorize and manage your resources, for purposes like billing. For example,
/// you might set the tag key to "customer" and the value to the customer name or ID.
/// You can specify one or more tags to add to each AWS resource, up to 50 tags for a
/// resource.
/// </para>
///
/// <para>
/// Tagging is only available through the API, SDKs, and CLI. You can't manage or view
/// tags through the AWS WAF Classic console. You can use this action to tag the AWS resources
/// that you manage through AWS WAF Classic: web ACLs, rule groups, and rules.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the TagResource service method.</param>
///
/// <returns>The response from the TagResource service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFBadRequestException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationInternalErrorException">
///
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/TagResource">REST API Reference for TagResource Operation</seealso>
TagResourceResponse TagResource(TagResourceRequest request);
/// <summary>
/// Initiates the asynchronous execution of the TagResource operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the TagResource operation on AmazonWAFClient.</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 EndTagResource
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/TagResource">REST API Reference for TagResource Operation</seealso>
IAsyncResult BeginTagResource(TagResourceRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the TagResource operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginTagResource.</param>
///
/// <returns>Returns a TagResourceResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/TagResource">REST API Reference for TagResource Operation</seealso>
TagResourceResponse EndTagResource(IAsyncResult asyncResult);
#endregion
#region UntagResource
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UntagResource service method.</param>
///
/// <returns>The response from the UntagResource service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFBadRequestException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationException">
///
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFTagOperationInternalErrorException">
///
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UntagResource">REST API Reference for UntagResource Operation</seealso>
UntagResourceResponse UntagResource(UntagResourceRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UntagResource operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UntagResource operation on AmazonWAFClient.</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 EndUntagResource
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UntagResource">REST API Reference for UntagResource Operation</seealso>
IAsyncResult BeginUntagResource(UntagResourceRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UntagResource operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUntagResource.</param>
///
/// <returns>Returns a UntagResourceResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UntagResource">REST API Reference for UntagResource Operation</seealso>
UntagResourceResponse EndUntagResource(IAsyncResult asyncResult);
#endregion
#region UpdateByteMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>ByteMatchTuple</a> objects (filters) in a <a>ByteMatchSet</a>.
/// For each <code>ByteMatchTuple</code> object, you specify the following values:
/// </para>
/// <ul> <li>
/// <para>
/// Whether to insert or delete the object from the array. If you want to change a <code>ByteMatchSetUpdate</code>
/// object, you delete the existing object and add a new one.
/// </para>
/// </li> <li>
/// <para>
/// The part of a web request that you want AWS WAF to inspect, such as a query string
/// or the value of the <code>User-Agent</code> header.
/// </para>
/// </li> <li>
/// <para>
/// The bytes (typically a string that corresponds with ASCII characters) that you want
/// AWS WAF to look for. For more information, including how you specify the values for
/// the AWS WAF API and the AWS CLI or SDKs, see <code>TargetString</code> in the <a>ByteMatchTuple</a>
/// data type.
/// </para>
/// </li> <li>
/// <para>
/// Where to look, such as at the beginning or the end of a query string.
/// </para>
/// </li> <li>
/// <para>
/// Whether to perform any conversions on the request, such as converting it to lowercase,
/// before inspecting it for the specified string.
/// </para>
/// </li> </ul>
/// <para>
/// For example, you can add a <code>ByteMatchSetUpdate</code> object that matches web
/// requests in which <code>User-Agent</code> headers contain the string <code>BadBot</code>.
/// You can then configure AWS WAF to block those requests.
/// </para>
///
/// <para>
/// To create and configure a <code>ByteMatchSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Create a <code>ByteMatchSet.</code> For more information, see <a>CreateByteMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <code>UpdateByteMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateByteMatchSet</code> request to specify the part of the request
/// that you want AWS WAF to inspect (for example, the header or the URI) and the value
/// that you want AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="byteMatchSetId">The <code>ByteMatchSetId</code> of the <a>ByteMatchSet</a> that you want to update. <code>ByteMatchSetId</code> is returned by <a>CreateByteMatchSet</a> and by <a>ListByteMatchSets</a>.</param>
/// <param name="updates">An array of <code>ByteMatchSetUpdate</code> objects that you want to insert into or delete from a <a>ByteMatchSet</a>. For more information, see the applicable data types: <ul> <li> <a>ByteMatchSetUpdate</a>: Contains <code>Action</code> and <code>ByteMatchTuple</code> </li> <li> <a>ByteMatchTuple</a>: Contains <code>FieldToMatch</code>, <code>PositionalConstraint</code>, <code>TargetString</code>, and <code>TextTransformation</code> </li> <li> <a>FieldToMatch</a>: Contains <code>Data</code> and <code>Type</code> </li> </ul></param>
/// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
///
/// <returns>The response from the UpdateByteMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateByteMatchSet">REST API Reference for UpdateByteMatchSet Operation</seealso>
UpdateByteMatchSetResponse UpdateByteMatchSet(string byteMatchSetId, List<ByteMatchSetUpdate> updates, string changeToken);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>ByteMatchTuple</a> objects (filters) in a <a>ByteMatchSet</a>.
/// For each <code>ByteMatchTuple</code> object, you specify the following values:
/// </para>
/// <ul> <li>
/// <para>
/// Whether to insert or delete the object from the array. If you want to change a <code>ByteMatchSetUpdate</code>
/// object, you delete the existing object and add a new one.
/// </para>
/// </li> <li>
/// <para>
/// The part of a web request that you want AWS WAF to inspect, such as a query string
/// or the value of the <code>User-Agent</code> header.
/// </para>
/// </li> <li>
/// <para>
/// The bytes (typically a string that corresponds with ASCII characters) that you want
/// AWS WAF to look for. For more information, including how you specify the values for
/// the AWS WAF API and the AWS CLI or SDKs, see <code>TargetString</code> in the <a>ByteMatchTuple</a>
/// data type.
/// </para>
/// </li> <li>
/// <para>
/// Where to look, such as at the beginning or the end of a query string.
/// </para>
/// </li> <li>
/// <para>
/// Whether to perform any conversions on the request, such as converting it to lowercase,
/// before inspecting it for the specified string.
/// </para>
/// </li> </ul>
/// <para>
/// For example, you can add a <code>ByteMatchSetUpdate</code> object that matches web
/// requests in which <code>User-Agent</code> headers contain the string <code>BadBot</code>.
/// You can then configure AWS WAF to block those requests.
/// </para>
///
/// <para>
/// To create and configure a <code>ByteMatchSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Create a <code>ByteMatchSet.</code> For more information, see <a>CreateByteMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <code>UpdateByteMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateByteMatchSet</code> request to specify the part of the request
/// that you want AWS WAF to inspect (for example, the header or the URI) and the value
/// that you want AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateByteMatchSet service method.</param>
///
/// <returns>The response from the UpdateByteMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateByteMatchSet">REST API Reference for UpdateByteMatchSet Operation</seealso>
UpdateByteMatchSetResponse UpdateByteMatchSet(UpdateByteMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateByteMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateByteMatchSet operation on AmazonWAFClient.</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 EndUpdateByteMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateByteMatchSet">REST API Reference for UpdateByteMatchSet Operation</seealso>
IAsyncResult BeginUpdateByteMatchSet(UpdateByteMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateByteMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateByteMatchSet.</param>
///
/// <returns>Returns a UpdateByteMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateByteMatchSet">REST API Reference for UpdateByteMatchSet Operation</seealso>
UpdateByteMatchSetResponse EndUpdateByteMatchSet(IAsyncResult asyncResult);
#endregion
#region UpdateGeoMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>GeoMatchConstraint</a> objects in an <code>GeoMatchSet</code>.
/// For each <code>GeoMatchConstraint</code> object, you specify the following values:
///
/// </para>
/// <ul> <li>
/// <para>
/// Whether to insert or delete the object from the array. If you want to change an <code>GeoMatchConstraint</code>
/// object, you delete the existing object and add a new one.
/// </para>
/// </li> <li>
/// <para>
/// The <code>Type</code>. The only valid value for <code>Type</code> is <code>Country</code>.
/// </para>
/// </li> <li>
/// <para>
/// The <code>Value</code>, which is a two character code for the country to add to the
/// <code>GeoMatchConstraint</code> object. Valid codes are listed in <a>GeoMatchConstraint$Value</a>.
/// </para>
/// </li> </ul>
/// <para>
/// To create and configure an <code>GeoMatchSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Submit a <a>CreateGeoMatchSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateGeoMatchSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateGeoMatchSet</code> request to specify the country that you want
/// AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// When you update an <code>GeoMatchSet</code>, you specify the country that you want
/// to add and/or the country that you want to delete. If you want to change a country,
/// you delete the existing country and add the new one.
/// </para>
///
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateGeoMatchSet service method.</param>
///
/// <returns>The response from the UpdateGeoMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateGeoMatchSet">REST API Reference for UpdateGeoMatchSet Operation</seealso>
UpdateGeoMatchSetResponse UpdateGeoMatchSet(UpdateGeoMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateGeoMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateGeoMatchSet operation on AmazonWAFClient.</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 EndUpdateGeoMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateGeoMatchSet">REST API Reference for UpdateGeoMatchSet Operation</seealso>
IAsyncResult BeginUpdateGeoMatchSet(UpdateGeoMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateGeoMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateGeoMatchSet.</param>
///
/// <returns>Returns a UpdateGeoMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateGeoMatchSet">REST API Reference for UpdateGeoMatchSet Operation</seealso>
UpdateGeoMatchSetResponse EndUpdateGeoMatchSet(IAsyncResult asyncResult);
#endregion
#region UpdateIPSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>IPSetDescriptor</a> objects in an <code>IPSet</code>. For each
/// <code>IPSetDescriptor</code> object, you specify the following values:
/// </para>
/// <ul> <li>
/// <para>
/// Whether to insert or delete the object from the array. If you want to change an <code>IPSetDescriptor</code>
/// object, you delete the existing object and add a new one.
/// </para>
/// </li> <li>
/// <para>
/// The IP address version, <code>IPv4</code> or <code>IPv6</code>.
/// </para>
/// </li> <li>
/// <para>
/// The IP address in CIDR notation, for example, <code>192.0.2.0/24</code> (for the range
/// of IP addresses from <code>192.0.2.0</code> to <code>192.0.2.255</code>) or <code>192.0.2.44/32</code>
/// (for the individual IP address <code>192.0.2.44</code>).
/// </para>
/// </li> </ul>
/// <para>
/// AWS WAF supports IPv4 address ranges: /8 and any range between /16 through /32. AWS
/// WAF supports IPv6 address ranges: /24, /32, /48, /56, /64, and /128. For more information
/// about CIDR notation, see the Wikipedia entry <a href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing">Classless
/// Inter-Domain Routing</a>.
/// </para>
///
/// <para>
/// IPv6 addresses can be represented using any of the following formats:
/// </para>
/// <ul> <li>
/// <para>
/// 1111:0000:0000:0000:0000:0000:0000:0111/128
/// </para>
/// </li> <li>
/// <para>
/// 1111:0:0:0:0:0:0:0111/128
/// </para>
/// </li> <li>
/// <para>
/// 1111::0111/128
/// </para>
/// </li> <li>
/// <para>
/// 1111::111/128
/// </para>
/// </li> </ul>
/// <para>
/// You use an <code>IPSet</code> to specify which web requests you want to allow or block
/// based on the IP addresses that the requests originated from. For example, if you're
/// receiving a lot of requests from one or a small number of IP addresses and you want
/// to block the requests, you can create an <code>IPSet</code> that specifies those IP
/// addresses, and then configure AWS WAF to block the requests.
/// </para>
///
/// <para>
/// To create and configure an <code>IPSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Submit a <a>CreateIPSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateIPSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateIPSet</code> request to specify the IP addresses that you want
/// AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// When you update an <code>IPSet</code>, you specify the IP addresses that you want
/// to add and/or the IP addresses that you want to delete. If you want to change an IP
/// address, you delete the existing IP address and add the new one.
/// </para>
///
/// <para>
/// You can insert a maximum of 1000 addresses in a single request.
/// </para>
///
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="ipSetId">The <code>IPSetId</code> of the <a>IPSet</a> that you want to update. <code>IPSetId</code> is returned by <a>CreateIPSet</a> and by <a>ListIPSets</a>.</param>
/// <param name="updates">An array of <code>IPSetUpdate</code> objects that you want to insert into or delete from an <a>IPSet</a>. For more information, see the applicable data types: <ul> <li> <a>IPSetUpdate</a>: Contains <code>Action</code> and <code>IPSetDescriptor</code> </li> <li> <a>IPSetDescriptor</a>: Contains <code>Type</code> and <code>Value</code> </li> </ul> You can insert a maximum of 1000 addresses in a single request.</param>
/// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
///
/// <returns>The response from the UpdateIPSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateIPSet">REST API Reference for UpdateIPSet Operation</seealso>
UpdateIPSetResponse UpdateIPSet(string ipSetId, List<IPSetUpdate> updates, string changeToken);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>IPSetDescriptor</a> objects in an <code>IPSet</code>. For each
/// <code>IPSetDescriptor</code> object, you specify the following values:
/// </para>
/// <ul> <li>
/// <para>
/// Whether to insert or delete the object from the array. If you want to change an <code>IPSetDescriptor</code>
/// object, you delete the existing object and add a new one.
/// </para>
/// </li> <li>
/// <para>
/// The IP address version, <code>IPv4</code> or <code>IPv6</code>.
/// </para>
/// </li> <li>
/// <para>
/// The IP address in CIDR notation, for example, <code>192.0.2.0/24</code> (for the range
/// of IP addresses from <code>192.0.2.0</code> to <code>192.0.2.255</code>) or <code>192.0.2.44/32</code>
/// (for the individual IP address <code>192.0.2.44</code>).
/// </para>
/// </li> </ul>
/// <para>
/// AWS WAF supports IPv4 address ranges: /8 and any range between /16 through /32. AWS
/// WAF supports IPv6 address ranges: /24, /32, /48, /56, /64, and /128. For more information
/// about CIDR notation, see the Wikipedia entry <a href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing">Classless
/// Inter-Domain Routing</a>.
/// </para>
///
/// <para>
/// IPv6 addresses can be represented using any of the following formats:
/// </para>
/// <ul> <li>
/// <para>
/// 1111:0000:0000:0000:0000:0000:0000:0111/128
/// </para>
/// </li> <li>
/// <para>
/// 1111:0:0:0:0:0:0:0111/128
/// </para>
/// </li> <li>
/// <para>
/// 1111::0111/128
/// </para>
/// </li> <li>
/// <para>
/// 1111::111/128
/// </para>
/// </li> </ul>
/// <para>
/// You use an <code>IPSet</code> to specify which web requests you want to allow or block
/// based on the IP addresses that the requests originated from. For example, if you're
/// receiving a lot of requests from one or a small number of IP addresses and you want
/// to block the requests, you can create an <code>IPSet</code> that specifies those IP
/// addresses, and then configure AWS WAF to block the requests.
/// </para>
///
/// <para>
/// To create and configure an <code>IPSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Submit a <a>CreateIPSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateIPSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateIPSet</code> request to specify the IP addresses that you want
/// AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// When you update an <code>IPSet</code>, you specify the IP addresses that you want
/// to add and/or the IP addresses that you want to delete. If you want to change an IP
/// address, you delete the existing IP address and add the new one.
/// </para>
///
/// <para>
/// You can insert a maximum of 1000 addresses in a single request.
/// </para>
///
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateIPSet service method.</param>
///
/// <returns>The response from the UpdateIPSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateIPSet">REST API Reference for UpdateIPSet Operation</seealso>
UpdateIPSetResponse UpdateIPSet(UpdateIPSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateIPSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateIPSet operation on AmazonWAFClient.</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 EndUpdateIPSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateIPSet">REST API Reference for UpdateIPSet Operation</seealso>
IAsyncResult BeginUpdateIPSet(UpdateIPSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateIPSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateIPSet.</param>
///
/// <returns>Returns a UpdateIPSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateIPSet">REST API Reference for UpdateIPSet Operation</seealso>
UpdateIPSetResponse EndUpdateIPSet(IAsyncResult asyncResult);
#endregion
#region UpdateRateBasedRule
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>Predicate</a> objects in a rule and updates the <code>RateLimit</code>
/// in the rule.
/// </para>
///
/// <para>
/// Each <code>Predicate</code> object identifies a predicate, such as a <a>ByteMatchSet</a>
/// or an <a>IPSet</a>, that specifies the web requests that you want to block or count.
/// The <code>RateLimit</code> specifies the number of requests every five minutes that
/// triggers the rule.
/// </para>
///
/// <para>
/// If you add more than one predicate to a <code>RateBasedRule</code>, a request must
/// match all the predicates and exceed the <code>RateLimit</code> to be counted or blocked.
/// For example, suppose you add the following to a <code>RateBasedRule</code>:
/// </para>
/// <ul> <li>
/// <para>
/// An <code>IPSet</code> that matches the IP address <code>192.0.2.44/32</code>
/// </para>
/// </li> <li>
/// <para>
/// A <code>ByteMatchSet</code> that matches <code>BadBot</code> in the <code>User-Agent</code>
/// header
/// </para>
/// </li> </ul>
/// <para>
/// Further, you specify a <code>RateLimit</code> of 1,000.
/// </para>
///
/// <para>
/// You then add the <code>RateBasedRule</code> to a <code>WebACL</code> and specify that
/// you want to block requests that satisfy the rule. For a request to be blocked, it
/// must come from the IP address 192.0.2.44 <i>and</i> the <code>User-Agent</code> header
/// in the request must contain the value <code>BadBot</code>. Further, requests that
/// match these two conditions much be received at a rate of more than 1,000 every five
/// minutes. If the rate drops below this limit, AWS WAF no longer blocks the requests.
/// </para>
///
/// <para>
/// As a second example, suppose you want to limit requests to a particular page on your
/// site. To do this, you could add the following to a <code>RateBasedRule</code>:
/// </para>
/// <ul> <li>
/// <para>
/// A <code>ByteMatchSet</code> with <code>FieldToMatch</code> of <code>URI</code>
/// </para>
/// </li> <li>
/// <para>
/// A <code>PositionalConstraint</code> of <code>STARTS_WITH</code>
/// </para>
/// </li> <li>
/// <para>
/// A <code>TargetString</code> of <code>login</code>
/// </para>
/// </li> </ul>
/// <para>
/// Further, you specify a <code>RateLimit</code> of 1,000.
/// </para>
///
/// <para>
/// By adding this <code>RateBasedRule</code> to a <code>WebACL</code>, you could limit
/// requests to your login page without affecting the rest of your site.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateRateBasedRule service method.</param>
///
/// <returns>The response from the UpdateRateBasedRule service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRateBasedRule">REST API Reference for UpdateRateBasedRule Operation</seealso>
UpdateRateBasedRuleResponse UpdateRateBasedRule(UpdateRateBasedRuleRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateRateBasedRule operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateRateBasedRule operation on AmazonWAFClient.</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 EndUpdateRateBasedRule
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRateBasedRule">REST API Reference for UpdateRateBasedRule Operation</seealso>
IAsyncResult BeginUpdateRateBasedRule(UpdateRateBasedRuleRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateRateBasedRule operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateRateBasedRule.</param>
///
/// <returns>Returns a UpdateRateBasedRuleResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRateBasedRule">REST API Reference for UpdateRateBasedRule Operation</seealso>
UpdateRateBasedRuleResponse EndUpdateRateBasedRule(IAsyncResult asyncResult);
#endregion
#region UpdateRegexMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>RegexMatchTuple</a> objects (filters) in a <a>RegexMatchSet</a>.
/// For each <code>RegexMatchSetUpdate</code> object, you specify the following values:
///
/// </para>
/// <ul> <li>
/// <para>
/// Whether to insert or delete the object from the array. If you want to change a <code>RegexMatchSetUpdate</code>
/// object, you delete the existing object and add a new one.
/// </para>
/// </li> <li>
/// <para>
/// The part of a web request that you want AWS WAF to inspectupdate, such as a query
/// string or the value of the <code>User-Agent</code> header.
/// </para>
/// </li> <li>
/// <para>
/// The identifier of the pattern (a regular expression) that you want AWS WAF to look
/// for. For more information, see <a>RegexPatternSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Whether to perform any conversions on the request, such as converting it to lowercase,
/// before inspecting it for the specified string.
/// </para>
/// </li> </ul>
/// <para>
/// For example, you can create a <code>RegexPatternSet</code> that matches any requests
/// with <code>User-Agent</code> headers that contain the string <code>B[a@]dB[o0]t</code>.
/// You can then configure AWS WAF to reject those requests.
/// </para>
///
/// <para>
/// To create and configure a <code>RegexMatchSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Create a <code>RegexMatchSet.</code> For more information, see <a>CreateRegexMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <code>UpdateRegexMatchSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateRegexMatchSet</code> request to specify the part of the request
/// that you want AWS WAF to inspect (for example, the header or the URI) and the identifier
/// of the <code>RegexPatternSet</code> that contain the regular expression patters you
/// want AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateRegexMatchSet service method.</param>
///
/// <returns>The response from the UpdateRegexMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFDisallowedNameException">
/// The name specified is invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRegexMatchSet">REST API Reference for UpdateRegexMatchSet Operation</seealso>
UpdateRegexMatchSetResponse UpdateRegexMatchSet(UpdateRegexMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateRegexMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateRegexMatchSet operation on AmazonWAFClient.</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 EndUpdateRegexMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRegexMatchSet">REST API Reference for UpdateRegexMatchSet Operation</seealso>
IAsyncResult BeginUpdateRegexMatchSet(UpdateRegexMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateRegexMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateRegexMatchSet.</param>
///
/// <returns>Returns a UpdateRegexMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRegexMatchSet">REST API Reference for UpdateRegexMatchSet Operation</seealso>
UpdateRegexMatchSetResponse EndUpdateRegexMatchSet(IAsyncResult asyncResult);
#endregion
#region UpdateRegexPatternSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <code>RegexPatternString</code> objects in a <a>RegexPatternSet</a>.
/// For each <code>RegexPatternString</code> object, you specify the following values:
///
/// </para>
/// <ul> <li>
/// <para>
/// Whether to insert or delete the <code>RegexPatternString</code>.
/// </para>
/// </li> <li>
/// <para>
/// The regular expression pattern that you want to insert or delete. For more information,
/// see <a>RegexPatternSet</a>.
/// </para>
/// </li> </ul>
/// <para>
/// For example, you can create a <code>RegexPatternString</code> such as <code>B[a@]dB[o0]t</code>.
/// AWS WAF will match this <code>RegexPatternString</code> to:
/// </para>
/// <ul> <li>
/// <para>
/// BadBot
/// </para>
/// </li> <li>
/// <para>
/// BadB0t
/// </para>
/// </li> <li>
/// <para>
/// B@dBot
/// </para>
/// </li> <li>
/// <para>
/// B@dB0t
/// </para>
/// </li> </ul>
/// <para>
/// To create and configure a <code>RegexPatternSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Create a <code>RegexPatternSet.</code> For more information, see <a>CreateRegexPatternSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <code>UpdateRegexPatternSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateRegexPatternSet</code> request to specify the regular expression
/// pattern that you want AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateRegexPatternSet service method.</param>
///
/// <returns>The response from the UpdateRegexPatternSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidRegexPatternException">
/// The regular expression (regex) you specified in <code>RegexPatternString</code> is
/// invalid.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRegexPatternSet">REST API Reference for UpdateRegexPatternSet Operation</seealso>
UpdateRegexPatternSetResponse UpdateRegexPatternSet(UpdateRegexPatternSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateRegexPatternSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateRegexPatternSet operation on AmazonWAFClient.</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 EndUpdateRegexPatternSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRegexPatternSet">REST API Reference for UpdateRegexPatternSet Operation</seealso>
IAsyncResult BeginUpdateRegexPatternSet(UpdateRegexPatternSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateRegexPatternSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateRegexPatternSet.</param>
///
/// <returns>Returns a UpdateRegexPatternSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRegexPatternSet">REST API Reference for UpdateRegexPatternSet Operation</seealso>
UpdateRegexPatternSetResponse EndUpdateRegexPatternSet(IAsyncResult asyncResult);
#endregion
#region UpdateRule
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>Predicate</a> objects in a <code>Rule</code>. Each <code>Predicate</code>
/// object identifies a predicate, such as a <a>ByteMatchSet</a> or an <a>IPSet</a>, that
/// specifies the web requests that you want to allow, block, or count. If you add more
/// than one predicate to a <code>Rule</code>, a request must match all of the specifications
/// to be allowed, blocked, or counted. For example, suppose that you add the following
/// to a <code>Rule</code>:
/// </para>
/// <ul> <li>
/// <para>
/// A <code>ByteMatchSet</code> that matches the value <code>BadBot</code> in the <code>User-Agent</code>
/// header
/// </para>
/// </li> <li>
/// <para>
/// An <code>IPSet</code> that matches the IP address <code>192.0.2.44</code>
/// </para>
/// </li> </ul>
/// <para>
/// You then add the <code>Rule</code> to a <code>WebACL</code> and specify that you want
/// to block requests that satisfy the <code>Rule</code>. For a request to be blocked,
/// the <code>User-Agent</code> header in the request must contain the value <code>BadBot</code>
/// <i>and</i> the request must originate from the IP address 192.0.2.44.
/// </para>
///
/// <para>
/// To create and configure a <code>Rule</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Create and update the predicates that you want to include in the <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// Create the <code>Rule</code>. See <a>CreateRule</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateRule</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateRule</code> request to add predicates to the <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// Create and update a <code>WebACL</code> that contains the <code>Rule</code>. See <a>CreateWebACL</a>.
/// </para>
/// </li> </ol>
/// <para>
/// If you want to replace one <code>ByteMatchSet</code> or <code>IPSet</code> with another,
/// you delete the existing one and add the new one.
/// </para>
///
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="ruleId">The <code>RuleId</code> of the <code>Rule</code> that you want to update. <code>RuleId</code> is returned by <code>CreateRule</code> and by <a>ListRules</a>.</param>
/// <param name="updates">An array of <code>RuleUpdate</code> objects that you want to insert into or delete from a <a>Rule</a>. For more information, see the applicable data types: <ul> <li> <a>RuleUpdate</a>: Contains <code>Action</code> and <code>Predicate</code> </li> <li> <a>Predicate</a>: Contains <code>DataId</code>, <code>Negated</code>, and <code>Type</code> </li> <li> <a>FieldToMatch</a>: Contains <code>Data</code> and <code>Type</code> </li> </ul></param>
/// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
///
/// <returns>The response from the UpdateRule service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRule">REST API Reference for UpdateRule Operation</seealso>
UpdateRuleResponse UpdateRule(string ruleId, List<RuleUpdate> updates, string changeToken);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>Predicate</a> objects in a <code>Rule</code>. Each <code>Predicate</code>
/// object identifies a predicate, such as a <a>ByteMatchSet</a> or an <a>IPSet</a>, that
/// specifies the web requests that you want to allow, block, or count. If you add more
/// than one predicate to a <code>Rule</code>, a request must match all of the specifications
/// to be allowed, blocked, or counted. For example, suppose that you add the following
/// to a <code>Rule</code>:
/// </para>
/// <ul> <li>
/// <para>
/// A <code>ByteMatchSet</code> that matches the value <code>BadBot</code> in the <code>User-Agent</code>
/// header
/// </para>
/// </li> <li>
/// <para>
/// An <code>IPSet</code> that matches the IP address <code>192.0.2.44</code>
/// </para>
/// </li> </ul>
/// <para>
/// You then add the <code>Rule</code> to a <code>WebACL</code> and specify that you want
/// to block requests that satisfy the <code>Rule</code>. For a request to be blocked,
/// the <code>User-Agent</code> header in the request must contain the value <code>BadBot</code>
/// <i>and</i> the request must originate from the IP address 192.0.2.44.
/// </para>
///
/// <para>
/// To create and configure a <code>Rule</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Create and update the predicates that you want to include in the <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// Create the <code>Rule</code>. See <a>CreateRule</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateRule</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateRule</code> request to add predicates to the <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// Create and update a <code>WebACL</code> that contains the <code>Rule</code>. See <a>CreateWebACL</a>.
/// </para>
/// </li> </ol>
/// <para>
/// If you want to replace one <code>ByteMatchSet</code> or <code>IPSet</code> with another,
/// you delete the existing one and add the new one.
/// </para>
///
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateRule service method.</param>
///
/// <returns>The response from the UpdateRule service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRule">REST API Reference for UpdateRule Operation</seealso>
UpdateRuleResponse UpdateRule(UpdateRuleRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateRule operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateRule operation on AmazonWAFClient.</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 EndUpdateRule
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRule">REST API Reference for UpdateRule Operation</seealso>
IAsyncResult BeginUpdateRule(UpdateRuleRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateRule operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateRule.</param>
///
/// <returns>Returns a UpdateRuleResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRule">REST API Reference for UpdateRule Operation</seealso>
UpdateRuleResponse EndUpdateRule(IAsyncResult asyncResult);
#endregion
#region UpdateRuleGroup
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>ActivatedRule</a> objects in a <code>RuleGroup</code>.
/// </para>
///
/// <para>
/// You can only insert <code>REGULAR</code> rules into a rule group.
/// </para>
///
/// <para>
/// You can have a maximum of ten rules per rule group.
/// </para>
///
/// <para>
/// To create and configure a <code>RuleGroup</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Create and update the <code>Rules</code> that you want to include in the <code>RuleGroup</code>.
/// See <a>CreateRule</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateRuleGroup</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateRuleGroup</code> request to add <code>Rules</code> to the <code>RuleGroup</code>.
/// </para>
/// </li> <li>
/// <para>
/// Create and update a <code>WebACL</code> that contains the <code>RuleGroup</code>.
/// See <a>CreateWebACL</a>.
/// </para>
/// </li> </ol>
/// <para>
/// If you want to replace one <code>Rule</code> with another, you delete the existing
/// one and add the new one.
/// </para>
///
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateRuleGroup service method.</param>
///
/// <returns>The response from the UpdateRuleGroup service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRuleGroup">REST API Reference for UpdateRuleGroup Operation</seealso>
UpdateRuleGroupResponse UpdateRuleGroup(UpdateRuleGroupRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateRuleGroup operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateRuleGroup operation on AmazonWAFClient.</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 EndUpdateRuleGroup
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRuleGroup">REST API Reference for UpdateRuleGroup Operation</seealso>
IAsyncResult BeginUpdateRuleGroup(UpdateRuleGroupRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateRuleGroup operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateRuleGroup.</param>
///
/// <returns>Returns a UpdateRuleGroupResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRuleGroup">REST API Reference for UpdateRuleGroup Operation</seealso>
UpdateRuleGroupResponse EndUpdateRuleGroup(IAsyncResult asyncResult);
#endregion
#region UpdateSizeConstraintSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>SizeConstraint</a> objects (filters) in a <a>SizeConstraintSet</a>.
/// For each <code>SizeConstraint</code> object, you specify the following values:
/// </para>
/// <ul> <li>
/// <para>
/// Whether to insert or delete the object from the array. If you want to change a <code>SizeConstraintSetUpdate</code>
/// object, you delete the existing object and add a new one.
/// </para>
/// </li> <li>
/// <para>
/// The part of a web request that you want AWS WAF to evaluate, such as the length of
/// a query string or the length of the <code>User-Agent</code> header.
/// </para>
/// </li> <li>
/// <para>
/// Whether to perform any transformations on the request, such as converting it to lowercase,
/// before checking its length. Note that transformations of the request body are not
/// supported because the AWS resource forwards only the first <code>8192</code> bytes
/// of your request to AWS WAF.
/// </para>
///
/// <para>
/// You can only specify a single type of TextTransformation.
/// </para>
/// </li> <li>
/// <para>
/// A <code>ComparisonOperator</code> used for evaluating the selected part of the request
/// against the specified <code>Size</code>, such as equals, greater than, less than,
/// and so on.
/// </para>
/// </li> <li>
/// <para>
/// The length, in bytes, that you want AWS WAF to watch for in selected part of the request.
/// The length is computed after applying the transformation.
/// </para>
/// </li> </ul>
/// <para>
/// For example, you can add a <code>SizeConstraintSetUpdate</code> object that matches
/// web requests in which the length of the <code>User-Agent</code> header is greater
/// than 100 bytes. You can then configure AWS WAF to block those requests.
/// </para>
///
/// <para>
/// To create and configure a <code>SizeConstraintSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Create a <code>SizeConstraintSet.</code> For more information, see <a>CreateSizeConstraintSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <code>UpdateSizeConstraintSet</code> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateSizeConstraintSet</code> request to specify the part of the
/// request that you want AWS WAF to inspect (for example, the header or the URI) and
/// the value that you want AWS WAF to watch for.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateSizeConstraintSet service method.</param>
///
/// <returns>The response from the UpdateSizeConstraintSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSizeConstraintSet">REST API Reference for UpdateSizeConstraintSet Operation</seealso>
UpdateSizeConstraintSetResponse UpdateSizeConstraintSet(UpdateSizeConstraintSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateSizeConstraintSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateSizeConstraintSet operation on AmazonWAFClient.</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 EndUpdateSizeConstraintSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSizeConstraintSet">REST API Reference for UpdateSizeConstraintSet Operation</seealso>
IAsyncResult BeginUpdateSizeConstraintSet(UpdateSizeConstraintSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateSizeConstraintSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateSizeConstraintSet.</param>
///
/// <returns>Returns a UpdateSizeConstraintSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSizeConstraintSet">REST API Reference for UpdateSizeConstraintSet Operation</seealso>
UpdateSizeConstraintSetResponse EndUpdateSizeConstraintSet(IAsyncResult asyncResult);
#endregion
#region UpdateSqlInjectionMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>SqlInjectionMatchTuple</a> objects (filters) in a <a>SqlInjectionMatchSet</a>.
/// For each <code>SqlInjectionMatchTuple</code> object, you specify the following values:
/// </para>
/// <ul> <li>
/// <para>
/// <code>Action</code>: Whether to insert the object into or delete the object from
/// the array. To change a <code>SqlInjectionMatchTuple</code>, you delete the existing
/// object and add a new one.
/// </para>
/// </li> <li>
/// <para>
/// <code>FieldToMatch</code>: The part of web requests that you want AWS WAF to inspect
/// and, if you want AWS WAF to inspect a header or custom query parameter, the name of
/// the header or parameter.
/// </para>
/// </li> <li>
/// <para>
/// <code>TextTransformation</code>: Which text transformation, if any, to perform on
/// the web request before inspecting the request for snippets of malicious SQL code.
/// </para>
///
/// <para>
/// You can only specify a single type of TextTransformation.
/// </para>
/// </li> </ul>
/// <para>
/// You use <code>SqlInjectionMatchSet</code> objects to specify which CloudFront requests
/// that you want to allow, block, or count. For example, if you're receiving requests
/// that contain snippets of SQL code in the query string and you want to block the requests,
/// you can create a <code>SqlInjectionMatchSet</code> with the applicable settings, and
/// then configure AWS WAF to block the requests.
/// </para>
///
/// <para>
/// To create and configure a <code>SqlInjectionMatchSet</code>, perform the following
/// steps:
/// </para>
/// <ol> <li>
/// <para>
/// Submit a <a>CreateSqlInjectionMatchSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateIPSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateSqlInjectionMatchSet</code> request to specify the parts of
/// web requests that you want AWS WAF to inspect for snippets of SQL code.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="sqlInjectionMatchSetId">The <code>SqlInjectionMatchSetId</code> of the <code>SqlInjectionMatchSet</code> that you want to update. <code>SqlInjectionMatchSetId</code> is returned by <a>CreateSqlInjectionMatchSet</a> and by <a>ListSqlInjectionMatchSets</a>.</param>
/// <param name="updates">An array of <code>SqlInjectionMatchSetUpdate</code> objects that you want to insert into or delete from a <a>SqlInjectionMatchSet</a>. For more information, see the applicable data types: <ul> <li> <a>SqlInjectionMatchSetUpdate</a>: Contains <code>Action</code> and <code>SqlInjectionMatchTuple</code> </li> <li> <a>SqlInjectionMatchTuple</a>: Contains <code>FieldToMatch</code> and <code>TextTransformation</code> </li> <li> <a>FieldToMatch</a>: Contains <code>Data</code> and <code>Type</code> </li> </ul></param>
/// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param>
///
/// <returns>The response from the UpdateSqlInjectionMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSqlInjectionMatchSet">REST API Reference for UpdateSqlInjectionMatchSet Operation</seealso>
UpdateSqlInjectionMatchSetResponse UpdateSqlInjectionMatchSet(string sqlInjectionMatchSetId, List<SqlInjectionMatchSetUpdate> updates, string changeToken);
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>SqlInjectionMatchTuple</a> objects (filters) in a <a>SqlInjectionMatchSet</a>.
/// For each <code>SqlInjectionMatchTuple</code> object, you specify the following values:
/// </para>
/// <ul> <li>
/// <para>
/// <code>Action</code>: Whether to insert the object into or delete the object from
/// the array. To change a <code>SqlInjectionMatchTuple</code>, you delete the existing
/// object and add a new one.
/// </para>
/// </li> <li>
/// <para>
/// <code>FieldToMatch</code>: The part of web requests that you want AWS WAF to inspect
/// and, if you want AWS WAF to inspect a header or custom query parameter, the name of
/// the header or parameter.
/// </para>
/// </li> <li>
/// <para>
/// <code>TextTransformation</code>: Which text transformation, if any, to perform on
/// the web request before inspecting the request for snippets of malicious SQL code.
/// </para>
///
/// <para>
/// You can only specify a single type of TextTransformation.
/// </para>
/// </li> </ul>
/// <para>
/// You use <code>SqlInjectionMatchSet</code> objects to specify which CloudFront requests
/// that you want to allow, block, or count. For example, if you're receiving requests
/// that contain snippets of SQL code in the query string and you want to block the requests,
/// you can create a <code>SqlInjectionMatchSet</code> with the applicable settings, and
/// then configure AWS WAF to block the requests.
/// </para>
///
/// <para>
/// To create and configure a <code>SqlInjectionMatchSet</code>, perform the following
/// steps:
/// </para>
/// <ol> <li>
/// <para>
/// Submit a <a>CreateSqlInjectionMatchSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateIPSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateSqlInjectionMatchSet</code> request to specify the parts of
/// web requests that you want AWS WAF to inspect for snippets of SQL code.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateSqlInjectionMatchSet service method.</param>
///
/// <returns>The response from the UpdateSqlInjectionMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSqlInjectionMatchSet">REST API Reference for UpdateSqlInjectionMatchSet Operation</seealso>
UpdateSqlInjectionMatchSetResponse UpdateSqlInjectionMatchSet(UpdateSqlInjectionMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateSqlInjectionMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateSqlInjectionMatchSet operation on AmazonWAFClient.</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 EndUpdateSqlInjectionMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSqlInjectionMatchSet">REST API Reference for UpdateSqlInjectionMatchSet Operation</seealso>
IAsyncResult BeginUpdateSqlInjectionMatchSet(UpdateSqlInjectionMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateSqlInjectionMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateSqlInjectionMatchSet.</param>
///
/// <returns>Returns a UpdateSqlInjectionMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateSqlInjectionMatchSet">REST API Reference for UpdateSqlInjectionMatchSet Operation</seealso>
UpdateSqlInjectionMatchSetResponse EndUpdateSqlInjectionMatchSet(IAsyncResult asyncResult);
#endregion
#region UpdateWebACL
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>ActivatedRule</a> objects in a <code>WebACL</code>. Each <code>Rule</code>
/// identifies web requests that you want to allow, block, or count. When you update a
/// <code>WebACL</code>, you specify the following values:
/// </para>
/// <ul> <li>
/// <para>
/// A default action for the <code>WebACL</code>, either <code>ALLOW</code> or <code>BLOCK</code>.
/// AWS WAF performs the default action if a request doesn't match the criteria in any
/// of the <code>Rules</code> in a <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// The <code>Rules</code> that you want to add or delete. If you want to replace one
/// <code>Rule</code> with another, you delete the existing <code>Rule</code> and add
/// the new one.
/// </para>
/// </li> <li>
/// <para>
/// For each <code>Rule</code>, whether you want AWS WAF to allow requests, block requests,
/// or count requests that match the conditions in the <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// The order in which you want AWS WAF to evaluate the <code>Rules</code> in a <code>WebACL</code>.
/// If you add more than one <code>Rule</code> to a <code>WebACL</code>, AWS WAF evaluates
/// each request against the <code>Rules</code> in order based on the value of <code>Priority</code>.
/// (The <code>Rule</code> that has the lowest value for <code>Priority</code> is evaluated
/// first.) When a web request matches all the predicates (such as <code>ByteMatchSets</code>
/// and <code>IPSets</code>) in a <code>Rule</code>, AWS WAF immediately takes the corresponding
/// action, allow or block, and doesn't evaluate the request against the remaining <code>Rules</code>
/// in the <code>WebACL</code>, if any.
/// </para>
/// </li> </ul>
/// <para>
/// To create and configure a <code>WebACL</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Create and update the predicates that you want to include in <code>Rules</code>. For
/// more information, see <a>CreateByteMatchSet</a>, <a>UpdateByteMatchSet</a>, <a>CreateIPSet</a>,
/// <a>UpdateIPSet</a>, <a>CreateSqlInjectionMatchSet</a>, and <a>UpdateSqlInjectionMatchSet</a>.
/// </para>
/// </li> <li>
/// <para>
/// Create and update the <code>Rules</code> that you want to include in the <code>WebACL</code>.
/// For more information, see <a>CreateRule</a> and <a>UpdateRule</a>.
/// </para>
/// </li> <li>
/// <para>
/// Create a <code>WebACL</code>. See <a>CreateWebACL</a>.
/// </para>
/// </li> <li>
/// <para>
/// Use <code>GetChangeToken</code> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateWebACL</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateWebACL</code> request to specify the <code>Rules</code> that
/// you want to include in the <code>WebACL</code>, to specify the default action, and
/// to associate the <code>WebACL</code> with a CloudFront distribution.
/// </para>
///
/// <para>
/// The <code>ActivatedRule</code> can be a rule group. If you specify a rule group as
/// your <code>ActivatedRule</code> , you can exclude specific rules from that rule group.
/// </para>
///
/// <para>
/// If you already have a rule group associated with a web ACL and want to submit an <code>UpdateWebACL</code>
/// request to exclude certain rules from that rule group, you must first remove the rule
/// group from the web ACL, the re-insert it again, specifying the excluded rules. For
/// details, see <a>ActivatedRule$ExcludedRules</a> .
/// </para>
/// </li> </ol>
/// <para>
/// Be aware that if you try to add a RATE_BASED rule to a web ACL without setting the
/// rule type when first creating the rule, the <a>UpdateWebACL</a> request will fail
/// because the request tries to add a REGULAR rule (the default rule type) with the specified
/// ID, which does not exist.
/// </para>
///
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateWebACL service method.</param>
///
/// <returns>The response from the UpdateWebACL service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFReferencedItemException">
/// The operation failed because you tried to delete an object that is still in use. For
/// example:
///
/// <ul> <li>
/// <para>
/// You tried to delete a <code>ByteMatchSet</code> that is still referenced by a <code>Rule</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to delete a <code>Rule</code> that is still referenced by a <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFSubscriptionNotFoundException">
/// The specified subscription does not exist.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateWebACL">REST API Reference for UpdateWebACL Operation</seealso>
UpdateWebACLResponse UpdateWebACL(UpdateWebACLRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateWebACL operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateWebACL operation on AmazonWAFClient.</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 EndUpdateWebACL
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateWebACL">REST API Reference for UpdateWebACL Operation</seealso>
IAsyncResult BeginUpdateWebACL(UpdateWebACLRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateWebACL operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateWebACL.</param>
///
/// <returns>Returns a UpdateWebACLResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateWebACL">REST API Reference for UpdateWebACL Operation</seealso>
UpdateWebACLResponse EndUpdateWebACL(IAsyncResult asyncResult);
#endregion
#region UpdateXssMatchSet
/// <summary>
/// <note>
/// <para>
/// This is <b>AWS WAF Classic</b> documentation. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html">AWS
/// WAF Classic</a> in the developer guide.
/// </para>
///
/// <para>
/// <b>For the latest version of AWS WAF</b>, use the AWS WAFV2 API and see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html">AWS
/// WAF Developer Guide</a>. With the latest version, AWS WAF has a single set of endpoints
/// for regional and global use.
/// </para>
/// </note>
/// <para>
/// Inserts or deletes <a>XssMatchTuple</a> objects (filters) in an <a>XssMatchSet</a>.
/// For each <code>XssMatchTuple</code> object, you specify the following values:
/// </para>
/// <ul> <li>
/// <para>
/// <code>Action</code>: Whether to insert the object into or delete the object from
/// the array. To change an <code>XssMatchTuple</code>, you delete the existing object
/// and add a new one.
/// </para>
/// </li> <li>
/// <para>
/// <code>FieldToMatch</code>: The part of web requests that you want AWS WAF to inspect
/// and, if you want AWS WAF to inspect a header or custom query parameter, the name of
/// the header or parameter.
/// </para>
/// </li> <li>
/// <para>
/// <code>TextTransformation</code>: Which text transformation, if any, to perform on
/// the web request before inspecting the request for cross-site scripting attacks.
/// </para>
///
/// <para>
/// You can only specify a single type of TextTransformation.
/// </para>
/// </li> </ul>
/// <para>
/// You use <code>XssMatchSet</code> objects to specify which CloudFront requests that
/// you want to allow, block, or count. For example, if you're receiving requests that
/// contain cross-site scripting attacks in the request body and you want to block the
/// requests, you can create an <code>XssMatchSet</code> with the applicable settings,
/// and then configure AWS WAF to block the requests.
/// </para>
///
/// <para>
/// To create and configure an <code>XssMatchSet</code>, perform the following steps:
/// </para>
/// <ol> <li>
/// <para>
/// Submit a <a>CreateXssMatchSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Use <a>GetChangeToken</a> to get the change token that you provide in the <code>ChangeToken</code>
/// parameter of an <a>UpdateIPSet</a> request.
/// </para>
/// </li> <li>
/// <para>
/// Submit an <code>UpdateXssMatchSet</code> request to specify the parts of web requests
/// that you want AWS WAF to inspect for cross-site scripting attacks.
/// </para>
/// </li> </ol>
/// <para>
/// For more information about how to use the AWS WAF API to allow or block HTTP requests,
/// see the <a href="https://docs.aws.amazon.com/waf/latest/developerguide/">AWS WAF Developer
/// Guide</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateXssMatchSet service method.</param>
///
/// <returns>The response from the UpdateXssMatchSet service method, as returned by WAF.</returns>
/// <exception cref="Amazon.WAF.Model.WAFInternalErrorException">
/// The operation failed because of a system problem, even though the request was valid.
/// Retry your request.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException">
/// The operation failed because you tried to create, update, or delete an object by using
/// an invalid account identifier.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidOperationException">
/// The operation failed because there was nothing to do. For example:
///
/// <ul> <li>
/// <para>
/// You tried to remove a <code>Rule</code> from a <code>WebACL</code>, but the <code>Rule</code>
/// isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove an IP address from an <code>IPSet</code>, but the IP address isn't
/// in the specified <code>IPSet</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to remove a <code>ByteMatchTuple</code> from a <code>ByteMatchSet</code>,
/// but the <code>ByteMatchTuple</code> isn't in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>Rule</code> to a <code>WebACL</code>, but the <code>Rule</code>
/// already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to a <code>ByteMatchSet</code>, but
/// the <code>ByteMatchTuple</code> already exists in the specified <code>WebACL</code>.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFInvalidParameterException">
/// The operation failed because AWS WAF didn't recognize a parameter in the request.
/// For example:
///
/// <ul> <li>
/// <para>
/// You specified an invalid parameter name.
/// </para>
/// </li> <li>
/// <para>
/// You specified an invalid value.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update an object (<code>ByteMatchSet</code>, <code>IPSet</code>, <code>Rule</code>,
/// or <code>WebACL</code>) using an action other than <code>INSERT</code> or <code>DELETE</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>WebACL</code> with a <code>DefaultAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to create a <code>RateBasedRule</code> with a <code>RateKey</code> value
/// other than <code>IP</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>WebACL</code> with a <code>WafAction</code> <code>Type</code>
/// other than <code>ALLOW</code>, <code>BLOCK</code>, or <code>COUNT</code>.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>FieldToMatch</code> <code>Type</code>
/// other than HEADER, METHOD, QUERY_STRING, URI, or BODY.
/// </para>
/// </li> <li>
/// <para>
/// You tried to update a <code>ByteMatchSet</code> with a <code>Field</code> of <code>HEADER</code>
/// but no value for <code>Data</code>.
/// </para>
/// </li> <li>
/// <para>
/// Your request references an ARN that is malformed, or corresponds to a resource with
/// which a web ACL cannot be associated.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFLimitsExceededException">
/// The operation exceeds a resource limit, for example, the maximum number of <code>WebACL</code>
/// objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">Limits</a>
/// in the <i>AWS WAF Developer Guide</i>.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentContainerException">
/// The operation failed because you tried to add an object to or delete an object from
/// another object that doesn't exist. For example:
///
/// <ul> <li>
/// <para>
/// You tried to add a <code>Rule</code> to or delete a <code>Rule</code> from a <code>WebACL</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchSet</code> to or delete a <code>ByteMatchSet</code>
/// from a <code>Rule</code> that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add an IP address to or delete an IP address from an <code>IPSet</code>
/// that doesn't exist.
/// </para>
/// </li> <li>
/// <para>
/// You tried to add a <code>ByteMatchTuple</code> to or delete a <code>ByteMatchTuple</code>
/// from a <code>ByteMatchSet</code> that doesn't exist.
/// </para>
/// </li> </ul>
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException">
/// The operation failed because the referenced object doesn't exist.
/// </exception>
/// <exception cref="Amazon.WAF.Model.WAFStaleDataException">
/// The operation failed because you tried to create, update, or delete an object by using
/// a change token that has already been used.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateXssMatchSet">REST API Reference for UpdateXssMatchSet Operation</seealso>
UpdateXssMatchSetResponse UpdateXssMatchSet(UpdateXssMatchSetRequest request);
/// <summary>
/// Initiates the asynchronous execution of the UpdateXssMatchSet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateXssMatchSet operation on AmazonWAFClient.</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 EndUpdateXssMatchSet
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateXssMatchSet">REST API Reference for UpdateXssMatchSet Operation</seealso>
IAsyncResult BeginUpdateXssMatchSet(UpdateXssMatchSetRequest request, AsyncCallback callback, object state);
/// <summary>
/// Finishes the asynchronous execution of the UpdateXssMatchSet operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateXssMatchSet.</param>
///
/// <returns>Returns a UpdateXssMatchSetResult from WAF.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateXssMatchSet">REST API Reference for UpdateXssMatchSet Operation</seealso>
UpdateXssMatchSetResponse EndUpdateXssMatchSet(IAsyncResult asyncResult);
#endregion
}
} | 52.29179 | 578 | 0.598948 | [
"Apache-2.0"
] | ChristopherButtars/aws-sdk-net | sdk/src/Services/WAF/Generated/_bcl35/IAmazonWAF.cs | 617,200 | C# |
ο»Ώusing System;
using System.IO;
using Wave.Platform.Messaging;
using Wave.Services;
namespace Wave.Platform
{
public abstract class BlockDefinition : DefinitionBase, ICacheable
{
public HintsDictionary RenderingHints { get; protected set; }
public UIHintedType HintedType { get { return RenderingHints.HintedType; } }
public CropStrategy BackgroundImageCrop { get; protected set; }
public bool SizeToBackgroundImage { get; protected set; }
public BlockDefinition()
: base()
{
RenderingHints = new HintsDictionary();
BackgroundImageCrop = 0;
SizeToBackgroundImage = false;
}
protected void UnpackBlockHints(FieldList source)
{
string renderingHintsSource = source[DefAgentFieldID.Hint].AsString();
if (!String.IsNullOrEmpty(renderingHintsSource))
RenderingHints.Parse(renderingHintsSource);
}
#region ICacheable implementation
public override CacheableType StoredType
{
get { return CacheableType.Unsupported; }
}
public override void Persist(Stream str)
{
base.Persist(str);
str.WriteByte(0);
RenderingHints.Persist(str);
}
public override void Restore(Stream str)
{
base.Restore(str);
if (str.ReadByte() == 0)
RenderingHints.Restore(str);
}
#endregion
}
}
| 26.433333 | 85 | 0.580706 | [
"MIT"
] | futurix/cms-cli | Explorer/Phone/Client/Platform/Definitions/Infrastructure/BlockDefinition.cs | 1,588 | C# |
ο»Ώusing System;
using System.Collections.Generic;
using Uno.Extensions;
using Uno.UI;
#if XAMARIN_ANDROID
using View = Android.Views.View;
#elif XAMARIN_IOS_UNIFIED
using View = UIKit.UIView;
#elif __MACOS__
using View = AppKit.NSView;
#elif XAMARIN_IOS
using View = MonoTouch.UIKit.UIView;
#else
using View = Windows.UI.Xaml.UIElement;
#endif
namespace Windows.UI.Xaml
{
public partial class FrameworkTemplate : DependencyObject
{
private readonly Func<View> _viewFactory;
private readonly int _hashCode;
/// <summary>
/// The scope at the time of the template's creation, which will be used when its contents are materialized.
/// </summary>
private readonly XamlScope _xamlScope;
protected FrameworkTemplate() { }
public FrameworkTemplate(Func<View> factory)
{
InitializeBinder();
_viewFactory = factory;
// Compute the hash for this template once, it will be used a lot
// in the ControlPool's internal dictionary.
_hashCode = (factory.Target?.GetHashCode() ?? 0) ^ factory.Method.GetHashCode();
_xamlScope = ResourceResolver.CurrentScope;
}
public static implicit operator Func<View>(FrameworkTemplate obj)
{
return obj?._viewFactory;
}
/// <summary>
/// Loads a potentially cached template from the current template, see remarks for more details.
/// </summary>
/// <returns>A potentially cached instance of the template</returns>
/// <remarks>
/// The owner of the template is the system, which means that an
/// instance that has been detached from its parent may be reused at any time.
/// If a control needs to be the owner of a created instance, it needs to use <see cref="LoadContent"/>.
/// </remarks>
internal View LoadContentCached() => FrameworkTemplatePool.Instance.DequeueTemplate(this);
/// <summary>
/// Manually return an unused template root created by <see cref="LoadContentCached"/> to the pool.
/// </summary>
/// <remarks>
/// This is only used in specialized contexts. Normally the template reuse will be automatically handled by the pool.
/// </remarks>
internal void ReleaseTemplateRoot(View templateRoot) => FrameworkTemplatePool.Instance.ReleaseTemplateRoot(templateRoot, this);
/// <summary>
/// Creates a new instance of the current template.
/// </summary>
/// <returns>A new instance of the template</returns>
public View LoadContent()
{
View view = null;
#if !HAS_EXPENSIVE_TRYFINALLY
try
#endif
{
ResourceResolver.PushNewScope(_xamlScope);
view = _viewFactory();
}
#if !HAS_EXPENSIVE_TRYFINALLY
finally
#endif
{
ResourceResolver.PopScope();
}
return view;
}
public override bool Equals(object obj)
{
var other = obj as FrameworkTemplate;
if (other != null)
{
if (FrameworkTemplateEqualityComparer.Default.Equals(other, this))
{
return true;
}
}
return base.Equals(obj);
}
public override int GetHashCode() => _hashCode;
#if DEBUG
public string TemplateSource => $"{_viewFactory?.Method.DeclaringType}.{_viewFactory?.Method.Name}";
#endif
internal class FrameworkTemplateEqualityComparer : IEqualityComparer<FrameworkTemplate>
{
public static readonly FrameworkTemplateEqualityComparer Default = new FrameworkTemplateEqualityComparer();
private FrameworkTemplateEqualityComparer() { }
public bool Equals(FrameworkTemplate left, FrameworkTemplate right) =>
// Same instance
ReferenceEquals(left, right)
// Same delegate (possible if the delegate was created from a
// lambda, which are cached automatically by the C# compiler (as of v6.0)
|| left._viewFactory == right._viewFactory
// Same target method (instance or static) (possible if the delegate was created from a
// method group, which are *not* cached by the C# compiler (required by
// the C# spec as of version 6.0)
|| (
ReferenceEquals(left._viewFactory.Target, right._viewFactory.Target)
&& left._viewFactory.Method == right._viewFactory.Method
);
public int GetHashCode(FrameworkTemplate obj) => obj._hashCode;
}
}
}
| 28.795775 | 129 | 0.718513 | [
"Apache-2.0"
] | AnshSSonkhia/uno | src/Uno.UI/UI/Xaml/FrameworkTemplate.cs | 4,091 | C# |
ο»Ώusing System;
using System.Collections.Generic;
using System.Text;
namespace CSharpComplete
{
class StudentEncapsulation
{
private int _id;
private string _name;
private int _passmarks = 35;
public string Email { get; set; }
public int Id
{
get
{
return this._id;
}
set
{
if (value <= 0)
{
throw new Exception("Id cannot be negative");
}
else
{
this._id=value;
}
}
}
public string Name
{
get
{
return this._name;
}
set
{
if (value.Length <= 0)
throw new Exception("Name should be present ");
this._name = value;
}
}
public int Passmarks { get { return this._passmarks; } }
}
}
| 21.75 | 67 | 0.39272 | [
"Apache-2.0"
] | manas1803/CSharp | Code/CSharpComplete/StudentEncapsulation.cs | 1,046 | C# |
ο»Ώ//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Cake.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyProduct("SplunkTracing")]
[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyCopyright("Copyright (c) Splunk 2019 - 2019")]
[assembly: InternalsVisibleTo("SplunkTracing.Tests,PublicKey=002400000480000094000000060200000024000052534131000400000100010099deeadb052e9763d2dc7827700d80e349e5d16585c92416171e6689a4bd38a3acea971d5899d5e2cd4239c3dc799558138e961f8d0f5095fef969672172833868f2cc2d908970370af834beef9dad328182fee2aaf0d0bb568ffd1f829362b88718734541d334c6a2cdf0049f5a0ee5e4962d0db3f49f86bf742f9531bd9c8c")]
| 55.235294 | 384 | 0.705005 | [
"MIT"
] | splnkit/splunk-tracer-csharp | src/SplunkTracing/Properties/AssemblyInfo.cs | 941 | C# |
ο»Ώnamespace AcmeCorp.EventSourcingExampleApp.Payments.MessageHandlers
{
using AcmeCorp.EventSourcingExampleApp.Payments.Contracts.Messages.Commands;
public class SubmitPaymentDetailsV1Handler : IHandleMessage<SubmitPaymentDetailsV1>
{
private readonly IPaymentsDataStore paymentsDataStore;
private readonly IApplicationLogger applicationLogger;
public SubmitPaymentDetailsV1Handler(IPaymentsDataStore paymentsDataStore, IApplicationLogger applicationLogger)
{
this.paymentsDataStore = paymentsDataStore;
this.applicationLogger = applicationLogger;
}
public void Handle(SubmitPaymentDetailsV1 message)
{
this.applicationLogger.HandlerProcessingMessage(this, message);
this.paymentsDataStore.Save(message.OrderId, message.PaymentDetails);
}
}
}
| 37.956522 | 120 | 0.744559 | [
"MIT"
] | AcmeCorp/EventSourcingExampleApp | Source/AcmeCorp.EventSourcingExampleApp.Payments/MessageHandlers/SubmitPaymentDetailsV1Handler.cs | 875 | 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.Runtime.InteropServices;
internal static partial class Interop
{
/// <summary>Common Unix errno error codes.</summary>
internal enum Error
{
// These values were defined in src/Native/System.Native/fxerrno.h
//
// They compare against values obtained via Interop.Sys.GetLastError() not Marshal.GetLastWin32Error()
// which obtains the raw errno that varies between unixes. The strong typing as an enum is meant to
// prevent confusing the two. Casting to or from int is suspect. Use GetLastErrorInfo() if you need to
// correlate these to the underlying platform values or obtain the corresponding error message.
//
SUCCESS = 0,
E2BIG = 0x10001, // Argument list too long.
EACCES = 0x10002, // Permission denied.
EADDRINUSE = 0x10003, // Address in use.
EADDRNOTAVAIL = 0x10004, // Address not available.
EAFNOSUPPORT = 0x10005, // Address family not supported.
EAGAIN = 0x10006, // Resource unavailable, try again (same value as EWOULDBLOCK),
EALREADY = 0x10007, // Connection already in progress.
EBADF = 0x10008, // Bad file descriptor.
EBADMSG = 0x10009, // Bad message.
EBUSY = 0x1000A, // Device or resource busy.
ECANCELED = 0x1000B, // Operation canceled.
ECHILD = 0x1000C, // No child processes.
ECONNABORTED = 0x1000D, // Connection aborted.
ECONNREFUSED = 0x1000E, // Connection refused.
ECONNRESET = 0x1000F, // Connection reset.
EDEADLK = 0x10010, // Resource deadlock would occur.
EDESTADDRREQ = 0x10011, // Destination address required.
EDOM = 0x10012, // Mathematics argument out of domain of function.
EDQUOT = 0x10013, // Reserved.
EEXIST = 0x10014, // File exists.
EFAULT = 0x10015, // Bad address.
EFBIG = 0x10016, // File too large.
EHOSTUNREACH = 0x10017, // Host is unreachable.
EIDRM = 0x10018, // Identifier removed.
EILSEQ = 0x10019, // Illegal byte sequence.
EINPROGRESS = 0x1001A, // Operation in progress.
EINTR = 0x1001B, // Interrupted function.
EINVAL = 0x1001C, // Invalid argument.
EIO = 0x1001D, // I/O error.
EISCONN = 0x1001E, // Socket is connected.
EISDIR = 0x1001F, // Is a directory.
ELOOP = 0x10020, // Too many levels of symbolic links.
EMFILE = 0x10021, // File descriptor value too large.
EMLINK = 0x10022, // Too many links.
EMSGSIZE = 0x10023, // Message too large.
EMULTIHOP = 0x10024, // Reserved.
ENAMETOOLONG = 0x10025, // Filename too long.
ENETDOWN = 0x10026, // Network is down.
ENETRESET = 0x10027, // Connection aborted by network.
ENETUNREACH = 0x10028, // Network unreachable.
ENFILE = 0x10029, // Too many files open in system.
ENOBUFS = 0x1002A, // No buffer space available.
ENODEV = 0x1002C, // No such device.
ENOENT = 0x1002D, // No such file or directory.
ENOEXEC = 0x1002E, // Executable file format error.
ENOLCK = 0x1002F, // No locks available.
ENOLINK = 0x10030, // Reserved.
ENOMEM = 0x10031, // Not enough space.
ENOMSG = 0x10032, // No message of the desired type.
ENOPROTOOPT = 0x10033, // Protocol not available.
ENOSPC = 0x10034, // No space left on device.
ENOSYS = 0x10037, // Function not supported.
ENOTCONN = 0x10038, // The socket is not connected.
ENOTDIR = 0x10039, // Not a directory or a symbolic link to a directory.
ENOTEMPTY = 0x1003A, // Directory not empty.
ENOTRECOVERABLE = 0x1003B, // State not recoverable.
ENOTSOCK = 0x1003C, // Not a socket.
ENOTSUP = 0x1003D, // Not supported (same value as EOPNOTSUP).
ENOTTY = 0x1003E, // Inappropriate I/O control operation.
ENXIO = 0x1003F, // No such device or address.
EOVERFLOW = 0x10040, // Value too large to be stored in data type.
EOWNERDEAD = 0x10041, // Previous owner died.
EPERM = 0x10042, // Operation not permitted.
EPIPE = 0x10043, // Broken pipe.
EPROTO = 0x10044, // Protocol error.
EPROTONOSUPPORT = 0x10045, // Protocol not supported.
EPROTOTYPE = 0x10046, // Protocol wrong type for socket.
ERANGE = 0x10047, // Result too large.
EROFS = 0x10048, // Read-only file system.
ESPIPE = 0x10049, // Invalid seek.
ESRCH = 0x1004A, // No such process.
ESTALE = 0x1004B, // Reserved.
ETIMEDOUT = 0x1004D, // Connection timed out.
ETXTBSY = 0x1004E, // Text file busy.
EXDEV = 0x1004F, // Cross-device link.
ESOCKTNOSUPPORT = 0x1005E, // Socket type not supported.
EPFNOSUPPORT = 0x10060, // Protocol family not supported.
ESHUTDOWN = 0x1006C, // Socket shutdown.
EHOSTDOWN = 0x10070, // Host is down.
ENODATA = 0x10071, // No data available.
// Custom Error codes to track errors beyond kernel interface.
EHOSTNOTFOUND = 0x20001, // Name lookup failed
// POSIX permits these to have the same value and we make them always equal so
// that we do not introduce a dependency on distinguishing between them that
// would not work on all platforms.
EOPNOTSUPP = ENOTSUP, // Operation not supported on socket.
EWOULDBLOCK = EAGAIN, // Operation would block.
}
// Represents a platform-agnostic Error and underlying platform-specific errno
internal struct ErrorInfo
{
private Error _error;
private int _rawErrno;
internal ErrorInfo(int errno)
{
_error = Interop.Sys.ConvertErrorPlatformToPal(errno);
_rawErrno = errno;
}
internal ErrorInfo(Error error)
{
_error = error;
_rawErrno = -1;
}
internal Error Error
{
get { return _error; }
}
internal int RawErrno
{
get { return _rawErrno == -1 ? (_rawErrno = Interop.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; }
}
internal string GetErrorMessage()
{
return Interop.Sys.StrError(RawErrno);
}
public override string ToString()
{
return $"RawErrno: {RawErrno} Error: {Error} GetErrorMessage: {GetErrorMessage()}"; // No localization required; text is member names used for debugging purposes
}
}
internal static partial class Sys
{
internal static Error GetLastError()
{
return ConvertErrorPlatformToPal(Marshal.GetLastWin32Error());
}
internal static ErrorInfo GetLastErrorInfo()
{
return new ErrorInfo(Marshal.GetLastWin32Error());
}
internal static unsafe string StrError(int platformErrno)
{
int maxBufferLength = 1024; // should be long enough for most any UNIX error
byte* buffer = stackalloc byte[maxBufferLength];
byte* message = StrErrorR(platformErrno, buffer, maxBufferLength);
if (message == null)
{
// This means the buffer was not large enough, but still contains
// as much of the error message as possible and is guaranteed to
// be null-terminated. We're not currently resizing/retrying because
// maxBufferLength is large enough in practice, but we could do
// so here in the future if necessary.
message = buffer;
}
return Marshal.PtrToStringAnsi((IntPtr)message)!;
}
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPlatformToPal")]
internal static extern Error ConvertErrorPlatformToPal(int platformErrno);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPalToPlatform")]
internal static extern int ConvertErrorPalToPlatform(Error error);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StrErrorR")]
private static extern unsafe byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize);
}
}
// NOTE: extension method can't be nested inside Interop class.
internal static class InteropErrorExtensions
{
// Intended usage is e.g. Interop.Error.EFAIL.Info() for brevity
// vs. new Interop.ErrorInfo(Interop.Error.EFAIL) for synthesizing
// errors. Errors originated from the system should be obtained
// via GetLastErrorInfo(), not GetLastError().Info() as that will
// convert twice, which is not only inefficient but also lossy if
// we ever encounter a raw errno that no equivalent in the Error
// enum.
public static Interop.ErrorInfo Info(this Interop.Error error)
{
return new Interop.ErrorInfo(error);
}
}
| 50.720379 | 173 | 0.546253 | [
"MIT"
] | AArnott/runtime | src/libraries/Common/src/Interop/Unix/Interop.Errors.cs | 10,702 | C# |
ο»Ώ// Copyright (c) 2012-2017 fo-dicom contributors.
// Licensed under the Microsoft Public License (MS-PL).
using Dicom.Imaging.LUT;
namespace Dicom.Imaging.Render
{
/// <summary>
/// Pipeline interface
/// </summary>
public interface IPipeline
{
/// <summary>
/// Get the LUT of the pipeline
/// </summary>
ILUT LUT { get; }
}
}
| 20.421053 | 55 | 0.585052 | [
"BSD-3-Clause"
] | aerik/fo-dicom | DICOM/Imaging/Render/IPipeline.cs | 390 | C# |
//---------------------------------------------------------------------------------------------
// This file was AUTO-GENERATED by "EF Domain Objects" Xomega.Net generator.
//
// Manual CHANGES to this file WILL BE LOST when the code is regenerated.
//---------------------------------------------------------------------------------------------
using System;
namespace AdventureWorks.Services.Entities
{
///<summary>
/// Companies from whom Adventure Works Cycles purchases parts or other goods.
///</summary>
public partial class Vendor
{
public Vendor()
{
}
#region Properties
public int BusinessEntityId { get; set; }
///<summary>
/// Vendor account (identification) number.
///</summary>
public string AccountNumber { get; set; }
///<summary>
/// Company name.
///</summary>
public string Name { get; set; }
///<summary>
/// 1 = Superior, 2 = Excellent, 3 = Above average, 4 = Average, 5 = Below average
///</summary>
public byte CreditRating { get; set; }
///<summary>
/// 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the same product.
///</summary>
public bool PreferredVendorStatus { get; set; }
///<summary>
/// 0 = Vendor no longer used. 1 = Vendor is actively used.
///</summary>
public bool ActiveFlag { get; set; }
///<summary>
/// Vendor URL.
///</summary>
public string PurchasingWebServiceUrl { get; set; }
///<summary>
/// Date and time the record was last updated.
///</summary>
public DateTime ModifiedDate { get; set; }
#endregion
#region Navigation Properties
///<summary>
/// BusinessEntity object referenced by the field BusinessEntityId.
///</summary>
public virtual BusinessEntity BusinessEntityObject { get; set; }
#endregion
}
} | 29.528571 | 119 | 0.518626 | [
"MIT"
] | Xomega-Net/Xomega.Examples | AdventureWorks/AdventureWorks.Services.Entities/Entities/Purchasing/Vendor.cs | 2,067 | 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 pinpoint-email-2018-07-26.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Amazon.PinpointEmail.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.PinpointEmail.Model.Internal.MarshallTransformations
{
/// <summary>
/// CreateConfigurationSet Request Marshaller
/// </summary>
public class CreateConfigurationSetRequestMarshaller : IMarshaller<IRequest, CreateConfigurationSetRequest> , IMarshaller<IRequest,AmazonWebServiceRequest>
{
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public IRequest Marshall(AmazonWebServiceRequest input)
{
return this.Marshall((CreateConfigurationSetRequest)input);
}
/// <summary>
/// Marshaller the request object to the HTTP request.
/// </summary>
/// <param name="publicRequest"></param>
/// <returns></returns>
public IRequest Marshall(CreateConfigurationSetRequest publicRequest)
{
IRequest request = new DefaultRequest(publicRequest, "Amazon.PinpointEmail");
request.Headers["Content-Type"] = "application/json";
request.Headers[Amazon.Util.HeaderKeys.XAmzApiVersion] = "2018-07-26";
request.HttpMethod = "POST";
request.ResourcePath = "/v1/email/configuration-sets";
using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
{
JsonWriter writer = new JsonWriter(stringWriter);
writer.WriteObjectStart();
var context = new JsonMarshallerContext(request, writer);
if(publicRequest.IsSetConfigurationSetName())
{
context.Writer.WritePropertyName("ConfigurationSetName");
context.Writer.Write(publicRequest.ConfigurationSetName);
}
if(publicRequest.IsSetDeliveryOptions())
{
context.Writer.WritePropertyName("DeliveryOptions");
context.Writer.WriteObjectStart();
var marshaller = DeliveryOptionsMarshaller.Instance;
marshaller.Marshall(publicRequest.DeliveryOptions, context);
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetReputationOptions())
{
context.Writer.WritePropertyName("ReputationOptions");
context.Writer.WriteObjectStart();
var marshaller = ReputationOptionsMarshaller.Instance;
marshaller.Marshall(publicRequest.ReputationOptions, context);
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetSendingOptions())
{
context.Writer.WritePropertyName("SendingOptions");
context.Writer.WriteObjectStart();
var marshaller = SendingOptionsMarshaller.Instance;
marshaller.Marshall(publicRequest.SendingOptions, context);
context.Writer.WriteObjectEnd();
}
if(publicRequest.IsSetTags())
{
context.Writer.WritePropertyName("Tags");
context.Writer.WriteArrayStart();
foreach(var publicRequestTagsListValue in publicRequest.Tags)
{
context.Writer.WriteObjectStart();
var marshaller = TagMarshaller.Instance;
marshaller.Marshall(publicRequestTagsListValue, context);
context.Writer.WriteObjectEnd();
}
context.Writer.WriteArrayEnd();
}
if(publicRequest.IsSetTrackingOptions())
{
context.Writer.WritePropertyName("TrackingOptions");
context.Writer.WriteObjectStart();
var marshaller = TrackingOptionsMarshaller.Instance;
marshaller.Marshall(publicRequest.TrackingOptions, context);
context.Writer.WriteObjectEnd();
}
writer.WriteObjectEnd();
string snippet = stringWriter.ToString();
request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
}
return request;
}
private static CreateConfigurationSetRequestMarshaller _instance = new CreateConfigurationSetRequestMarshaller();
internal static CreateConfigurationSetRequestMarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static CreateConfigurationSetRequestMarshaller Instance
{
get
{
return _instance;
}
}
}
} | 37.291925 | 159 | 0.600433 | [
"Apache-2.0"
] | Hazy87/aws-sdk-net | sdk/src/Services/PinpointEmail/Generated/Model/Internal/MarshallTransformations/CreateConfigurationSetRequestMarshaller.cs | 6,004 | C# |
ο»Ώusing System;
using System.Collections.Generic;
#nullable disable
namespace Desafio.Net.Models
{
public partial class Customer
{
public Customer()
{
CustomerCustomerDemos = new HashSet<CustomerCustomerDemo>();
Orders = new HashSet<Order>();
}
public string CustomerId { get; set; }
public string CompanyName { get; set; }
public string ContactName { get; set; }
public string ContactTitle { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string Region { get; set; }
public string PostalCode { get; set; }
public string Country { get; set; }
public string Phone { get; set; }
public string Fax { get; set; }
public virtual ICollection<CustomerCustomerDemo> CustomerCustomerDemos { get; set; }
public virtual ICollection<Order> Orders { get; set; }
}
}
| 30.03125 | 92 | 0.611863 | [
"MIT"
] | thiagoraheem/Desafio-DotNet | Backend/Desafio.Net/Desafio.Net/Models/Customer.cs | 963 | C# |
ο»Ώ#region References
using System;
using System.Linq;
using System.Linq.Expressions;
using Speedy.Collections;
#endregion
namespace Speedy.Extensions
{
/// <summary>
/// Extensions for queryable
/// </summary>
public static class QueryableExtensions
{
#region Methods
/// <summary>
/// Gets paged results.
/// </summary>
/// <typeparam name="T1"> The type of item in the query. </typeparam>
/// <typeparam name="T2"> The type of the item returned. </typeparam>
/// <param name="query"> The queryable collection. </param>
/// <param name="request"> The request values. </param>
/// <param name="transform"> The function to transfer the results. </param>
/// <param name="order"> An optional order of the collection. </param>
/// <returns> The paged results. </returns>
public static PagedResults<T2> GetPagedResults<T1, T2>(this IQueryable<T1> query, PagedRequest request, Func<T1, T2> transform, Expression<Func<T1, object>> order = null)
{
return GetPagedResults(query, request, transform, order == null ? null : new OrderBy<T1>(order));
}
/// <summary>
/// Gets paged results.
/// </summary>
/// <typeparam name="T1"> The type of item in the query. </typeparam>
/// <typeparam name="T2"> The type of the item returned. </typeparam>
/// <param name="query"> The queryable collection. </param>
/// <param name="request"> The request values. </param>
/// <param name="transform"> The function to transfer the results. </param>
/// <param name="order"> The order of the collection. </param>
/// <param name="thenBys"> An optional then bys to order the collection. </param>
/// <returns> The paged results. </returns>
public static PagedResults<T2> GetPagedResults<T1, T2>(this IQueryable<T1> query, PagedRequest request, Func<T1, T2> transform, OrderBy<T1> order, params OrderBy<T1>[] thenBys)
{
var orderedQuery = order?.Process(query, thenBys) ?? query;
var response = new PagedResults<T2>
{
Filter = request.Filter,
FilterValues = request.FilterValues,
Including = request.Including,
TotalCount = query.Count(),
Order = request.Order,
PerPage = request.PerPage
};
response.Page = response.TotalPages < request.Page ? response.TotalPages : request.Page;
response.Results = new BaseObservableCollection<T2>(orderedQuery
.Skip((response.Page - 1) * response.PerPage)
.Take(response.PerPage)
.ToList()
.Select(transform)
.ToList());
return response;
}
/// <summary>
/// Gets paged results.
/// </summary>
/// <typeparam name="T1"> The type of item in the query. </typeparam>
/// <typeparam name="T2"> The type of the item returned. </typeparam>
/// <param name="query"> The queryable collection. </param>
/// <param name="request"> The request values. </param>
/// <param name="transform"> The function to transfer the results. </param>
/// <returns> The paged results. </returns>
public static PagedResults<T2> GetPagedResults<T1, T2>(this IQueryable<T1> query, PagedRequest request, Func<T1, T2> transform)
{
var response = new PagedResults<T2>
{
Filter = request.Filter,
FilterValues = request.FilterValues,
TotalCount = query.Count(),
Order = request.Order,
PerPage = request.PerPage
};
response.Page = response.TotalPages < request.Page ? response.TotalPages : request.Page;
response.Results = new BaseObservableCollection<T2>(query
.Skip((response.Page - 1) * response.PerPage)
.Take(response.PerPage)
.ToList()
.Select(transform)
.ToList());
return response;
}
#endregion
}
} | 35.323529 | 178 | 0.677213 | [
"MIT"
] | BobbyCannon/Speedy | Speedy/Extensions/QueryableExtensions.cs | 3,605 | C# |
using CoreWiki.Configuration.Settings;
using CoreWiki.Configuration.Startup;
using CoreWiki.Data.EntityFramework.Security;
using CoreWiki.FirstStart;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
namespace CoreWiki
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.ConfigureAutomapper();
services.ConfigureRSSFeed();
services.Configure<AppSettings>(Configuration);
services.ConfigureSecurityAndAuthentication();
services.ConfigureDatabase(Configuration);
services.ConfigureScopedServices(Configuration);
services.ConfigureHttpClients();
services.ConfigureRouting();
services.ConfigureLocalisation();
services.ConfigureApplicationServices();
services.AddMediator();
services.AddFirstStartConfiguration(Configuration);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, IOptionsSnapshot<AppSettings> settings, UserManager<CoreWikiUser> userManager, RoleManager<IdentityRole> roleManager)
{
app.ConfigureTelemetry();
app.ConfigureExceptions(env);
app.ConfigureSecurityHeaders(env);
app.ConfigureRouting();
app.InitializeData(Configuration);
app.UseFirstStartConfiguration(env, Configuration, () => Program.Restart());
var theTask = app.ConfigureAuthentication(userManager, roleManager);
theTask.GetAwaiter().GetResult();
app.ConfigureRSSFeed(settings);
app.ConfigureLocalisation();
app.UseStatusCodePagesWithReExecute("/HttpErrors/{0}");
app.UseMvc();
}
}
}
| 32.4 | 192 | 0.765907 | [
"MIT"
] | danielmpetrov/CoreWiki | CoreWiki/Startup.cs | 2,042 | C# |
/****************************************************************************
* Copyright (c) 2017 snowcold
* Copyright (c) 2017 liangxie
*
* http://liangxiegame.com
* https://github.com/liangxiegame/QFramework
* https://github.com/liangxiegame/QSingleton
* https://github.com/liangxiegame/QChain
*
* 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 QFramework
{
using System;
public class LinkedListTest : BaseTestUnit
{
public override void StartTest()
{
TestInt();
TestString();
}
#region String Test
private void TestString()
{
WriteBegin("LinkListTest(String)");
QLinkedList<string> list = new QLinkedList<string>();
BuildStringLinkedListRandom(list, 0, 10);
BuildStringLinkedListRandom(list, 11, 20);
RemoveListAtIndex(list, 19);
RemoveListAtIndex(list, 0);
RemoveData(list, "Index:7");
VisitList(list);
FindData(list, "Index:9");
WriteEnd("LinkListTest(String)");
}
private void BuildStringLinkedListRandom(QLinkedList<string> list, int start, int end)
{
for (int i = start; i <= end; ++i)
{
list.InsertTail(string.Format("Index:{0}", i));
}
WriteLine("Build:[{0}:{1}]", start, end);
}
#endregion
#region Int Test
private void TestInt()
{
WriteBegin("LinkListTest(Int)");
QLinkedList<int> list = new QLinkedList<int>();
BuildIntLinkedListRandom(list, 0, 10);
BuildIntLinkedListRandom(list, 11, 20);
RemoveListAtIndex(list, 19);
RemoveListAtIndex(list, 0);
RemoveData(list, 7);
VisitList(list);
FindData(list, 9);
WriteEnd("LinkListTest(Int)");
}
private void BuildIntLinkedListRandom(QLinkedList<int> list, int start, int end)
{
for (int i = start; i <= end; ++i)
{
list.InsertTail(i);
}
WriteLine("Build:[{0}:{1}]", start, end);
}
#endregion
private void RemoveListAtIndex<T>(QLinkedList<T> list, int index)
{
WriteLine("Remove At:{0}-Result:{1}", index, list.RemoveAt(index));
}
private void RemoveData<T>(QLinkedList<T> list, T data)
{
WriteLine("Remove Data:{0}-Result:{1}", data, list.Remove(data));
}
private void VisitList<T>(QLinkedList<T> list)
{
WriteLine("Data Begin:");
list.Accept(VisitData);
WriteLine("");
}
protected void FindData<T>(QLinkedList<T> list, T data)
{
WriteLine("FindData{0}: Result:{1}", data, list.Query(data));
}
protected void VisitData<T>(T data)
{
if (data != null)
{
Write(string.Format(" {0}", data));
}
else
{
Write(" NULL ");
}
}
}
}
| 33.101563 | 94 | 0.561954 | [
"MIT"
] | UniPM/UniPM | Core/CSharp/Utils/DataStructure/List/Test/LinkedListTest.cs | 4,237 | C# |
ο»Ώusing CommonCore.UI;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace UITestScene
{
public class UITestSceneController : MonoBehaviour
{
public Text TestText;
public TextAnimation TextAnim;
public void OnClickStart()
{
TextAnim = TextAnimation.TypeOn(TestText, "This is a test string!", 3.0f);
}
public void OnClickAbort()
{
TextAnim.Abort();
}
public void OnClickComplete()
{
TextAnim.Complete();
}
}
} | 19.612903 | 86 | 0.600329 | [
"MIT"
] | XCVG/californium_dr | Assets/Scenes/Other/UITestScene/UITestSceneController.cs | 610 | C# |
ο»Ώnamespace BCKFreightTMS.Web.ViewModels
{
public class ErrorViewModel
{
public string RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(this.RequestId);
}
}
| 21.1 | 75 | 0.672986 | [
"MIT"
] | MMSlavov/BCKFreight | src/Web/BCKFreightTMS.Web.ViewModels/ErrorViewModel.cs | 213 | C# |
namespace GeneXus.Application
{
using System;
using System.Collections;
using System.IO;
using GeneXus.Configuration;
using log4net;
using System.Collections.Generic;
using System.Web;
using System.Threading;
#if NETCORE
using Microsoft.AspNetCore.Http;
#else
using System.Web.Configuration;
#endif
using System.Xml;
using GeneXus.Http;
using System.Collections.Concurrent;
public class GXFileWatcher : IDisposable
{
static readonly ILog log = log4net.LogManager.GetLogger(typeof(GXFileWatcher));
private static volatile GXFileWatcher m_Instance;
private static object m_SyncRoot = new Object();
TimeSpan TIMEOUT;
private static bool DISABLED;
long TIMEOUT_TICKS;
ConcurrentDictionary<int, List<GxFile>> tmpFiles;
Dictionary<string,List<GxFile>> webappTmpFiles;
bool running=false;
CancellationTokenSource cts = new CancellationTokenSource();
public static GXFileWatcher Instance
{
get
{
if (m_Instance == null)
{
lock (m_SyncRoot)
{
if (m_Instance == null)
m_Instance = new GXFileWatcher();
}
}
return m_Instance;
}
}
private GXFileWatcher()
{
webappTmpFiles = new Dictionary<string, List<GxFile>>();
string fwTimeout = string.Empty;
long result = 0;
string delete;
if (Config.GetValueOf("DELETE_ALL_TEMP_FILES", out delete) && (delete.Equals("0") || delete.StartsWith("N", StringComparison.OrdinalIgnoreCase)))
{
DISABLED = true;
}
if (Config.GetValueOf("FILEWATCHER_TIMEOUT", out fwTimeout) && Int64.TryParse(fwTimeout, out result))
{
TIMEOUT = TimeSpan.FromSeconds(result);
GXLogging.Debug(log, "TIMEOUT (from FILEWATCHER_TIMEOUT)", () => TIMEOUT.TotalSeconds + " seconds");
}
else
{
var webconfig = Path.Combine(GxContext.StaticPhysicalPath(), "web.config");
if (File.Exists(webconfig))
{
XmlDocument inventory = new XmlDocument();
inventory.Load(webconfig);
double secondsTime;
XmlNode element = inventory.SelectSingleNode("//configuration/system.web/httpRuntime/@executionTimeout");
if (element != null)
{
if (!string.IsNullOrEmpty(element.Value) && double.TryParse(element.Value, out secondsTime))
{
TIMEOUT = TimeSpan.FromSeconds(secondsTime);
GXLogging.Debug(log, "TIMEOUT (from system.web/httpRuntime ExecutionTimeout)", () => TIMEOUT.TotalSeconds + " seconds");
}
}
}
}
if (TIMEOUT.TotalSeconds == 0)
TIMEOUT = TimeSpan.FromSeconds(110);
TIMEOUT_TICKS = TIMEOUT.Ticks;
}
public void AsyncDeleteFiles(GxDirectory directory)
{
GXLogging.Debug(log, "DeleteFiles ", directory.GetName());
try
{
if (!DISABLED && directory.Exists())
{
Thread t = new Thread(new ParameterizedThreadStart(DeleteFiles));
t.Priority = ThreadPriority.BelowNormal;
t.IsBackground = true;
t.Start(directory);
}
}
catch (Exception ex)
{
GXLogging.Error(log, "DeleteFiles error", ex);
}
}
private void DeleteFiles(object odirectory)
{
try
{
GxDirectory directory = (GxDirectory)odirectory;
long now = DateTime.Now.Ticks;
foreach (GxFile file in directory.GetFiles("*.*"))
{
if (ExpiredFile(file.GetAbsoluteName(), now))
{
file.Delete();
}
GXLogging.Debug(log, "DeleteFiles ", file.GetName());
}
}
catch (Exception ex)
{
GXLogging.Error(log, "DeleteFiles error", ex);
}
}
public void AddTemporaryFile(GxFile FileUploaded, IGxContext gxcontext)
{
if (!DISABLED)
{
GXLogging.Debug(log, "AddTemporaryFile ", FileUploaded.Source);
HttpContext httpcontext = gxcontext.HttpContext;
#if !NETCORE
if (httpcontext==null)
httpcontext =HttpContext.Current;
#endif
if (httpcontext != null)
{
try
{
string sessionId;
if (httpcontext.Session != null)
{
#if NETCORE
sessionId = httpcontext.Session.Id;
#else
sessionId = httpcontext.Session.SessionID;
#endif
}
else
sessionId = "nullsession";
List<GxFile> sessionTmpFiles;
lock (m_SyncRoot)
{
if (webappTmpFiles.ContainsKey(sessionId))
sessionTmpFiles = (List<GxFile>)webappTmpFiles[sessionId];
else
sessionTmpFiles = new List<GxFile>();
sessionTmpFiles.Add(FileUploaded);
webappTmpFiles[sessionId] = sessionTmpFiles;
}
}
catch (Exception exc)
{
GXLogging.Error(log, "AddTemporaryFile Error", exc);
}
lock (m_SyncRoot)
{
if (!running)
{
running = true;
GXLogging.Debug(log, "ThreadStart GXFileWatcher.Instance.Run");
ThreadPool.QueueUserWorkItem(new WaitCallback(GXFileWatcher.Instance.Run), cts.Token);
}
}
}
else
{
if (tmpFiles == null)
tmpFiles = new ConcurrentDictionary<int, List<GxFile>>();
lock (tmpFiles)
{
if (!tmpFiles.ContainsKey(gxcontext.handle))
tmpFiles[gxcontext.handle] = new List<GxFile>();
tmpFiles[gxcontext.handle].Add(FileUploaded);
}
}
}
}
private void Run(object obj)
{
if (!DISABLED)
{
CancellationToken token = (CancellationToken)obj;
while (true && !token.IsCancellationRequested)
{
Thread.Sleep(TIMEOUT);
GXLogging.Debug(log, "loop start ");
DeleteWebAppTemporaryFiles(false);
GXLogging.Debug(log, "loop end ");
}
}
}
private bool ExpiredFile(string filename, long since)
{
return (File.Exists(filename) && since - File.GetLastAccessTime(filename).Ticks > TIMEOUT_TICKS);
}
private void DeleteWebAppTemporaryFiles(bool disposing)
{
if (webappTmpFiles != null && webappTmpFiles.Count > 0)
{
long now = DateTime.Now.Ticks;
ArrayList toRemove = new ArrayList();
try
{
foreach (string sessionId in webappTmpFiles.Keys)
{
List<GxFile> files = new List<GxFile>();
webappTmpFiles.TryGetValue(sessionId, out files);
if (files != null && files.Count > 0)
{
var lastFileName = files[files.Count - 1].GetURI();
if (disposing || ExpiredFile(lastFileName, now))
{
try
{
lock (m_SyncRoot)
{
foreach (GxFile f in files)
{
#pragma warning disable SCS0018 // Path traversal: injection possible in {1} argument passed to '{0}'
f.Delete();
#pragma warning restore SCS0018 // Path traversal: injection possible in {1} argument passed to '{0}'
GXLogging.Debug(log, "File.Delete ", f.GetURI());
}
}
}
catch (Exception ex)
{
GXLogging.Error(log, "File.Delete error sessionid ", sessionId, ex);
}
toRemove.Add(sessionId);
}
}
}
}
catch (Exception ex1)
{
GXLogging.Error(log, "MoveNext webappTmpFiles error ", ex1);
}
try
{
foreach (string sessionId in toRemove)
{
webappTmpFiles.Remove(sessionId);
}
}
catch (Exception ex2)
{
GXLogging.Error(log, "Remove webappTmpFiles error", ex2);
}
}
}
public void DeleteTemporaryFiles(int handle)
{
GXLogging.Debug(log, "DeleteTemporaryFiles handle: " + handle);
if (!DISABLED)
{
if (tmpFiles != null)
{
lock (tmpFiles)
{
if (tmpFiles.ContainsKey(handle))
{
foreach (GxFile s in tmpFiles[handle])
{
s.Delete();
GXLogging.Debug(log, "File.Delete ", s.GetAbsoluteName());
}
tmpFiles[handle].Clear();
}
}
}
}
}
#region IDisposable Members
public void Dispose()
{
if (!DISABLED)
{
GXLogging.Debug(log, "GXFileWatcher Dispose");
if (running)
{
cts.Cancel();
}
DeleteWebAppTemporaryFiles(true);
}
}
#endregion
}
}
| 25.347403 | 148 | 0.63379 | [
"Apache-2.0"
] | genexuslabs/DotNetClasses | dotnet/src/dotnetframework/GxClasses/Helpers/GXFileWatcher.cs | 7,807 | C# |
ο»Ώusing Cofoundry.Core.MessageAggregator;
using Cofoundry.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Cofoundry.BasicTestSite
{
public class BlogPostMessageSubscriptionRegistration : IMessageSubscriptionRegistration
{
public void Register(IMessageSubscriptionConfig config)
{
config.Subscribe<ICustomEntityContentUpdatedMessage, BlogPostUpdatedMessageHandler>();
}
}
}
| 27.111111 | 98 | 0.770492 | [
"MIT"
] | BOBO41/cofoundry | src/Cofoundry.BasicTestSite/Cofoundry/CustomEntities/BlogPosts/MessageHandlers/BlogPostMessageSubscriptionRegistration.cs | 490 | C# |
ο»Ώ// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using DurableTask.AzureStorage;
using Microsoft.Azure.WebJobs.Host.TestCommon;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.WindowsAzure.Storage;
using Newtonsoft.Json.Linq;
using Xunit;
using Xunit.Abstractions;
namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Tests
{
internal static class TestHelpers
{
// Friendly strings for provider types so easier to read in enumerated test output
public const string AzureStorageProviderType = "azure_storage";
public const string EmulatorProviderType = "emulator";
public const string RedisProviderType = "redis";
public const string LogCategory = "Host.Triggers.DurableTask";
public const string EmptyStorageProviderType = "empty";
public static ITestHost GetJobHost(
ILoggerProvider loggerProvider,
string testName,
bool enableExtendedSessions,
string eventGridKeySettingName = null,
INameResolver nameResolver = null,
string eventGridTopicEndpoint = null,
int? eventGridRetryCount = null,
TimeSpan? eventGridRetryInterval = null,
int[] eventGridRetryHttpStatus = null,
bool traceReplayEvents = true,
Uri notificationUrl = null,
HttpMessageHandler eventGridNotificationHandler = null,
TimeSpan? maxQueuePollingInterval = null,
string[] eventGridPublishEventTypes = null,
string storageProviderType = AzureStorageProviderType,
bool autoFetchLargeMessages = true,
int httpAsyncSleepTime = 500,
IDurableHttpMessageHandlerFactory durableHttpMessageHandler = null,
ILifeCycleNotificationHelper lifeCycleNotificationHelper = null,
IMessageSerializerSettingsFactory serializerSettings = null,
bool? localRpcEndpointEnabled = false,
DurableTaskOptions options = null,
bool rollbackEntityOperationsOnExceptions = true)
{
switch (storageProviderType)
{
case AzureStorageProviderType:
#if !FUNCTIONS_V1
case RedisProviderType:
case EmulatorProviderType:
#endif
break;
default:
throw new InvalidOperationException($"Storage provider {storageProviderType} is not supported for testing infrastructure.");
}
if (options == null)
{
options = new DurableTaskOptions();
}
options.HubName = GetTaskHubNameFromTestName(testName, enableExtendedSessions);
options.Tracing = new TraceOptions()
{
TraceInputsAndOutputs = true,
TraceReplayEvents = traceReplayEvents,
};
options.Notifications = new NotificationOptions()
{
EventGrid = new EventGridNotificationOptions()
{
KeySettingName = eventGridKeySettingName,
TopicEndpoint = eventGridTopicEndpoint,
PublishEventTypes = eventGridPublishEventTypes,
},
};
options.HttpSettings = new HttpOptions()
{
DefaultAsyncRequestSleepTimeMilliseconds = httpAsyncSleepTime,
};
options.NotificationUrl = notificationUrl;
options.ExtendedSessionsEnabled = enableExtendedSessions;
options.MaxConcurrentOrchestratorFunctions = 200;
options.MaxConcurrentActivityFunctions = 200;
options.NotificationHandler = eventGridNotificationHandler;
options.LocalRpcEndpointEnabled = localRpcEndpointEnabled;
options.RollbackEntityOperationsOnExceptions = rollbackEntityOperationsOnExceptions;
// Azure Storage specfic tests
if (string.Equals(storageProviderType, AzureStorageProviderType))
{
options.StorageProvider["fetchLargeMessagesAutomatically"] = autoFetchLargeMessages;
if (maxQueuePollingInterval != null)
{
options.StorageProvider["maxQueuePollingInterval"] = maxQueuePollingInterval.Value;
}
}
if (eventGridRetryCount.HasValue)
{
options.Notifications.EventGrid.PublishRetryCount = eventGridRetryCount.Value;
}
if (eventGridRetryInterval.HasValue)
{
options.Notifications.EventGrid.PublishRetryInterval = eventGridRetryInterval.Value;
}
if (eventGridRetryHttpStatus != null)
{
options.Notifications.EventGrid.PublishRetryHttpStatus = eventGridRetryHttpStatus;
}
if (maxQueuePollingInterval != null)
{
options.StorageProvider["maxQueuePollingInterval"] = maxQueuePollingInterval.Value;
}
return GetJobHostWithOptions(
loggerProvider,
options,
storageProviderType,
nameResolver,
durableHttpMessageHandler,
lifeCycleNotificationHelper,
serializerSettings);
}
public static ITestHost GetJobHostWithOptions(
ILoggerProvider loggerProvider,
DurableTaskOptions durableTaskOptions,
string storageProviderType = AzureStorageProviderType,
INameResolver nameResolver = null,
IDurableHttpMessageHandlerFactory durableHttpMessageHandler = null,
ILifeCycleNotificationHelper lifeCycleNotificationHelper = null,
IMessageSerializerSettingsFactory serializerSettings = null)
{
if (serializerSettings == null)
{
serializerSettings = new MessageSerializerSettingsFactory();
}
var optionsWrapper = new OptionsWrapper<DurableTaskOptions>(durableTaskOptions);
var testNameResolver = new TestNameResolver(nameResolver);
if (durableHttpMessageHandler == null)
{
durableHttpMessageHandler = new DurableHttpMessageHandlerFactory();
}
return PlatformSpecificHelpers.CreateJobHost(
optionsWrapper,
storageProviderType,
loggerProvider,
testNameResolver,
durableHttpMessageHandler,
lifeCycleNotificationHelper,
serializerSettings);
}
public static DurableTaskOptions GetDurableTaskOptionsForStorageProvider(string storageProvider)
{
switch (storageProvider)
{
case AzureStorageProviderType:
#if !FUNCTIONS_V1
case RedisProviderType:
case EmulatorProviderType:
#endif
return new DurableTaskOptions();
default:
throw new InvalidOperationException($"Storage provider {storageProvider} is not supported for testing infrastructure.");
}
}
public static string GetTaskHubNameFromTestName(string testName, bool enableExtendedSessions)
{
return testName.Replace("_", "") + (enableExtendedSessions ? "EX" : "") + PlatformSpecificHelpers.VersionSuffix;
}
public static ITypeLocator GetTypeLocator()
{
var types = new Type[]
{
typeof(TestOrchestrations),
typeof(TestActivities),
typeof(TestEntities),
typeof(TestEntityClasses),
typeof(ClientFunctions),
#if !FUNCTIONS_V1
typeof(TestEntityWithDependencyInjectionHelpers),
#endif
};
ITypeLocator typeLocator = new ExplicitTypeLocator(types);
return typeLocator;
}
public static string GetStorageConnectionString()
{
return Environment.GetEnvironmentVariable("AzureWebJobsStorage");
}
public static Task DeleteTaskHubResources(string testName, bool enableExtendedSessions)
{
string hubName = GetTaskHubNameFromTestName(testName, enableExtendedSessions);
var settings = new AzureStorageOrchestrationServiceSettings
{
TaskHubName = hubName,
StorageConnectionString = GetStorageConnectionString(),
};
var service = new AzureStorageOrchestrationService(settings);
return service.DeleteAsync();
}
public static void AssertLogMessageSequence(
ITestOutputHelper testOutput,
TestLoggerProvider loggerProvider,
string testName,
string instanceId,
bool filterOutReplayLogs,
string[] orchestratorFunctionNames,
string activityFunctionName = null)
{
List<string> messageIds;
string timeStamp;
var logMessages = GetLogMessages(loggerProvider, testName, instanceId, out messageIds, out timeStamp);
var expectedLogMessages = GetExpectedLogMessages(
testName,
messageIds,
orchestratorFunctionNames,
filterOutReplayLogs,
activityFunctionName,
timeStamp);
var actualLogMessages = logMessages.Select(m => m.FormattedMessage).ToList();
AssertLogMessages(expectedLogMessages, actualLogMessages, testOutput);
}
public static void UnhandledOrchesterationExceptionWithRetry_AssertLogMessageSequence(
ITestOutputHelper testOutput,
TestLoggerProvider loggerProvider,
string testName,
string subOrchestrationInstanceId,
string[] orchestratorFunctionNames,
string activityFunctionName = null)
{
List<string> messageIds;
string timeStamp;
var logMessages = GetLogMessages(loggerProvider, testName, subOrchestrationInstanceId, out messageIds, out timeStamp);
var actualLogMessages = logMessages.Select(m => m.FormattedMessage).ToList();
var exceptionCount =
actualLogMessages.FindAll(m => m.Contains("failed with an error")).Count;
// The sub-orchestration call is configured to make at most 3 attempts.
Assert.Equal(3, exceptionCount);
}
private static List<LogMessage> GetLogMessages(
TestLoggerProvider loggerProvider,
string testName,
string instanceId,
out List<string> instanceIds,
out string timeStamp)
{
var logger = loggerProvider.CreatedLoggers.Single(l => l.Category == LogCategory);
var logMessages = logger.LogMessages.ToList();
// Remove any logs which may have been generated by concurrently executing orchestrations.
// Sub-orchestrations are expected to be prefixed with the parent orchestration instance ID.
logMessages.RemoveAll(msg => !msg.FormattedMessage.Contains(instanceId));
instanceIds = new List<string> { instanceId };
timeStamp = string.Empty;
if (testName.Equals("TimerCancellation", StringComparison.OrdinalIgnoreCase) ||
testName.Equals("TimerExpiration", StringComparison.OrdinalIgnoreCase))
{
// It is assumed that the 4th log message is a timer message.
timeStamp = GetTimerTimestamp(logMessages[3].FormattedMessage);
}
else if (testName.Equals("Orchestration_OnValidOrchestrator", StringComparison.OrdinalIgnoreCase) ||
testName.Equals("Orchestration_Activity", StringComparison.OrdinalIgnoreCase))
{
// It is assumed that the 5th log message is a sub-orchestration
instanceIds.Add(GetInstanceId(logMessages[4].FormattedMessage));
}
Assert.True(
logMessages.TrueForAll(m => m.Category.Equals(LogCategory, StringComparison.InvariantCultureIgnoreCase)));
return logMessages;
}
private static IList<string> GetExpectedLogMessages(
string testName,
List<string> instanceIds,
string[] orchestratorFunctionNames,
bool extendedSessions,
string activityFunctionName = null,
string timeStamp = null,
string[] latencyMs = null)
{
var messages = new List<string>();
switch (testName)
{
case "HelloWorldOrchestration_Inline":
messages = GetLogs_HelloWorldOrchestration_Inline(instanceIds[0], orchestratorFunctionNames);
break;
case "HelloWorldOrchestration_Activity":
messages = GetLogs_HelloWorldOrchestration_Activity(instanceIds[0], orchestratorFunctionNames, activityFunctionName);
break;
case "TerminateOrchestration":
messages = GetLogs_TerminateOrchestration(instanceIds[0], orchestratorFunctionNames);
break;
case "TimerCancellation":
messages = GetLogs_TimerCancellation(instanceIds[0], orchestratorFunctionNames, timeStamp);
break;
case "TimerExpiration":
messages = GetLogs_TimerExpiration(instanceIds[0], orchestratorFunctionNames, timeStamp);
break;
case "UnhandledOrchestrationException":
messages = GetLogs_UnhandledOrchestrationException(instanceIds[0], orchestratorFunctionNames);
break;
case "UnhandledActivityException":
messages = GetLogs_UnhandledActivityException(instanceIds[0], orchestratorFunctionNames, activityFunctionName);
break;
case "UnhandledActivityExceptionWithRetry":
messages = GetLogs_UnhandledActivityExceptionWithRetry(instanceIds[0], orchestratorFunctionNames, activityFunctionName);
break;
case "Orchestration_OnUnregisteredActivity":
messages = GetLogs_Orchestration_OnUnregisteredActivity(instanceIds[0], orchestratorFunctionNames);
break;
case "Orchestration_OnUnregisteredOrchestrator":
messages = GetLogs_Orchestration_OnUnregisteredOrchestrator(instanceIds[0], orchestratorFunctionNames);
break;
case "Orchestration_OnValidOrchestrator":
messages = GetLogs_Orchestration_OnValidOrchestrator(instanceIds.ToArray(), orchestratorFunctionNames, activityFunctionName);
break;
case "Orchestration_Activity":
messages = GetLogs_Orchestration_Activity(instanceIds.ToArray(), orchestratorFunctionNames, activityFunctionName);
break;
case "OrchestrationEventGridApiReturnBadStatus":
messages = GetLogs_OrchestrationEventGridApiReturnBadStatus(instanceIds[0], orchestratorFunctionNames, latencyMs);
break;
case "RewindOrchestration":
messages = GetLogs_Rewind_Orchestration(instanceIds[0], orchestratorFunctionNames, activityFunctionName);
break;
case nameof(DurableTaskEndToEndTests.ActorOrchestration):
messages = GetLogs_ActorOrchestration(instanceIds[0]).ToList();
break;
default:
break;
}
// Remove any logs which may have been generated by concurrently executing orchestrations
messages.RemoveAll(str => !instanceIds.Any(id => str.Contains(id)));
if (extendedSessions)
{
// Remove replay logs - those are never expected for these tests.
messages.RemoveAll(str => str.Contains("IsReplay: True"));
}
return messages;
}
private static void AssertLogMessages(IList<string> expected, IList<string> actual, ITestOutputHelper testOutput)
{
TraceExpectedLogMessages(testOutput, expected);
Assert.Equal(expected.Count, actual.Count);
for (int i = 0; i < expected.Count; i++)
{
Assert.StartsWith(expected[i], actual[i]);
}
}
private static void TraceExpectedLogMessages(ITestOutputHelper testOutput, IList<string> expected)
{
string prefix = " ";
string allExpectedTraces = string.Join(Environment.NewLine + prefix, expected);
testOutput.WriteLine("Expected trace output:");
testOutput.WriteLine(prefix + allExpectedTraces);
}
private static List<string> GetLogs_HelloWorldOrchestration_Inline(string instanceId, string[] functionNames)
{
var list = new List<string>()
{
$"{instanceId}: Function '{functionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: NewInstance. IsReplay: False.",
$"{instanceId}: Function '{functionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: False. Input: \"World\"",
$"{instanceId}: Function '{functionNames[0]} ({FunctionType.Orchestrator})' completed. ContinuedAsNew: False. IsReplay: False. Output: \"Hello, World!\"",
};
return list;
}
private static List<string> GetLogs_OrchestrationEventGridApiReturnBadStatus(string messageId, string[] functionNames, string[] latencyMs)
{
var list = new List<string>()
{
$"{messageId}: Function '{functionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: NewInstance. IsReplay: False. State: Scheduled.",
$"{messageId}: Function '{functionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: False. Input: \"World\". State: Started.",
$"{messageId}: Function '{functionNames[0]} ({FunctionType.Orchestrator})' completed. ContinuedAsNew: False. IsReplay: False. Output: \"Hello, World!\". State: Completed.",
$"{messageId}: Function '{functionNames[0]} ({FunctionType.Orchestrator})' failed to send a 'Started' notification event to Azure Event Grid. Status code: 500. Details: {{\"message\":\"Exception has been thrown\"}}. ",
$"{messageId}: Function '{functionNames[0]} ({FunctionType.Orchestrator})' failed to send a 'Completed' notification event to Azure Event Grid. Status code: 500. Details: {{\"message\":\"Exception has been thrown\"}}. ",
};
return list;
}
private static List<string> GetLogs_HelloWorldOrchestration_Activity(string messageId, string[] orchestratorFunctionNames, string activityFunctionName)
{
var list = new List<string>
{
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: NewInstance. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: False. Input: \"World\"",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: {orchestratorFunctionNames[0]}. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' started. IsReplay: False. Input: [\"World\"]",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' completed. ContinuedAsNew: False. IsReplay: False. Output: \"Hello, World!\"",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True. Input: \"World\"",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: {orchestratorFunctionNames[0]}. IsReplay: True.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' completed. ContinuedAsNew: False. IsReplay: False. Output: \"Hello, World!\"",
};
return list;
}
private static List<string> GetLogs_TerminateOrchestration(string messageId, string[] orchestratorFunctionNames)
{
var list = new List<string>()
{
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: NewInstance. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: False. Input: 0",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' is waiting for input. Reason: WaitForExternalEvent:operation. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' was terminated. Reason: sayΕnara",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True. Input: 0",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' is waiting for input. Reason: WaitForExternalEvent:operation. IsReplay: True.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
};
return list;
}
private static List<string> GetLogs_TimerCancellation(string messageId, string[] orchestratorFunctionNames, string timerTimestamp)
{
var list = new List<string>()
{
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: NewInstance. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: False. Input: \"00:00:10\"",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' is waiting for input. Reason: WaitForExternalEvent:approval. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' is waiting for input. Reason: CreateTimer:{timerTimestamp}. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: RaiseEvent:approval. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True. Input: \"00:00:10\"",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' is waiting for input. Reason: WaitForExternalEvent:approval. IsReplay: True.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' is waiting for input. Reason: CreateTimer:{timerTimestamp}. IsReplay: True.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' received a 'approval' event.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' completed. ContinuedAsNew: False. IsReplay: False. Output: \"Approved\"",
};
return list;
}
private static List<string> GetLogs_TimerExpiration(string messageId, string[] orchestratorFunctionNames, string timerTimestamp)
{
var list = new List<string>()
{
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: NewInstance. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: False. Input: \"00:00:10\"",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' is waiting for input. Reason: WaitForExternalEvent:approval. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' is waiting for input. Reason: CreateTimer:{timerTimestamp}. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True. Input: \"00:00:10\"",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' is waiting for input. Reason: WaitForExternalEvent:approval. IsReplay: True.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' is waiting for input. Reason: CreateTimer:{timerTimestamp}. IsReplay: True.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' was resumed by a timer scheduled for '{timerTimestamp}'. IsReplay: False. State: TimerExpired",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' completed. ContinuedAsNew: False. IsReplay: False. Output: \"Expired\"",
};
return list;
}
private static List<string> GetLogs_UnhandledOrchestrationException(string messageId, string[] orchestratorFunctionNames)
{
var list = new List<string>()
{
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: NewInstance. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: False. Input: null",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' failed with an error. Reason: System.ArgumentNullException: Value cannot be null.",
};
return list;
}
private static List<string> GetLogs_UnhandledActivityException(string messageId, string[] orchestratorFunctionNames, string activityFunctionName)
{
var list = new List<string>()
{
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: NewInstance. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: False. Input: \"Kah-BOOOOM!!!\"",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: ThrowOrchestrator. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' started. IsReplay: False. Input: [\"Kah-BOOOOM!!!\"]",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' failed with an error. Reason: System.InvalidOperationException: Kah-BOOOOM!!!",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True. Input: \"Kah-BOOOOM!!!\"",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: ThrowOrchestrator. IsReplay: True.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' failed with an error. Reason: Microsoft.Azure.WebJobs.Extensions.DurableTask.FunctionFailedException: The activity function 'ThrowActivity' failed: \"Kah-BOOOOM!!!\"",
};
return list;
}
private static List<string> GetLogs_UnhandledActivityExceptionWithRetry(string messageId, string[] orchestratorFunctionNames, string activityFunctionName)
{
var list = new List<string>()
{
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: NewInstance. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: False. Input: \"Kah-BOOOOM!!!\"",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: ActivityThrowWithRetry. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' started. IsReplay: False. Input: [\"Kah-BOOOOM!!!\"]",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' failed with an error. Reason: System.InvalidOperationException: Kah-BOOOOM!!!",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True. Input: \"Kah-BOOOOM!!!\"",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: ActivityThrowWithRetry. IsReplay: True.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True. Input: \"Kah-BOOOOM!!!\"",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: ActivityThrowWithRetry. IsReplay: True.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' started. IsReplay: False. Input: [\"Kah-BOOOOM!!!\"]",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' failed with an error. Reason: System.InvalidOperationException: Kah-BOOOOM!!!",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True. Input: \"Kah-BOOOOM!!!\"",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: ActivityThrowWithRetry. IsReplay: True.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True.",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: ActivityThrowWithRetry. IsReplay: True.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' started. IsReplay: False. Input: [\"Kah-BOOOOM!!!\"]",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' failed with an error. Reason: System.InvalidOperationException: Kah-BOOOOM!!!",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True. Input: \"Kah-BOOOOM!!!\"",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: ActivityThrowWithRetry. IsReplay: True.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True. Input: \"Kah-BOOOOM!!!\"",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: ActivityThrowWithRetry. IsReplay: True.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' failed with an error. Reason: Microsoft.Azure.WebJobs.Extensions.DurableTask.FunctionFailedException: The activity function 'ThrowActivity' failed: \"Kah-BOOOOM!!!\"",
};
return list;
}
private static List<string> GetLogs_Orchestration_OnUnregisteredActivity(string messageId, string[] orchestratorFunctionNames)
{
var list = new List<string>()
{
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: NewInstance. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' failed with an error. Reason: System.ArgumentException: The function 'UnregisteredActivity' doesn't exist, is disabled, or is not an activity function.",
};
return list;
}
private static List<string> GetLogs_Orchestration_OnUnregisteredOrchestrator(string messageId, string[] orchestratorFunctionNames)
{
var list = new List<string>()
{
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: NewInstance. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' failed with an error. Reason: System.ArgumentException: The function 'UnregisteredOrchestrator' doesn't exist, is disabled, or is not an orchestrator function.",
};
return list;
}
private static List<string> GetLogs_Orchestration_OnValidOrchestrator(string[] messageIds, string[] orchestratorFunctionNames, string activityFunctionName)
{
var list = new List<string>()
{
$"{messageIds[0]}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: NewInstance. IsReplay: False.",
$"{messageIds[0]}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: False.",
$"{messageIds[0]}: Function '{orchestratorFunctionNames[1]} ({FunctionType.Orchestrator})' scheduled. Reason: CallOrchestrator. IsReplay: False.",
$"{messageIds[0]}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageIds[1]}:0: Function '{orchestratorFunctionNames[1]} ({FunctionType.Orchestrator})' started. IsReplay: False.",
$"{messageIds[1]}:0: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: SayHelloWithActivity. IsReplay: False.",
$"{messageIds[1]}:0: Function '{orchestratorFunctionNames[1]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageIds[1]}:0: Function '{activityFunctionName} ({FunctionType.Activity})' started. IsReplay: False.",
$"{messageIds[1]}:0: Function '{activityFunctionName} ({FunctionType.Activity})' completed. ContinuedAsNew: False. IsReplay: False. Output: \"Hello, ",
$"{messageIds[1]}:0: Function '{orchestratorFunctionNames[1]} ({FunctionType.Orchestrator})' started. IsReplay: True.",
$"{messageIds[1]}:0: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: SayHelloWithActivity. IsReplay: True.",
$"{messageIds[1]}:0: Function '{orchestratorFunctionNames[1]} ({FunctionType.Orchestrator})' completed. ContinuedAsNew: False. IsReplay: False. Output: \"Hello,",
$"{messageIds[0]}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True.",
$"{messageIds[0]}: Function '{orchestratorFunctionNames[1]} ({FunctionType.Orchestrator})' scheduled. Reason: CallOrchestrator. IsReplay: True.",
$"{messageIds[0]}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' completed. ContinuedAsNew: False. IsReplay: False. Output: \"Hello,",
};
return list;
}
private static List<string> GetLogs_Orchestration_Activity(string[] messageIds, string[] orchestratorFunctionNames, string activityFunctionName)
{
var list = new List<string>()
{
$"{messageIds[0]}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: NewInstance. IsReplay: False.",
$"{messageIds[0]}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: False.",
$"{messageIds[0]}: Function '{orchestratorFunctionNames[1]} ({FunctionType.Orchestrator})' scheduled. Reason: OrchestratorGreeting. IsReplay: False.",
$"{messageIds[0]}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageIds[1]}:0: Function '{orchestratorFunctionNames[1]} ({FunctionType.Orchestrator})' started. IsReplay: False.",
$"{messageIds[1]}:0: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: SayHelloWithActivity. IsReplay: False.",
$"{messageIds[1]}:0: Function '{orchestratorFunctionNames[1]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageIds[1]}:0: Function '{activityFunctionName} ({FunctionType.Activity})' started. IsReplay: False.",
$"{messageIds[1]}:0: Function '{activityFunctionName} ({FunctionType.Activity})' completed. ContinuedAsNew: False. IsReplay: False. Output: \"Hello, ",
$"{messageIds[1]}:0: Function '{orchestratorFunctionNames[1]} ({FunctionType.Orchestrator})' started. IsReplay: True.",
$"{messageIds[1]}:0: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: SayHelloWithActivity. IsReplay: True.",
$"{messageIds[1]}:0: Function '{orchestratorFunctionNames[1]} ({FunctionType.Orchestrator})' completed. ContinuedAsNew: False. IsReplay: False. Output: \"Hello,",
$"{messageIds[0]}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True.",
$"{messageIds[0]}: Function '{orchestratorFunctionNames[1]} ({FunctionType.Orchestrator})' scheduled. Reason: OrchestratorGreeting. IsReplay: True.",
$"{messageIds[0]}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' completed. ContinuedAsNew: False. IsReplay: False. Output: (null)",
};
return list;
}
private static List<string> GetLogs_Rewind_Orchestration(string messageId, string[] orchestratorFunctionNames, string activityFunctionName)
{
var list = new List<string>()
{
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' scheduled. Reason: NewInstance. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: False.",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: SayHelloWithActivityForRewind. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' awaited. IsReplay: False.",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' started. IsReplay: False.",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' completed. ContinuedAsNew: False. IsReplay: False.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True.",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: SayHelloWithActivityForRewind. IsReplay: True.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' failed with an error. Reason: System.Exception: Simulating Orchestration failure.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' was rewound. Reason: rewind!. State: Rewound.",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' started. IsReplay: True.",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' scheduled. Reason: SayHelloWithActivityForRewind. IsReplay: True.",
$"{messageId}: Function '{activityFunctionName} ({FunctionType.Activity})' completed. ContinuedAsNew: False. IsReplay: True. Output: (replayed).",
$"{messageId}: Function '{orchestratorFunctionNames[0]} ({FunctionType.Orchestrator})' completed. ContinuedAsNew: False. IsReplay: True. Output: \"Hello, Catherine!\". State: Completed.",
};
return list;
}
private static string[] GetLogs_ActorOrchestration(string instanceId)
{
return new[]
{
$"{instanceId}: Function 'Counter (Orchestrator)' scheduled. Reason: NewInstance. IsReplay: False. State: Scheduled.",
$"{instanceId}: Function 'Counter (Orchestrator)' started. IsReplay: False. Input: 0. State: Started.",
$"{instanceId}: Function 'Counter (Orchestrator)' is waiting for input. Reason: WaitForExternalEvent:operation. IsReplay: False. State: Listening.",
$"{instanceId}: Function 'Counter (Orchestrator)' awaited. IsReplay: False. State: Awaited.",
$"{instanceId}: Function 'Counter (Orchestrator)' scheduled. Reason: RaiseEvent:operation. IsReplay: False. State: Scheduled.",
$"{instanceId}: Function 'Counter (Orchestrator)' started. IsReplay: True. Input: 0. State: Started.",
$"{instanceId}: Function 'Counter (Orchestrator)' is waiting for input. Reason: WaitForExternalEvent:operation. IsReplay: True. State: Listening.",
$"{instanceId}: Function 'Counter (Orchestrator)' received a 'operation' event. State: ExternalEventRaised.",
$"{instanceId}: Function 'Counter (Orchestrator)' completed. ContinuedAsNew: True. IsReplay: False. Output: 1. State: Completed.",
$"{instanceId}: Function 'Counter (Orchestrator)' started. IsReplay: False. Input: 1. State: Started.",
$"{instanceId}: Function 'Counter (Orchestrator)' is waiting for input. Reason: WaitForExternalEvent:operation. IsReplay: False. State: Listening.",
$"{instanceId}: Function 'Counter (Orchestrator)' awaited. IsReplay: False. State: Awaited.",
$"{instanceId}: Function 'Counter (Orchestrator)' scheduled. Reason: RaiseEvent:operation. IsReplay: False. State: Scheduled.",
$"{instanceId}: Function 'Counter (Orchestrator)' started. IsReplay: True. Input: 1. State: Started.",
$"{instanceId}: Function 'Counter (Orchestrator)' is waiting for input. Reason: WaitForExternalEvent:operation. IsReplay: True. State: Listening.",
$"{instanceId}: Function 'Counter (Orchestrator)' received a 'operation' event. State: ExternalEventRaised.",
$"{instanceId}: Function 'Counter (Orchestrator)' completed. ContinuedAsNew: True. IsReplay: False. Output: 2. State: Completed.",
$"{instanceId}: Function 'Counter (Orchestrator)' started. IsReplay: False. Input: 2. State: Started.",
$"{instanceId}: Function 'Counter (Orchestrator)' is waiting for input. Reason: WaitForExternalEvent:operation. IsReplay: False. State: Listening.",
$"{instanceId}: Function 'Counter (Orchestrator)' awaited. IsReplay: False. State: Awaited.",
$"{instanceId}: Function 'Counter (Orchestrator)' scheduled. Reason: RaiseEvent:operation. IsReplay: False. State: Scheduled.",
$"{instanceId}: Function 'Counter (Orchestrator)' started. IsReplay: True. Input: 2. State: Started.",
$"{instanceId}: Function 'Counter (Orchestrator)' is waiting for input. Reason: WaitForExternalEvent:operation. IsReplay: True. State: Listening.",
$"{instanceId}: Function 'Counter (Orchestrator)' received a 'operation' event. State: ExternalEventRaised.",
$"{instanceId}: Function 'Counter (Orchestrator)' completed. ContinuedAsNew: True. IsReplay: False. Output: 3. State: Completed.",
$"{instanceId}: Function 'Counter (Orchestrator)' started. IsReplay: False. Input: 3. State: Started.",
$"{instanceId}: Function 'Counter (Orchestrator)' is waiting for input. Reason: WaitForExternalEvent:operation. IsReplay: False. State: Listening.",
$"{instanceId}: Function 'Counter (Orchestrator)' awaited. IsReplay: False. State: Awaited.",
$"{instanceId}: Function 'Counter (Orchestrator)' scheduled. Reason: RaiseEvent:operation. IsReplay: False. State: Scheduled.",
$"{instanceId}: Function 'Counter (Orchestrator)' started. IsReplay: True. Input: 3. State: Started.",
$"{instanceId}: Function 'Counter (Orchestrator)' is waiting for input. Reason: WaitForExternalEvent:operation. IsReplay: True. State: Listening.",
$"{instanceId}: Function 'Counter (Orchestrator)' received a 'operation' event. State: ExternalEventRaised.",
$"{instanceId}: Function 'Counter (Orchestrator)' completed. ContinuedAsNew: True. IsReplay: False. Output: 2. State: Completed.",
$"{instanceId}: Function 'Counter (Orchestrator)' started. IsReplay: False. Input: 2. State: Started.",
$"{instanceId}: Function 'Counter (Orchestrator)' is waiting for input. Reason: WaitForExternalEvent:operation. IsReplay: False. State: Listening.",
$"{instanceId}: Function 'Counter (Orchestrator)' awaited. IsReplay: False. State: Awaited.",
$"{instanceId}: Function 'Counter (Orchestrator)' scheduled. Reason: RaiseEvent:operation. IsReplay: False. State: Scheduled.",
$"{instanceId}: Function 'Counter (Orchestrator)' started. IsReplay: True. Input: 2. State: Started.",
$"{instanceId}: Function 'Counter (Orchestrator)' is waiting for input. Reason: WaitForExternalEvent:operation. IsReplay: True. State: Listening.",
$"{instanceId}: Function 'Counter (Orchestrator)' received a 'operation' event. State: ExternalEventRaised.",
$"{instanceId}: Function 'Counter (Orchestrator)' completed. ContinuedAsNew: True. IsReplay: False. Output: 3. State: Completed.",
$"{instanceId}: Function 'Counter (Orchestrator)' started. IsReplay: False. Input: 3. State: Started.",
$"{instanceId}: Function 'Counter (Orchestrator)' is waiting for input. Reason: WaitForExternalEvent:operation. IsReplay: False. State: Listening.",
$"{instanceId}: Function 'Counter (Orchestrator)' awaited. IsReplay: False. State: Awaited.",
$"{instanceId}: Function 'Counter (Orchestrator)' scheduled. Reason: RaiseEvent:operation. IsReplay: False. State: Scheduled.",
$"{instanceId}: Function 'Counter (Orchestrator)' started. IsReplay: True. Input: 3. State: Started.",
$"{instanceId}: Function 'Counter (Orchestrator)' is waiting for input. Reason: WaitForExternalEvent:operation. IsReplay: True. State: Listening.",
$"{instanceId}: Function 'Counter (Orchestrator)' received a 'operation' event. State: ExternalEventRaised.",
$"{instanceId}: Function 'Counter (Orchestrator)' completed. ContinuedAsNew: False. IsReplay: False. Output: 3. State: Completed.",
};
}
private static string GetInstanceId(string message)
{
return message.Substring(0, message.IndexOf(':'));
}
private static string GetTimerTimestamp(string message)
{
const string CreateTimerPrefix = "CreateTimer:";
int start = message.IndexOf(CreateTimerPrefix) + CreateTimerPrefix.Length;
int end = message.IndexOf('Z', start) + 1;
return message.Substring(start, end - start);
}
internal static INameResolver GetTestNameResolver()
{
return new TestNameResolver(null);
}
public static async Task<string> LoadStringFromTextBlobAsync(string blobName)
{
string connectionString = GetStorageConnectionString();
CloudStorageAccount account = CloudStorageAccount.Parse(connectionString);
var blobClient = account.CreateCloudBlobClient();
var testcontainer = blobClient.GetContainerReference("test");
var blob = testcontainer.GetBlockBlobReference(blobName);
try
{
return await blob.DownloadTextAsync();
}
catch (StorageException e)
when ((e as StorageException)?.RequestInformation?.HttpStatusCode == 404)
{
// if the blob does not exist, just return null.
return null;
}
}
public static async Task WriteStringToTextBlob(string blobName, string content)
{
string connectionString = GetStorageConnectionString();
CloudStorageAccount account = CloudStorageAccount.Parse(connectionString);
var blobClient = account.CreateCloudBlobClient();
var testcontainer = blobClient.GetContainerReference("test");
var blob = testcontainer.GetBlockBlobReference(blobName);
await blob.UploadTextAsync(content);
}
private class ExplicitTypeLocator : ITypeLocator
{
private readonly IReadOnlyList<Type> types;
public ExplicitTypeLocator(params Type[] types)
{
this.types = types.ToList().AsReadOnly();
}
public IReadOnlyList<Type> GetTypes()
{
return this.types;
}
}
private class TestNameResolver : INameResolver
{
private static readonly Dictionary<string, string> DefaultAppSettings = new Dictionary<string, string>(
StringComparer.OrdinalIgnoreCase)
{
{ "TestTaskHub", string.Empty },
};
private readonly INameResolver innerResolver;
public TestNameResolver(INameResolver innerResolver)
{
// null is okay
this.innerResolver = innerResolver;
}
public string Resolve(string name)
{
if (string.IsNullOrEmpty(name))
{
return null;
}
string value = this.innerResolver?.Resolve(name);
if (value == null)
{
DefaultAppSettings.TryGetValue(name, out value);
}
if (value == null)
{
value = Environment.GetEnvironmentVariable(name);
}
return value;
}
}
}
}
| 64.590965 | 270 | 0.642476 | [
"MIT"
] | Fabian-Schmidt/azure-functions-durable-extension | test/Common/TestHelpers.cs | 52,903 | C# |
ο»Ώusing UnityEngine;
namespace RPGCore.Inventories
{
[CreateAssetMenu (menuName = "RPGCore/Equipment/Info")]
public class EquipmentInformation : ScriptableObject
{
[Header ("General")]
public string Name;
public Slot AllowedItems;
[Header ("Render")]
#if ASSET_ICONS
[AssetIcon]
#endif
public Sprite SlotIcon;
public ItemSlot GenerateSlot (RPGCharacter character)
{
ItemSlotBehaviour[] slotBehaviour = new ItemSlotBehaviour[] {
new Slot_EquippableSlot ()
};
ItemCondition[] slotCondition = new ItemCondition[] {
new EquipmentTypeCondition (AllowedItems)
};
ItemStorageSlot storageSlot = new ItemStorageSlot (character, slotBehaviour, slotCondition);
storageSlot.SlotDecoration = SlotIcon;
return storageSlot;
}
}
}
| 20.368421 | 95 | 0.736434 | [
"Apache-2.0"
] | li5414/RPGCore | RPGCore/Assets/RPGCore/Scripts/Inventory/Equipment/EquipmentInformation.cs | 776 | C# |
ο»Ώ// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using NuGet.DependencyResolver;
using NuGet.Frameworks;
using NuGet.LibraryModel;
using NuGet.Versioning;
namespace NuGet.ProjectModel
{
/// <summary>
/// Resolves dependencies retrieved from a list of <see cref="ExternalProjectReference" />.
/// </summary>
public class ExternalProjectReferenceDependencyProvider : IDependencyProvider
{
public IReadOnlyDictionary<string, ExternalProjectReference> ExternalProjects { get; }
public ExternalProjectReferenceDependencyProvider(IEnumerable<ExternalProjectReference> externalProjects)
{
ExternalProjects = new ReadOnlyDictionary<string, ExternalProjectReference>(externalProjects.ToDictionary(e => e.UniqueName, StringComparer.OrdinalIgnoreCase));
}
public bool SupportsType(string libraryType)
{
return string.Equals(libraryType, LibraryTypes.ExternalProject);
}
public IEnumerable<string> GetAttemptedPaths(NuGetFramework targetFramework)
{
return Enumerable.Empty<string>();
}
public Library GetLibrary(LibraryRange libraryRange, NuGetFramework targetFramework)
{
ExternalProjectReference externalProject;
if (!ExternalProjects.TryGetValue(libraryRange.Name, out externalProject))
{
// No project!
return null;
}
// Fill dependencies from external project references
var dependencies = externalProject.ExternalProjectReferences.Select(s => new LibraryDependency()
{
LibraryRange = new LibraryRange()
{
Name = s,
VersionRange = null,
TypeConstraint = LibraryTypes.ExternalProject
},
Type = LibraryDependencyType.Default
}).ToList();
// Add dependencies from the nuget.json file
if (!string.IsNullOrEmpty(externalProject.PackageSpecPath)
&& File.Exists(externalProject.PackageSpecPath))
{
PackageSpec packageSpec;
using (var stream = new FileStream(externalProject.PackageSpecPath, FileMode.Open, FileAccess.Read, FileShare.Read))
{
packageSpec = JsonPackageSpecReader.GetPackageSpec(stream, externalProject.UniqueName, externalProject.PackageSpecPath);
}
// Add framework-agnostic dependencies
dependencies.AddRange(packageSpec.Dependencies);
// Add framework-specific dependencies
var frameworkInfo = packageSpec.GetTargetFramework(targetFramework);
if (frameworkInfo != null)
{
dependencies.AddRange(frameworkInfo.Dependencies);
}
}
// Construct the library and return it
return new Library()
{
Identity = new LibraryIdentity()
{
Name = externalProject.UniqueName,
Version = new NuGetVersion("1.0.0"),
Type = LibraryTypes.ExternalProject
},
LibraryRange = libraryRange,
Dependencies = dependencies,
Path = externalProject.PackageSpecPath,
Resolved = true
};
}
}
}
| 39.742268 | 172 | 0.593515 | [
"Apache-2.0"
] | david-driscoll/NuGet3 | src/NuGet.ProjectModel/ExternalProjectReferenceDependencyProvider.cs | 3,857 | C# |
ο»Ώusing System;
using System.Collections.Generic;
using System.Linq;
using FlixOne.Web.Common;
using FlixOne.Web.Models;
using FlixOne.Web.Persistence;
using Microsoft.AspNetCore.Mvc;
namespace FlixOne.Web.Controllers
{
public class ProductController : Controller
{
private readonly IInventoryRepository _repository;
public ProductController(IInventoryRepository inventoryRepository)
{
_repository = inventoryRepository;
}
public IActionResult Index([FromQuery] Sort sort, string searchTerm,
string currentSearchTerm,
int? pagenumber,
int? pagesize)
{
ViewData["cSort"] = sort.Order;
ViewData["cSort"] = (SortOrder) ViewData["cSort"] == SortOrder.A ? SortOrder.D : sort.Order;
if (searchTerm != null)
pagenumber = 1;
else
searchTerm = currentSearchTerm;
ViewData["currentSearchTerm"] = searchTerm;
var products = _repository.GetProducts(sort, searchTerm,pagenumber,pagesize);
var vm = products.ToProductvm().ToList();
return View(new PagedList<ProductViewModel>(vm, vm.Count,pagenumber??1,pagesize??1));
}
public IActionResult Details(Guid id)
{
return View(_repository.GetProduct(id).ToProductvm());
}
public IActionResult Create()
{
return View();
}
public IActionResult Report()
{
var mango = _repository.GetProduct(new Guid("09C2599E-652A-4807-A0F8-390A146F459B"));
var apple = _repository.GetProduct(new Guid("7AF8C5C2-FA98-42A0-B4E0-6D6A22FC3D52"));
var orange = _repository.GetProduct(new Guid("E2A8D6B3-A1F9-46DD-90BD-7F797E5C3986"));
var model = new List<MessageViewModel>();
//provider
var productProvider = new ProductRecorder();
//observer1
var productObserver1 = new ProductReporter(nameof(mango));
//observer2
var productObserver2 = new ProductReporter(nameof(apple));
//observer3
var productObserver3 = new ProductReporter(nameof(orange));
//subssribe
productObserver1.Subscribe(productProvider);
productObserver2.Subscribe(productProvider);
productObserver3.Subscribe(productProvider);
//Report and Unsubscribe
productProvider.Record(mango);
model.AddRange(productObserver1.Reporter);
productObserver1.Unsubscribe();
productProvider.Record(apple);
model.AddRange(productObserver2.Reporter);
productObserver2.Unsubscribe();
productProvider.Record(orange);
model.AddRange(productObserver3.Reporter);
productObserver3.Unsubscribe();
return View(model);
}
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Create([FromBody] Product product)
{
try
{
_repository.AddProduct(product);
return RedirectToAction(nameof(Index));
}
catch
{
return View();
}
}
public IActionResult Edit(Guid id)
{
return View(_repository.GetProduct(id));
}
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Edit(Guid id, [FromBody] Product product)
{
try
{
_repository.UpdateProduct(product);
return RedirectToAction(nameof(Index));
}
catch
{
return View();
}
}
public IActionResult Delete(Guid id)
{
return View(_repository.GetProduct(id));
}
[HttpPost]
[ValidateAntiForgeryToken]
public IActionResult Delete(Guid id, [FromBody] Product product)
{
try
{
_repository.RemoveProduct(product);
return RedirectToAction(nameof(Index));
}
catch
{
return View();
}
}
}
} | 31.602941 | 104 | 0.567706 | [
"MIT"
] | BarbFlegel/Hands-On-Design-Patterns-with-C-and-.NET-Core | Chapter10/FlixOneWebExtended/FlixOne.Web/Controllers/ProductController.cs | 4,300 | C# |
ο»Ώusing SeniorBlockchain.Tests.Common.TestFramework;
using Xunit;
namespace SeniorBlockchain.IntegrationTests.BlockStore
{
public partial class ReorgToLongestChainSpecification : BddSpecification
{
[Fact]
public void A_cut_off_miner_advanced_ahead_of_network_causes_reorg_on_reconnect()
{
Given(four_miners);
And(each_mine_a_block);
And(mining_continues_to_maturity_to_allow_spend);
And(jing_loses_connection_to_others_but_carries_on_mining);
And(bob_creates_a_transaction_and_broadcasts);
And(charlie_waits_for_the_trx_and_mines_this_block);
And(dave_confirms_transaction_is_present);
And(meanwhile_jings_chain_advanced_ahead_of_the_others);
When(jings_connection_comes_back);
Then(bob_charlie_and_dave_reorg_to_jings_longest_chain);
And(bobs_transaction_from_shorter_chain_is_now_missing);
But(bobs_transaction_is_now_in_the_mem_pool);
}
}
} | 41.24 | 89 | 0.731329 | [
"MIT"
] | seniorblockchain/blockchain | src/Tests/SeniorBlockchain.IntegrationTests/BlockStore/ReorgToLongestChainSpecification.cs | 1,033 | C# |
ο»Ώnamespace DiegoRangel.CleanArchitecture.Infra.IoC.Common
{
/// <summary>
/// It's just an empty class used to reference this Project's assembly.
/// </summary>
public class ProjectIdentifier
{
}
} | 23 | 75 | 0.63913 | [
"MIT"
] | diego-rangel/DiegoRangel.CleanArchitecture.Template | src/DiegoRangel.CleanArchitecture.Infra.IoC/Common/ProjectIdentifier.cs | 232 | C# |
using BLD;
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
using Assert = UnityEngine.Assertions.Assert;
namespace AssetPromiseKeeper_Tests
{
public abstract class APKWithPoolableAssetShouldWorkWhen_Base<APKType, AssetPromiseType, AssetType, AssetLibraryType>
: TestsBase_APK<APKType, AssetPromiseType, AssetType, AssetLibraryType>
where AssetPromiseType : AssetPromise<AssetType>
where AssetType : Asset_WithPoolableContainer, new()
where AssetLibraryType : AssetLibrary_Poolable<AssetType>, new()
where APKType : AssetPromiseKeeper<AssetType, AssetLibraryType, AssetPromiseType>, new()
{
protected abstract AssetPromiseType CreatePromise();
[UnityTest]
public IEnumerator ForgetIsCalledWhileAssetIsBeingReused()
{
AssetPromiseType prom = CreatePromise();
bool calledFail = false;
keeper.Keep(prom);
yield return prom;
prom.asset.container.name = "First GLTF";
AssetPromiseType prom2 = CreatePromise();
prom2.OnFailEvent +=
(x, error) => { calledFail = true; };
keeper.Keep(prom2);
GameObject container = prom2.asset.container;
bool wasLoadingWhenForgotten = prom2.state == AssetPromiseState.LOADING;
keeper.Forget(prom2);
yield return prom2;
Assert.IsTrue(prom2 != null);
if (wasLoadingWhenForgotten)
Assert.IsFalse(calledFail, "Fail event should NOT be called when forgotten while loading");
Assert.IsTrue(prom2.asset == null, "Asset shouldn't exist after Forget!");
Assert.IsTrue(container != null, "Container should be pooled!");
PoolableObject po = PoolManager.i.GetPoolable(container);
Assert.IsTrue(po.isInsidePool, "Asset should be inside pool!");
}
[UnityTest]
public IEnumerator AnyAssetIsLoadedAndThenUnloaded()
{
var prom = CreatePromise();
AssetType loadedAsset = null;
prom.OnSuccessEvent +=
(x) =>
{
Debug.Log("success!");
loadedAsset = x;
};
keeper.Keep(prom);
Assert.IsTrue(prom.state == AssetPromiseState.LOADING);
yield return prom;
Assert.IsTrue(loadedAsset != null);
//Assert.IsTrue(loadedAsset.isLoaded);
Assert.IsTrue(keeper.library.Contains(loadedAsset));
Assert.AreEqual(1, keeper.library.masterAssets.Count);
keeper.Forget(prom);
yield return prom;
Assert.IsTrue(prom.state == AssetPromiseState.IDLE_AND_EMPTY);
Assert.IsTrue(keeper.library.Contains(loadedAsset.id), "Asset should be still in library, it only should be removed from library when the Pool is cleaned by the MemoryManager");
Assert.AreEqual(1, keeper.library.masterAssets.Count, "Asset should be still in library, it only should be removed from library when the Pool is cleaned by the MemoryManager");
yield return PoolManager.i.CleanupAsync(false, false);
Assert.AreEqual(0, keeper.library.masterAssets.Count, "After MemoryManager clear the pools, the asset should be removed from the library");
Assert.IsTrue(!keeper.library.Contains(loadedAsset.id), "After MemoryManager clear the pools, the asset should be removed from the library");
}
[UnityTest]
public IEnumerator AnyAssetIsDestroyedWhileLoading()
{
AssetPromiseType prom = CreatePromise();
bool calledFail = false;
prom.OnFailEvent +=
(x, error) => { calledFail = true; };
keeper.Keep(prom);
yield return null;
Object.Destroy(prom.asset.container);
yield return prom;
Assert.IsTrue(prom != null);
Assert.IsTrue(prom.asset == null);
Assert.IsTrue(calledFail);
}
[UnityTest]
public IEnumerator ForgetIsCalledWhileAssetIsBeingLoaded()
{
var prom = CreatePromise();
keeper.Keep(prom);
yield return new WaitForSeconds(0.1f);
keeper.Forget(prom);
Assert.AreEqual(AssetPromiseState.IDLE_AND_EMPTY, prom.state);
var prom2 = CreatePromise();
AssetType asset = null;
prom2.OnSuccessEvent += (x) => { asset = x; };
keeper.Keep(prom2);
yield return prom2;
Assert.AreEqual(AssetPromiseState.FINISHED, prom2.state);
keeper.Forget(prom2);
yield return PoolManager.i.CleanupAsync(false, false);
Assert.IsTrue(asset.container == null);
Assert.IsTrue(!keeper.library.Contains(asset));
Assert.AreEqual(0, keeper.library.masterAssets.Count);
}
[UnityTest]
public IEnumerator ManyPromisesWithTheSameURLAreLoaded()
{
var prom = CreatePromise();
AssetType asset = null;
prom.OnSuccessEvent += (x) => { asset = x; };
var prom2 = CreatePromise();
AssetType asset2 = null;
prom2.OnSuccessEvent += (x) => { asset2 = x; };
var prom3 = CreatePromise();
AssetType asset3 = null;
prom3.OnSuccessEvent += (x) => { asset3 = x; };
keeper.Keep(prom);
keeper.Keep(prom2);
keeper.Keep(prom3);
Assert.AreEqual(3, keeper.waitingPromisesCount);
yield return prom;
yield return new WaitForSeconds(0.1f);
Assert.IsTrue(asset != null);
Assert.IsTrue(asset2 != null);
Assert.IsTrue(asset3 != null);
Assert.AreEqual(AssetPromiseState.FINISHED, prom.state);
Assert.AreEqual(AssetPromiseState.FINISHED, prom2.state);
Assert.AreEqual(AssetPromiseState.FINISHED, prom3.state);
Assert.IsTrue(asset2.id == asset.id);
Assert.IsTrue(asset3.id == asset.id);
Assert.IsTrue(asset2.id == asset3.id);
Assert.IsTrue(asset != asset2);
Assert.IsTrue(asset != asset3);
Assert.IsTrue(asset2 != asset3);
Assert.IsTrue(keeper.library.Contains(asset));
Assert.AreEqual(1, keeper.library.masterAssets.Count);
}
[UnityTest]
public IEnumerator KeepAndForgetIsCalledInSingleFrameWhenLoadingAsset()
{
var prom = CreatePromise();
bool calledSuccess = false;
bool calledFail = false;
prom.OnSuccessEvent +=
(x) => { calledSuccess = true; };
prom.OnFailEvent +=
(x, error) => { calledFail = true; };
keeper.Keep(prom);
keeper.Forget(prom);
keeper.Keep(prom);
keeper.Forget(prom);
Assert.IsTrue(prom != null);
Assert.IsTrue(prom.asset == null);
Assert.IsFalse(calledSuccess, "Success event should NOT be called when forgetting a promise");
Assert.IsFalse(calledFail, "Fail event should NOT be called when forgetting a promise.");
yield break;
}
[UnityTest]
public IEnumerator KeepAndForgetIsCalledInSingleFrameWhenReusingAsset()
{
var prom = CreatePromise();
AssetType loadedAsset = null;
prom.OnSuccessEvent +=
(x) => { loadedAsset = x; };
keeper.Keep(prom);
yield return prom;
keeper.Forget(prom);
keeper.Keep(prom);
keeper.Forget(prom);
Assert.IsTrue(prom.asset == null);
}
}
} | 33.362869 | 189 | 0.590489 | [
"Apache-2.0"
] | belandproject/unity-renderer | unity-renderer/Assets/Scripts/MainScripts/BLD/Controllers/AssetManager/Common/Tests/APKWithPoolableAssetShouldWorkWhen_Base.cs | 7,907 | C# |
ο»Ώ//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace LinkedTrackerView.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
| 34.580645 | 151 | 0.583955 | [
"BSD-3-Clause"
] | rightcode-org/LinkedTracker | Viewer/Properties/Settings.Designer.cs | 1,074 | C# |
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace AGS.Types
{
public class CustomProperty
{
private string _name;
private string _value;
public CustomProperty()
{
}
public string Name
{
get { return _name; }
set { _name = value; }
}
public string Value
{
get { return _value; }
set { _value = value; }
}
public CustomProperty(XmlNode node)
{
SerializeUtils.DeserializeFromXML(this, node);
}
public void ToXml(XmlTextWriter writer)
{
SerializeUtils.SerializeToXML(this, writer);
}
}
}
| 18.439024 | 58 | 0.529101 | [
"Artistic-2.0"
] | Mailaender/KrusAGS | Editor/AGS.Types/CustomProperty.cs | 756 | C# |
ο»Ώnamespace Gribble.TransactSql
{
public static class System
{
public static string Alias(this string column, string alias)
{
return $"{alias}.[{column}]";
}
public static class Objects
{
public static string TableName = "[sys].[objects]";
public static string Name = "name";
public static string Type = "type";
}
public static class Tables
{
public static string TableName = "[sys].[tables]";
public static string TableAlias = "[ST]";
public static string CreateDate = "create_date";
public static string FilestreamDataSpaceId = "filestream_data_space_id";
public static string HasReplicationFilter = "has_replication_filter";
public static string HasUncheckedAssemblyData = "has_unchecked_assembly_data";
public static string IsMergePublished = "is_merge_published";
public static string IsMsShipped = "is_ms_shipped";
public static string IsPublished = "is_published";
public static string IsReplicated = "is_replicated";
public static string IsSchemaPublished = "is_schema_published";
public static string IsSyncTranSubscribed = "is_sync_tran_subscribed";
public static string IsTrackedByCdc = "is_tracked_by_cdc";
public static string LargeValueTypesOutOfRow = "large_value_types_out_of_row";
public static string LobDataSpaceId = "lob_data_space_id";
public static string LockEscalation = "lock_escalation";
public static string LockEscalationDesc = "lock_escalation_desc";
public static string LockOnBulkLoad = "lock_on_bulk_load";
public static string MaxColumnIdUsed = "max_column_id_used";
public static string ModifyDate = "modify_date";
public static string Name = "name";
public static string ObjectId = "object_id";
public static string ParentObjectId = "parent_object_id";
public static string PrincipalId = "principal_id";
public static string SchemaId = "schema_id";
public static string TextInRowLimit = "text_in_row_limit";
public static string Type = "type";
public static string TypeDesc = "type_desc";
public static string UsesAnsiNulls = "uses_ansi_nulls";
public static class Aliased
{
public static string CreateDate = Tables.CreateDate.Alias(TableAlias);
public static string FilestreamDataSpaceId = Tables.FilestreamDataSpaceId.Alias(TableAlias);
public static string HasReplicationFilter = Tables.HasReplicationFilter.Alias(TableAlias);
public static string HasUncheckedAssemblyData = Tables.HasUncheckedAssemblyData.Alias(TableAlias);
public static string IsMergePublished = Tables.IsMergePublished.Alias(TableAlias);
public static string IsMsShipped = Tables.IsMsShipped.Alias(TableAlias);
public static string IsPublished = Tables.IsPublished.Alias(TableAlias);
public static string IsReplicated = Tables.IsReplicated.Alias(TableAlias);
public static string IsSchemaPublished = Tables.IsSchemaPublished.Alias(TableAlias);
public static string IsSyncTranSubscribed = Tables.IsSyncTranSubscribed.Alias(TableAlias);
public static string IsTrackedByCdc = Tables.IsTrackedByCdc.Alias(TableAlias);
public static string LargeValueTypesOutOfRow = Tables.LargeValueTypesOutOfRow.Alias(TableAlias);
public static string LobDataSpaceId = Tables.LobDataSpaceId.Alias(TableAlias);
public static string LockEscalation = Tables.LockEscalation.Alias(TableAlias);
public static string LockEscalationDesc = Tables.LockEscalationDesc.Alias(TableAlias);
public static string LockOnBulkLoad = Tables.LockOnBulkLoad.Alias(TableAlias);
public static string MaxColumnIdUsed = Tables.MaxColumnIdUsed.Alias(TableAlias);
public static string ModifyDate = Tables.ModifyDate.Alias(TableAlias);
public static string Name = Tables.Name.Alias(TableAlias);
public static string ObjectId = Tables.ObjectId.Alias(TableAlias);
public static string ParentObjectId = Tables.ParentObjectId.Alias(TableAlias);
public static string PrincipalId = Tables.PrincipalId.Alias(TableAlias);
public static string SchemaId = Tables.SchemaId.Alias(TableAlias);
public static string TextInRowLimit = Tables.TextInRowLimit.Alias(TableAlias);
public static string Type = Tables.Type.Alias(TableAlias);
public static string TypeDesc = Tables.TypeDesc.Alias(TableAlias);
public static string UsesAnsiNulls = Tables.UsesAnsiNulls.Alias(TableAlias);
}
}
public static class Columns
{
public static string TableName = "[sys].[columns]";
public static string TableAlias = "[SC]";
public static string CollationName = "collation_name";
public static string ColumnId = "column_id";
public static string DefaultObjectId = "default_object_id";
public static string IsAnsiPadded = "is_ansi_padded";
public static string IsColumnSet = "is_column_set";
public static string IsComputed = "is_computed";
public static string IsDtsReplicated = "is_dts_replicated";
public static string IsFilestream = "is_filestream";
public static string IsIdentity = "is_identity";
public static string IsMergePublished = "is_merge_published";
public static string IsNonSqlSubscribed = "is_non_sql_subscribed";
public static string IsNullable = "is_nullable";
public static string IsReplicated = "is_replicated";
public static string IsRowguidcol = "is_rowguidcol";
public static string IsSparse = "is_sparse";
public static string IsXmlDocument = "is_xml_document";
public static string MaxLength = "max_length";
public static string Name = "name";
public static string ObjectId = "object_id";
public static string Precision = "precision";
public static string RuleObjectId = "rule_object_id";
public static string Scale = "scale";
public static string SystemTypeId = "system_type_id";
public static string UserTypeId = "user_type_id";
public static string XmlCollectionId = "xml_collection_id";
public static class Aliased
{
public static string CollationName = Columns.CollationName.Alias(TableAlias);
public static string ColumnId = Columns.ColumnId.Alias(TableAlias);
public static string DefaultObjectId = Columns.DefaultObjectId.Alias(TableAlias);
public static string IsAnsiPadded = Columns.IsAnsiPadded.Alias(TableAlias);
public static string IsColumnSet = Columns.IsColumnSet.Alias(TableAlias);
public static string IsComputed = Columns.IsComputed.Alias(TableAlias);
public static string IsDtsReplicated = Columns.IsDtsReplicated.Alias(TableAlias);
public static string IsFilestream = Columns.IsFilestream.Alias(TableAlias);
public static string IsIdentity = Columns.IsIdentity.Alias(TableAlias);
public static string IsMergePublished = Columns.IsMergePublished.Alias(TableAlias);
public static string IsNonSqlSubscribed = Columns.IsNonSqlSubscribed.Alias(TableAlias);
public static string IsNullable = Columns.IsNullable.Alias(TableAlias);
public static string IsReplicated = Columns.IsReplicated.Alias(TableAlias);
public static string IsRowguidcol = Columns.IsRowguidcol.Alias(TableAlias);
public static string IsSparse = Columns.IsSparse.Alias(TableAlias);
public static string IsXmlDocument = Columns.IsXmlDocument.Alias(TableAlias);
public static string MaxLength = Columns.MaxLength.Alias(TableAlias);
public static string Name = Columns.Name.Alias(TableAlias);
public static string ObjectId = Columns.ObjectId.Alias(TableAlias);
public static string Precision = Columns.Precision.Alias(TableAlias);
public static string RuleObjectId = Columns.RuleObjectId.Alias(TableAlias);
public static string Scale = Columns.Scale.Alias(TableAlias);
public static string SystemTypeId = Columns.SystemTypeId.Alias(TableAlias);
public static string UserTypeId = Columns.UserTypeId.Alias(TableAlias);
public static string XmlCollectionId = Columns.XmlCollectionId.Alias(TableAlias);
}
}
public static class IndexColumns
{
public static string TableName = "[sys].[index_columns]";
public static string TableAlias = "[SIC]";
public static string ColumnId = "column_id";
public static string IndexColumnId = "index_column_id";
public static string IndexId = "index_id";
public static string IsDescendingKey = "is_descending_key";
public static string IsIncludedColumn = "is_included_column";
public static string KeyOrdinal = "key_ordinal";
public static string ObjectId = "object_id";
public static string PartitionOrdinal = "partition_ordinal";
public static class Aliased
{
public static string ColumnId = IndexColumns.ColumnId.Alias(TableAlias);
public static string IndexColumnId = IndexColumns.IndexColumnId.Alias(TableAlias);
public static string IndexId = IndexColumns.IndexId.Alias(TableAlias);
public static string IsDescendingKey = IndexColumns.IsDescendingKey.Alias(TableAlias);
public static string IsIncludedColumn = IndexColumns.IsIncludedColumn.Alias(TableAlias);
public static string KeyOrdinal = IndexColumns.KeyOrdinal.Alias(TableAlias);
public static string ObjectId = IndexColumns.ObjectId.Alias(TableAlias);
public static string PartitionOrdinal = IndexColumns.PartitionOrdinal.Alias(TableAlias);
}
}
public static class Indexes
{
public static string TableName = "[sys].[indexes]";
public static string TableAlias = "[SI]";
public static string AllowPageLocks = "allow_page_locks";
public static string AllowRowLocks = "allow_row_locks";
public static string DataSpaceId = "data_space_id";
public static string FillFactor = "fill_factor";
public static string FilterDefinition = "filter_definition";
public static string HasFilter = "has_filter";
public static string IgnoreDupKey = "ignore_dup_key";
public static string IndexId = "index_id";
public static string IsDisabled = "is_disabled";
public static string IsHypothetical = "is_hypothetical";
public static string IsPadded = "is_padded";
public static string IsPrimaryKey = "is_primary_key";
public static string IsUnique = "is_unique";
public static string IsUniquestaticraint = "is_unique_staticraint";
public static string Name = "name";
public static string ObjectId = "object_id";
public static string Type = "type";
public static string TypeDesc = "type_desc";
public static class Aliased
{
public static string AllowPageLocks = Indexes.AllowPageLocks.Alias(TableAlias);
public static string AllowRowLocks = Indexes.AllowRowLocks.Alias(TableAlias);
public static string DataSpaceId = Indexes.DataSpaceId.Alias(TableAlias);
public static string FillFactor = Indexes.FillFactor.Alias(TableAlias);
public static string FilterDefinition = Indexes.FilterDefinition.Alias(TableAlias);
public static string HasFilter = Indexes.HasFilter.Alias(TableAlias);
public static string IgnoreDupKey = Indexes.IgnoreDupKey.Alias(TableAlias);
public static string IndexId = Indexes.IndexId.Alias(TableAlias);
public static string IsDisabled = Indexes.IsDisabled.Alias(TableAlias);
public static string IsHypothetical = Indexes.IsHypothetical.Alias(TableAlias);
public static string IsPadded = Indexes.IsPadded.Alias(TableAlias);
public static string IsPrimaryKey = Indexes.IsPrimaryKey.Alias(TableAlias);
public static string IsUnique = Indexes.IsUnique.Alias(TableAlias);
public static string IsUniquestaticraint = Indexes.IsUniquestaticraint.Alias(TableAlias);
public static string Name = Indexes.Name.Alias(TableAlias);
public static string ObjectId = Indexes.ObjectId.Alias(TableAlias);
public static string Type = Indexes.Type.Alias(TableAlias);
public static string TypeDesc = Indexes.TypeDesc.Alias(TableAlias);
}
}
public static class ComputedColumns
{
public static string TableName = "[sys].[computed_columns]";
public static string TableAlias = "[SCC]";
public static string CollationName = "collation_name";
public static string ColumnId = "column_id";
public static string DefaultObjectId = "default_object_id";
public static string Definition = "definition";
public static string IsAnsiPadded = "is_ansi_padded";
public static string IsColumnSet = "is_column_set";
public static string IsComputed = "is_computed";
public static string IsDtsReplicated = "is_dts_replicated";
public static string IsFilestream = "is_filestream";
public static string IsIdentity = "is_identity";
public static string IsMergePublished = "is_merge_published";
public static string IsNonSqlSubscribed = "is_non_sql_subscribed";
public static string IsNullable = "is_nullable";
public static string IsPersisted = "is_persisted";
public static string IsReplicated = "is_replicated";
public static string IsRowguidcol = "is_rowguidcol";
public static string IsSparse = "is_sparse";
public static string IsXmlDocument = "is_xml_document";
public static string MaxLength = "max_length";
public static string Name = "name";
public static string ObjectId = "object_id";
public static string Precision = "precision";
public static string RuleObjectId = "rule_object_id";
public static string Scale = "scale";
public static string SystemTypeId = "system_type_id";
public static string UserTypeId = "user_type_id";
public static string UsesDatabaseCollation = "uses_database_collation";
public static string XmlCollectionId = "xml_collection_id";
public static class Aliased
{
public static string CollationName = ComputedColumns.CollationName.Alias(TableAlias);
public static string ColumnId = ComputedColumns.ColumnId.Alias(TableAlias);
public static string DefaultObjectId = ComputedColumns.DefaultObjectId.Alias(TableAlias);
public static string Definition = ComputedColumns.Definition.Alias(TableAlias);
public static string IsAnsiPadded = ComputedColumns.IsAnsiPadded.Alias(TableAlias);
public static string IsColumnSet = ComputedColumns.IsColumnSet.Alias(TableAlias);
public static string IsComputed = ComputedColumns.IsComputed.Alias(TableAlias);
public static string IsDtsReplicated = ComputedColumns.IsDtsReplicated.Alias(TableAlias);
public static string IsFilestream = ComputedColumns.IsFilestream.Alias(TableAlias);
public static string IsIdentity = ComputedColumns.IsIdentity.Alias(TableAlias);
public static string IsMergePublished = ComputedColumns.IsMergePublished.Alias(TableAlias);
public static string IsNonSqlSubscribed = ComputedColumns.IsNonSqlSubscribed.Alias(TableAlias);
public static string IsNullable = ComputedColumns.IsNullable.Alias(TableAlias);
public static string IsPersisted = ComputedColumns.IsPersisted.Alias(TableAlias);
public static string IsReplicated = ComputedColumns.IsReplicated.Alias(TableAlias);
public static string IsRowguidcol = ComputedColumns.IsRowguidcol.Alias(TableAlias);
public static string IsSparse = ComputedColumns.IsSparse.Alias(TableAlias);
public static string IsXmlDocument = ComputedColumns.IsXmlDocument.Alias(TableAlias);
public static string MaxLength = ComputedColumns.MaxLength.Alias(TableAlias);
public static string Name = ComputedColumns.Name.Alias(TableAlias);
public static string ObjectId = ComputedColumns.ObjectId.Alias(TableAlias);
public static string Precision = ComputedColumns.Precision.Alias(TableAlias);
public static string RuleObjectId = ComputedColumns.RuleObjectId.Alias(TableAlias);
public static string Scale = ComputedColumns.Scale.Alias(TableAlias);
public static string SystemTypeId = ComputedColumns.SystemTypeId.Alias(TableAlias);
public static string UserTypeId = ComputedColumns.UserTypeId.Alias(TableAlias);
public static string UsesDatabaseCollation = ComputedColumns.UsesDatabaseCollation.Alias(TableAlias);
public static string XmlCollectionId = ComputedColumns.XmlCollectionId.Alias(TableAlias);
}
}
}
} | 66.176056 | 118 | 0.657976 | [
"MIT"
] | mikeobrien/Gribble | src/Gribble/TransactSql/SystemTables.cs | 18,796 | C# |
ο»Ώ
public record Talk(Guid Id,
[property: Required(ErrorMessage = "Please, input the title")] string Title,
[property: Required(ErrorMessage = "Please, input the name of speaker")] string Speaker,
string Trail);
| 35.166667 | 88 | 0.753555 | [
"MIT"
] | juniorporfirio/TDCFuture21-NET6-MinimalApis | src/TDCFutureTalks.Mediator/Entities/Talk.cs | 213 | C# |
ο»Ώusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using Google.Authenticator;
using TwoFactorAuthentication.Models;
using Umbraco.Web.WebApi;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity.Owin;
using Umbraco.Web.Editors;
using System.Net;
using Umbraco.Core;
using Umbraco.Core.Security;
public class TwoFactorAuthController : UmbracoAuthorizedApiController
{
private readonly TwoFactorService _twoFactorService;
public TwoFactorAuthController(TwoFactorService twoFactorService)
{
_twoFactorService = twoFactorService;
}
[HttpGet]
public List<TwoFactorAuthInfo> TwoFactorEnabled()
{
var user = Security.CurrentUser;
var result =_twoFactorService.GetTwoFactorEnabled(user.Id);
return result;
}
[HttpGet]
public TwoFactorAuthInfo GoogleAuthenticatorSetupCode()
{
var tfa = new TwoFactorAuthenticator();
var user = Security.CurrentUser;
var accountSecretKey = Guid.NewGuid().ToString();
var setupInfo = tfa.GenerateSetupCode(Constants.ApplicationName, user.Email, accountSecretKey, 300, 300);
var twoFactorAuthInfo = _twoFactorService.GetExistingAccount(user.Id, Constants.GoogleAuthenticatorProviderName, accountSecretKey);
twoFactorAuthInfo.Secret = setupInfo.ManualEntryKey;
twoFactorAuthInfo.Email = user.Email;
twoFactorAuthInfo.ApplicationName = Constants.ApplicationName;
twoFactorAuthInfo.QrCodeSetupImageUrl = setupInfo.QrCodeSetupImageUrl;
return twoFactorAuthInfo;
}
[HttpPost]
public bool ValidateAndSaveGoogleAuth(string code)
{
var user = Security.CurrentUser;
return _twoFactorService.ValidateAndSaveGoogleAuth(code, user.Id);
}
[HttpPost]
public bool Disable()
{
var result = 0;
var isAdmin = Security.CurrentUser.Groups.Select(x => x.Name == "Administrators").FirstOrDefault();
if (isAdmin)
{
var user = Security.CurrentUser;
result = _twoFactorService.Disable(user.Id);
//if more than 0 rows have been deleted, the query ran successfully
}
return result != 0;
}
}
| 28.974359 | 139 | 0.703982 | [
"MIT"
] | Dallas-msc/umbraco-2fa-with-google-authenticator | YubiKey2Factor/TwoFactorAuthentication/Controllers/TwoFactorAuthController.cs | 2,262 | C# |
ο»Ώ// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Azure.Core.TestFramework;
using Azure.ResourceManager.Compute.Models;
using Azure.Management.Resources;
using NUnit.Framework;
namespace Azure.ResourceManager.Compute.Tests
{
public class VMScaleSetScenarioTests : VMScaleSetVMTestsBase
{
public VMScaleSetScenarioTests(bool isAsync)
: base(isAsync)
{
}
/// <summary>
/// Covers following Operations:
/// Create RG
/// Create Storage Account
/// Create Network Resources
/// Create VMScaleSet with extension
/// Get VMScaleSet Model View
/// Get VMScaleSet Instance View
/// List VMScaleSets in a RG
/// List Available Skus
/// Delete VMScaleSet
/// Delete RG
/// </summary>
[Test]
[Ignore("This should be tested by compute team")]
//[Trait("Name", "TestVMScaleSetScenarioOperations")]
public async Task TestVMScaleSetScenarioOperations()
{
await TestScaleSetOperationsInternal();
}
/// <summary>
/// Covers following Operations for ManagedDisks:
/// Create RG
/// Create Storage Account
/// Create Network Resources
/// Create VMScaleSet with extension
/// Get VMScaleSet Model View
/// Get VMScaleSet Instance View
/// List VMScaleSets in a RG
/// List Available Skus
/// Delete VMScaleSet
/// Delete RG
/// </summary>
[Test]
//[Trait("Name", "TestVMScaleSetScenarioOperations_ManagedDisks")]
public async Task TestVMScaleSetScenarioOperations_ManagedDisks_PirImage()
{
await TestScaleSetOperationsInternal(hasManagedDisks: true, useVmssExtension: false);
}
/// <summary>
/// To record this test case, you need to run it again zone supported regions like eastus2euap.
/// </summary>
[Test]
//[Trait("Name", "TestVMScaleSetScenarioOperations_ManagedDisks_PirImage_SingleZone")]
public async Task TestVMScaleSetScenarioOperations_ManagedDisks_PirImage_SingleZone()
{
string originalTestLocation = Environment.GetEnvironmentVariable("AZURE_VM_TEST_LOCATION");
try
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", "centralus");
await TestScaleSetOperationsInternal(hasManagedDisks: true, useVmssExtension: false, zones: new List<string> { "1" });
}
finally
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", originalTestLocation);
}
}
/// <summary>
/// To record this test case, you need to run it in region which support local diff disks.
/// </summary>
[Test]
[Ignore("this case should be tested by compute team it can playback in track2")]
//[Trait("Name", "TestVMScaleSetScenarioOperations_DiffDisks")]
public async Task TestVMScaleSetScenarioOperations_DiffDisks()
{
string originalTestLocation = Environment.GetEnvironmentVariable("AZURE_VM_TEST_LOCATION");
try
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", "northeurope");
await TestScaleSetOperationsInternal(vmSize: VirtualMachineSizeTypes.StandardDS5V2.ToString(), hasManagedDisks: true,
hasDiffDisks: true);
}
finally
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", originalTestLocation);
}
}
/// <summary>
/// To record this test case, you need to run it in region which support DiskEncryptionSet resource for the Disks
/// </summary>
[Test]
[Ignore("this should be tested by generate team")]
//[Trait("Name", "TestVMScaleSetScenarioOperations_With_DiskEncryptionSet")]
public async Task TestVMScaleSetScenarioOperations_With_DiskEncryptionSet()
{
string originalTestLocation = Environment.GetEnvironmentVariable("AZURE_VM_TEST_LOCATION");
try
{
string diskEncryptionSetId = getDefaultDiskEncryptionSetId();
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", "centraluseuap");
await TestScaleSetOperationsInternal(vmSize: VirtualMachineSizeTypes.StandardA1V2.ToString(), hasManagedDisks: true, osDiskSizeInGB: 175, diskEncryptionSetId: diskEncryptionSetId);
}
finally
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", originalTestLocation);
}
}
[Test]
//[Trait("Name", "TestVMScaleSetScenarioOperations_UltraSSD")]
public async Task TestVMScaleSetScenarioOperations_UltraSSD()
{
string originalTestLocation = Environment.GetEnvironmentVariable("AZURE_VM_TEST_LOCATION");
try
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", "eastus2");
await TestScaleSetOperationsInternal(vmSize: VirtualMachineSizeTypes.StandardE4SV3.ToString(), hasManagedDisks: true,
useVmssExtension: false, zones: new List<string> { "1" }, enableUltraSSD: true, osDiskSizeInGB: 175);
}
finally
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", originalTestLocation);
}
}
/// <summary>
/// To record this test case, you need to run it again zone supported regions like eastus2euap.
/// </summary>
[Test]
//[Trait("Name", "TestVMScaleSetScenarioOperations_ManagedDisks_PirImage_Zones")]
public async Task TestVMScaleSetScenarioOperations_ManagedDisks_PirImage_Zones()
{
string originalTestLocation = Environment.GetEnvironmentVariable("AZURE_VM_TEST_LOCATION");
try
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", "centralus");
await TestScaleSetOperationsInternal(
hasManagedDisks: true,
useVmssExtension: false,
zones: new List<string> { "1", "3" },
osDiskSizeInGB: 175);
}
finally
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", originalTestLocation);
}
}
/// <summary>
/// To record this test case, you need to run it again zone supported regions like eastus2euap.
/// </summary>
[Test]
//[Trait("Name", "TestVMScaleSetScenarioOperations_PpgScenario")]
public async Task TestVMScaleSetScenarioOperations_PpgScenario()
{
string originalTestLocation = Environment.GetEnvironmentVariable("AZURE_VM_TEST_LOCATION");
try
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", "eastus2");
await TestScaleSetOperationsInternal(hasManagedDisks: true, useVmssExtension: false, isPpgScenario: true);
}
finally
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", originalTestLocation);
}
}
[Test]
//[Trait("Name", "TestVMScaleSetScenarioOperations_ScheduledEvents")]
public async Task TestVMScaleSetScenarioOperations_ScheduledEvents()
{
string originalTestLocation = Environment.GetEnvironmentVariable("AZURE_VM_TEST_LOCATION");
try
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", "eastus2");
await TestScaleSetOperationsInternal(hasManagedDisks: true, useVmssExtension: false,
vmScaleSetCustomizer:
vmScaleSet =>
{
vmScaleSet.VirtualMachineProfile.ScheduledEventsProfile = new ScheduledEventsProfile
{
TerminateNotificationProfile = new TerminateNotificationProfile
{
Enable = true,
NotBeforeTimeout = "PT6M",
}
};
},
vmScaleSetValidator: vmScaleSet =>
{
Assert.True(true == vmScaleSet.VirtualMachineProfile.ScheduledEventsProfile?.TerminateNotificationProfile?.Enable);
Assert.True("PT6M" == vmScaleSet.VirtualMachineProfile.ScheduledEventsProfile?.TerminateNotificationProfile?.NotBeforeTimeout);
});
}
finally
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", originalTestLocation);
}
}
[Test]
//[Trait("Name", "TestVMScaleSetScenarioOperations_AutomaticRepairsPolicyTest")]
public async Task TestVMScaleSetScenarioOperations_AutomaticRepairsPolicyTest()
{
string environmentVariable = "AZURE_VM_TEST_LOCATION";
//change the location 'centraluseuap' to 'eastus2'
string region = "eastus2";
string originalTestLocation = Environment.GetEnvironmentVariable(environmentVariable);
try
{
Environment.SetEnvironmentVariable(environmentVariable, region);
EnsureClientsInitialized();
ImageReference imageRef = await GetPlatformVMImage(useWindowsImage: true);
// Create resource group
var rgName = Recording.GenerateAssetName(TestPrefix);
var vmssName = Recording.GenerateAssetName("vmss");
string storageAccountName = Recording.GenerateAssetName(TestPrefix);
VirtualMachineScaleSet inputVMScaleSet;
var storageAccountOutput = await CreateStorageAccount(rgName, storageAccountName);
await WaitForCompletionAsync(await VirtualMachineScaleSetsClient.StartDeleteAsync(rgName, "VMScaleSetDoesNotExist"));
var getTwoVirtualMachineScaleSet = await CreateVMScaleSet_NoAsyncTracking(
rgName,
vmssName,
storageAccountOutput,
imageRef,
null,
(vmScaleSet) =>
{
vmScaleSet.Overprovision = false;
},
createWithManagedDisks: true,
createWithPublicIpAddress: false,
createWithHealthProbe: true);
VirtualMachineScaleSet getResponse = getTwoVirtualMachineScaleSet.Item1;
inputVMScaleSet = getTwoVirtualMachineScaleSet.Item2;
ValidateVMScaleSet(inputVMScaleSet, getResponse, hasManagedDisks: true);
// Set Automatic Repairs to true
inputVMScaleSet.AutomaticRepairsPolicy = new AutomaticRepairsPolicy()
{
Enabled = true
};
await UpdateVMScaleSet(rgName, vmssName, inputVMScaleSet);
getResponse = await VirtualMachineScaleSetsClient.GetAsync(rgName, vmssName);
Assert.NotNull(getResponse.AutomaticRepairsPolicy);
ValidateVMScaleSet(inputVMScaleSet, getResponse, hasManagedDisks: true);
// Update Automatic Repairs default values
inputVMScaleSet.AutomaticRepairsPolicy = new AutomaticRepairsPolicy()
{
Enabled = true,
GracePeriod = "PT35M"
};
await UpdateVMScaleSet(rgName, vmssName, inputVMScaleSet);
getResponse = await VirtualMachineScaleSetsClient.GetAsync(rgName, vmssName);
Assert.NotNull(getResponse.AutomaticRepairsPolicy);
ValidateVMScaleSet(inputVMScaleSet, getResponse, hasManagedDisks: true);
// Set automatic repairs to null
inputVMScaleSet.AutomaticRepairsPolicy = null;
await UpdateVMScaleSet(rgName, vmssName, inputVMScaleSet);
getResponse = await VirtualMachineScaleSetsClient.GetAsync(rgName, vmssName);
ValidateVMScaleSet(inputVMScaleSet, getResponse, hasManagedDisks: true);
Assert.NotNull(getResponse.AutomaticRepairsPolicy);
Assert.True(getResponse.AutomaticRepairsPolicy.Enabled == true);
Assert.AreEqual("PT35M", getResponse.AutomaticRepairsPolicy.GracePeriod);
// Disable Automatic Repairs
inputVMScaleSet.AutomaticRepairsPolicy = new AutomaticRepairsPolicy()
{
Enabled = false
};
await UpdateVMScaleSet(rgName, vmssName, inputVMScaleSet);
getResponse = await VirtualMachineScaleSetsClient.GetAsync(rgName, vmssName);
Assert.NotNull(getResponse.AutomaticRepairsPolicy);
Assert.True(getResponse.AutomaticRepairsPolicy.Enabled == false);
}
finally
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", originalTestLocation);
}
}
[Test]
//[Trait("Name", "TestVMScaleSetScenarioOperations_OrchestrationService")]
public async Task TestVMScaleSetScenarioOperations_OrchestrationService()
{
string environmentVariable = "AZURE_VM_TEST_LOCATION";
string region = "northeurope";
string originalTestLocation = Environment.GetEnvironmentVariable(environmentVariable);
try
{
Environment.SetEnvironmentVariable(environmentVariable, region);
EnsureClientsInitialized();
ImageReference imageRef = await GetPlatformVMImage(useWindowsImage: true);
// Create resource group
var rgName = Recording.GenerateAssetName(TestPrefix);
var vmssName = Recording.GenerateAssetName("vmss");
string storageAccountName = Recording.GenerateAssetName(TestPrefix);
VirtualMachineScaleSet inputVMScaleSet;
var storageAccountOutput = await CreateStorageAccount(rgName, storageAccountName);
await WaitForCompletionAsync(await VirtualMachineScaleSetsClient.StartDeleteAsync(rgName, "VMScaleSetDoesNotExist"));
AutomaticRepairsPolicy automaticRepairsPolicy = new AutomaticRepairsPolicy()
{
Enabled = true
};
var getTwoVirtualMachineScaleSet = await CreateVMScaleSet_NoAsyncTracking(
rgName,
vmssName,
storageAccountOutput,
imageRef,
null,
(vmScaleSet) =>
{
vmScaleSet.Overprovision = false;
},
createWithManagedDisks: true,
createWithPublicIpAddress: false,
createWithHealthProbe: true,
automaticRepairsPolicy: automaticRepairsPolicy);
VirtualMachineScaleSet getResponse = getTwoVirtualMachineScaleSet.Item1;
inputVMScaleSet = getTwoVirtualMachineScaleSet.Item2;
ValidateVMScaleSet(inputVMScaleSet, getResponse, hasManagedDisks: true);
var getInstanceViewResponse = (await VirtualMachineScaleSetsClient.GetInstanceViewAsync(rgName, vmssName)).Value;
Assert.True(getInstanceViewResponse.OrchestrationServices.Count == 1);
Assert.AreEqual("Running", getInstanceViewResponse.OrchestrationServices[0].ServiceState.ToString());
Assert.AreEqual("AutomaticRepairs", getInstanceViewResponse.OrchestrationServices[0].ServiceName.ToString());
////TODO
OrchestrationServiceStateInput orchestrationServiceStateInput = new OrchestrationServiceStateInput(new OrchestrationServiceSummary().ServiceName, OrchestrationServiceStateAction.Suspend);
//OrchestrationServiceStateAction orchestrationServiceStateAction = new OrchestrationServiceStateAction();
await WaitForCompletionAsync(await VirtualMachineScaleSetsClient.StartSetOrchestrationServiceStateAsync(rgName, vmssName, orchestrationServiceStateInput));
getInstanceViewResponse = await VirtualMachineScaleSetsClient.GetInstanceViewAsync(rgName, vmssName);
Assert.AreEqual(OrchestrationServiceState.Suspended.ToString(), getInstanceViewResponse.OrchestrationServices[0].ServiceState.ToString());
orchestrationServiceStateInput = new OrchestrationServiceStateInput(new OrchestrationServiceSummary().ServiceName, OrchestrationServiceStateAction.Resume);
await WaitForCompletionAsync(await VirtualMachineScaleSetsClient.StartSetOrchestrationServiceStateAsync(rgName, vmssName, orchestrationServiceStateInput));
getInstanceViewResponse = await VirtualMachineScaleSetsClient.GetInstanceViewAsync(rgName, vmssName);
Assert.AreEqual(OrchestrationServiceState.Running.ToString(), getInstanceViewResponse.OrchestrationServices[0].ServiceState.ToString());
await WaitForCompletionAsync(await VirtualMachineScaleSetsClient.StartDeleteAsync(rgName, vmssName));
}
finally
{
Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", originalTestLocation);
}
}
private async Task TestScaleSetOperationsInternal(string vmSize = null, bool hasManagedDisks = false, bool useVmssExtension = true,
bool hasDiffDisks = false, IList<string> zones = null, int? osDiskSizeInGB = null, bool isPpgScenario = false, bool? enableUltraSSD = false,
Action<VirtualMachineScaleSet> vmScaleSetCustomizer = null, Action<VirtualMachineScaleSet> vmScaleSetValidator = null, string diskEncryptionSetId = null)
{
EnsureClientsInitialized();
ImageReference imageRef = await GetPlatformVMImage(useWindowsImage: true);
// Create resource group
var rgName = Recording.GenerateAssetName(TestPrefix);
var vmssName = Recording.GenerateAssetName("vmss");
string storageAccountName = Recording.GenerateAssetName(TestPrefix);
VirtualMachineScaleSet inputVMScaleSet;
VirtualMachineScaleSetExtensionProfile extensionProfile = new VirtualMachineScaleSetExtensionProfile()
{
Extensions = new List<VirtualMachineScaleSetExtension>()
{
GetTestVMSSVMExtension(),
}
};
var storageAccountOutput = await CreateStorageAccount(rgName, storageAccountName);
await WaitForCompletionAsync(await VirtualMachineScaleSetsClient.StartDeleteAsync(rgName, "VMScaleSetDoesNotExist"));
string ppgId = null;
string ppgName = null;
if (isPpgScenario)
{
ppgName = Recording.GenerateAssetName("ppgtest");
ppgId = await CreateProximityPlacementGroup(rgName, ppgName);
}
var getTwoVirtualMachineScaleSet = await CreateVMScaleSet_NoAsyncTracking(
rgName,
vmssName,
storageAccountOutput,
imageRef,
useVmssExtension ? extensionProfile : null,
(vmScaleSet) =>
{
vmScaleSet.Overprovision = true;
if (!String.IsNullOrEmpty(vmSize))
{
vmScaleSet.Sku.Name = vmSize;
}
vmScaleSetCustomizer?.Invoke(vmScaleSet);
},
createWithManagedDisks: hasManagedDisks,
hasDiffDisks: hasDiffDisks,
zones: zones,
osDiskSizeInGB: osDiskSizeInGB,
ppgId: ppgId,
enableUltraSSD: enableUltraSSD,
diskEncryptionSetId: diskEncryptionSetId);
VirtualMachineScaleSet getResponse = getTwoVirtualMachineScaleSet.Item1;
inputVMScaleSet = getTwoVirtualMachineScaleSet.Item2;
if (diskEncryptionSetId != null)
{
Assert.True(getResponse.VirtualMachineProfile.StorageProfile.OsDisk.ManagedDisk.DiskEncryptionSet != null, "OsDisk.ManagedDisk.DiskEncryptionSet is null");
Assert.True(string.Equals(diskEncryptionSetId, getResponse.VirtualMachineProfile.StorageProfile.OsDisk.ManagedDisk.DiskEncryptionSet.Id, StringComparison.OrdinalIgnoreCase),
"OsDisk.ManagedDisk.DiskEncryptionSet.Id is not matching with expected DiskEncryptionSet resource");
Assert.AreEqual(1, getResponse.VirtualMachineProfile.StorageProfile.DataDisks.Count);
Assert.True(getResponse.VirtualMachineProfile.StorageProfile.DataDisks[0].ManagedDisk.DiskEncryptionSet != null, ".DataDisks.ManagedDisk.DiskEncryptionSet is null");
Assert.True(string.Equals(diskEncryptionSetId, getResponse.VirtualMachineProfile.StorageProfile.DataDisks[0].ManagedDisk.DiskEncryptionSet.Id, StringComparison.OrdinalIgnoreCase),
"DataDisks.ManagedDisk.DiskEncryptionSet.Id is not matching with expected DiskEncryptionSet resource");
}
ValidateVMScaleSet(inputVMScaleSet, getResponse, hasManagedDisks, ppgId: ppgId);
var getInstanceViewResponse = await VirtualMachineScaleSetsClient.GetInstanceViewAsync(rgName, vmssName);
Assert.NotNull(getInstanceViewResponse);
ValidateVMScaleSetInstanceView(inputVMScaleSet, getInstanceViewResponse);
if (isPpgScenario)
{
ProximityPlacementGroup outProximityPlacementGroup = await ProximityPlacementGroupsClient.GetAsync(rgName, ppgName);
Assert.AreEqual(1, outProximityPlacementGroup.VirtualMachineScaleSets.Count);
string expectedVmssReferenceId = Helpers.GetVMScaleSetReferenceId(m_subId, rgName, vmssName);
Assert.AreEqual(expectedVmssReferenceId.ToLower(), outProximityPlacementGroup.VirtualMachineScaleSets.First().Id.ToLower());
}
var listResponse = await (VirtualMachineScaleSetsClient.ListAsync(rgName)).ToEnumerableAsync();
ValidateVMScaleSet(inputVMScaleSet, listResponse.FirstOrDefault(x => x.Name == vmssName), hasManagedDisks);
var listSkusResponse = await (VirtualMachineScaleSetsClient.ListSkusAsync(rgName, vmssName)).ToEnumerableAsync();
Assert.NotNull(listSkusResponse);
Assert.False(listSkusResponse.Count() == 0);
if (zones != null)
{
var query = "properties/latestModelApplied eq true";
var listVMsResponse = await (VirtualMachineScaleSetVMsClient.ListAsync(rgName, vmssName, query)).ToEnumerableAsync();
Assert.False(listVMsResponse == null, "VMScaleSetVMs not returned");
Assert.True(listVMsResponse.Count() == inputVMScaleSet.Sku.Capacity);
foreach (var vmScaleSetVM in listVMsResponse)
{
string instanceId = vmScaleSetVM.InstanceId;
var getVMResponse = await VirtualMachineScaleSetVMsClient.GetAsync(rgName, vmssName, instanceId);
ValidateVMScaleSetVM(inputVMScaleSet, instanceId, getVMResponse, hasManagedDisks);
}
}
vmScaleSetValidator?.Invoke(getResponse);
await WaitForCompletionAsync(await VirtualMachineScaleSetsClient.StartDeleteAsync(rgName, vmssName));
}
}
}
| 49.523327 | 203 | 0.636125 | [
"MIT"
] | Youri970410/azure-sdk-for-net | sdk/compute/Azure.ResourceManager.Compute/tests/VMScaleSetTests/VMScaleSetScenarioTests.cs | 24,417 | C# |
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 3.0.12
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------
namespace QuantLib {
public class ForwardCurve : YieldTermStructure {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
internal ForwardCurve(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NQuantLibcPINVOKE.ForwardCurve_SWIGUpcast(cPtr), cMemoryOwn) {
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ForwardCurve obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
~ForwardCurve() {
Dispose();
}
public override void Dispose() {
lock(this) {
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false;
NQuantLibcPINVOKE.delete_ForwardCurve(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
global::System.GC.SuppressFinalize(this);
base.Dispose();
}
}
public ForwardCurve(DateVector dates, DoubleVector forwards, DayCounter dayCounter, Calendar calendar, BackwardFlat i) : this(NQuantLibcPINVOKE.new_ForwardCurve__SWIG_0(DateVector.getCPtr(dates), DoubleVector.getCPtr(forwards), DayCounter.getCPtr(dayCounter), Calendar.getCPtr(calendar), BackwardFlat.getCPtr(i)), true) {
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
}
public ForwardCurve(DateVector dates, DoubleVector forwards, DayCounter dayCounter, Calendar calendar) : this(NQuantLibcPINVOKE.new_ForwardCurve__SWIG_1(DateVector.getCPtr(dates), DoubleVector.getCPtr(forwards), DayCounter.getCPtr(dayCounter), Calendar.getCPtr(calendar)), true) {
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
}
public ForwardCurve(DateVector dates, DoubleVector forwards, DayCounter dayCounter) : this(NQuantLibcPINVOKE.new_ForwardCurve__SWIG_2(DateVector.getCPtr(dates), DoubleVector.getCPtr(forwards), DayCounter.getCPtr(dayCounter)), true) {
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
}
public DateVector dates() {
DateVector ret = new DateVector(NQuantLibcPINVOKE.ForwardCurve_dates(swigCPtr), false);
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public DoubleVector forwards() {
DoubleVector ret = new DoubleVector(NQuantLibcPINVOKE.ForwardCurve_forwards(swigCPtr), false);
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public NodeVector nodes() {
NodeVector ret = new NodeVector(NQuantLibcPINVOKE.ForwardCurve_nodes(swigCPtr), true);
if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
}
| 45.96 | 323 | 0.731941 | [
"BSD-3-Clause"
] | x-xing/Quantlib-SWIG | CSharp/csharp/ForwardCurve.cs | 3,447 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Rudrac.TowerDefence.Inventory
{
public class Inventory : MonoBehaviour
{
public static Inventory instance;
public Stats.CharacterStats stats;
public UI.InventoryUiScript[] hotbarUIitems;
[System.Serializable]
public struct inventoryRow { public List<ItemPickUP_SO> inventoryRowitems; }
public inventoryRow[] inventoryitmes;
int currentRow;
int currentID;
public SkillType GetSkillType()
{
return inventoryitmes[currentRow].inventoryRowitems[currentID].skilltype;
}
// Start is called before the first frame update
void Start()
{
instance = this;
currentRow = 0;
SetData();
if (inventoryitmes[currentRow].inventoryRowitems[0] == null) return;
if (inventoryitmes[currentRow].inventoryRowitems[0].skilltype == SkillType.Weapon)
UseItem(1);
}
void SetData()
{
for (int j = 0; j < inventoryitmes[currentRow].inventoryRowitems.Count; j++)
{
if (inventoryitmes[currentRow].inventoryRowitems[j] != null)
{
hotbarUIitems[j].setDetails(inventoryitmes[currentRow].inventoryRowitems[j]);
}
else
{
hotbarUIitems[j].setDetails();
}
}
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.Alpha1))
UseItem(1);
else if (Input.GetKeyDown(KeyCode.Alpha2))
UseItem(2);
else if (Input.GetKeyDown(KeyCode.Alpha3))
UseItem(3);
else if (Input.GetKeyDown(KeyCode.Alpha4))
UseItem(4);
else if (Input.GetKeyDown(KeyCode.Alpha5))
UseItem(5);
else if (Input.GetKeyDown(KeyCode.Alpha6))
UseItem(6);
else if (Input.GetKeyDown(KeyCode.Alpha7))
UseItem(7);
else if (Input.GetKeyDown(KeyCode.Alpha8))
UseItem(8);
else if (Input.GetKeyDown(KeyCode.Alpha9))
UseItem(9);
else if (Input.GetKeyDown(KeyCode.Alpha0))
UseItem(10);
if(Input.mouseScrollDelta == Vector2.down)
{
currentRow++;
if(currentRow> inventoryitmes.Length-1)
{
currentRow = 0;
}
SetData();
if (inventoryitmes[currentRow].inventoryRowitems[0] == null) return;
if (inventoryitmes[currentRow].inventoryRowitems[0].skilltype == SkillType.Weapon)
UseItem(1);
}
if(Input.mouseScrollDelta == Vector2.up)
{
currentRow--;
if(currentRow< 0)
{
currentRow = inventoryitmes.Length-1;
}
SetData();
if (inventoryitmes[currentRow].inventoryRowitems[0] == null) return;
if (inventoryitmes[currentRow].inventoryRowitems[0].skilltype == SkillType.Weapon)
UseItem(1);
}
}
public void UseItem(int id)
{
for (int i = 0; i < hotbarUIitems.Length; i++)
{
if (i == id - 1)
{
hotbarUIitems[i].selected(inventoryitmes[currentRow].inventoryRowitems[i]);
if (inventoryitmes[currentRow].inventoryRowitems[i] == null) stats.removeWeapon();
if (inventoryitmes[currentRow].inventoryRowitems[i] != null)
{
switch (inventoryitmes[currentRow].inventoryRowitems[i].skilltype)
{
case SkillType.Weapon:
inventoryitmes[currentRow].inventoryRowitems[i].UseItem(stats);
break;
case SkillType.Troop:
if(hotbarUIitems[i].canFire)
inventoryitmes[currentRow].inventoryRowitems[i].UseItem(stats);
break;
default:
break;
}
}
currentID = i;
}
else
hotbarUIitems[i].notselected();
}
}
public void StartTimer()
{
hotbarUIitems[currentID].startTimer();
}
}
}
| 32.95302 | 102 | 0.482892 | [
"Apache-2.0"
] | venkatesh21m/TowerDefenceGame | TowerDefence/Assets/_Scripts/Engine/Inventory/Inventory.cs | 4,910 | C# |
ο»Ώusing System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;
public class ButtonManager : MonoBehaviour
{
private Button btn;
[SerializeField] private RawImage buttonImage;
public GameObject furniture;
private int itemId;
private Sprite buttonTexture;
public int ItemId
{
set{
itemId = value;
}
}
public Sprite ButtonTexture
{
set{
buttonTexture = value;
buttonImage.texture = buttonTexture.texture;
}
}
// Start is called before the first frame update
void Start()
{
btn = GetComponent<Button>();
btn.onClick.AddListener(SelectObject);
}
void Update() {
if(UIManager.Instance.OnEntered(gameObject))
{
// transform.localScale = Vector3.one * 2;
transform.DOScale(Vector3.one * 1.8f,0.2f);
}
else
{
// transform.localScale = Vector3.one;
transform.DOScale(Vector3.one,0.2f);
}
}
void SelectObject()
{
DataHandler.Instance.SetFurniture(itemId);
}
}
| 20.807018 | 56 | 0.589376 | [
"MIT"
] | Shrimad-Bhagwat/AR-PROJECT | AR-PROJECT-main/Assets/Scripts/ButtonManager.cs | 1,188 | C# |
//
// NSArray_GameplayKit.cs: Generic extensions to NSArray
//
// Authors:
// Alex Soto <alexsoto@microsoft.com>
//
// Copyright 2016 Xamarin Inc. All rights reserved.
//
using System;
using Foundation;
using ObjCRuntime;
namespace GameplayKit {
#if NET
[SupportedOSPlatform ("ios10.0")]
[SupportedOSPlatform ("tvos10.0")]
[SupportedOSPlatform ("macos10.12")]
#else
[iOS (10,0)]
[TV (10,0)]
[Mac (10,12)]
#endif
public static class NSArray_GameplayKit {
[Export ("shuffledArrayWithRandomSource:")]
public static T [] GetShuffledArray<T> (this NSArray This, GKRandomSource randomSource) where T : class, INativeObject
{
if (randomSource == null)
throw new ArgumentNullException (nameof (randomSource));
return NSArray.ArrayFromHandle<T> (Messaging.IntPtr_objc_msgSend_IntPtr (This.Handle, Selector.GetHandle ("shuffledArrayWithRandomSource:"), randomSource.Handle));
}
[Export ("shuffledArray")]
public static T [] GetShuffledArray<T> (this NSArray This) where T : class, INativeObject
{
return NSArray.ArrayFromHandle<T> (Messaging.IntPtr_objc_msgSend (This.Handle, Selector.GetHandle ("shuffledArray")));
}
}
}
| 27.5 | 166 | 0.735065 | [
"BSD-3-Clause"
] | SotoiGhost/xamarin-macios | src/GameplayKit/NSArray_GameplayKit.cs | 1,155 | C# |
ο»Ώusing System.Threading;
using DragonSpark.Compose;
using DragonSpark.Model.Selection;
namespace DragonSpark.Runtime.Execution
{
public sealed class Counter : ICounter
{
int _count;
public int Get() => _count;
public void Execute(None parameter)
{
Interlocked.Increment(ref _count);
}
}
sealed class Counter<T> : Select<T, int>
{
public Counter() : base(Start.A.Selection<T>()
.AndOf<Counter>()
.By.Instantiation.ToTable()
.Select(x => x.Count())) {}
}
} | 22 | 58 | 0.587413 | [
"MIT"
] | Mike-EEE/LightInject-Fallback | LightInject-Fallback/DragonSpark/Runtime/Execution/Counter.cs | 574 | C# |
ο»Ώusing System;
using System.Collections.Generic;
using System.Text;
namespace H_PF.ToolLibs.HesoLogger.LogFormatters.Models
{
public class HesoLogWarning
{
}
}
| 15.727273 | 55 | 0.751445 | [
"MIT"
] | Hesothread/H-PF | H-PF.ToolLibs.HesoLogger.LogFormaters.LogFormater/Models/HesoLogWarning.cs | 175 | 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("ProfilingInjection")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ProfilingInjection")]
[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("8f4673a3-0f35-45ca-be18-7344c7eab21c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 37.945946 | 84 | 0.75 | [
"MIT"
] | varunramc/clr-profiling | ProfilerCore/Properties/AssemblyInfo.cs | 1,407 | C# |
ο»Ώusing System;
using System.Net.Http;
using System.Linq;
using DasBlog.Web;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;
using Xunit;
using System.Threading;
namespace DasBlog.Test.Integration
{
[Trait("Category", "SkipWhenLiveUnitTesting")]
public class SeleniumPageTests : IClassFixture<SeleniumServerFactory<Startup>>, IDisposable
{
public HttpClient Client { get; }
public SeleniumServerFactory<Startup> Server { get; }
public IWebDriver Browser { get; }
public ILogs Logs { get; }
public SeleniumPageTests(SeleniumServerFactory<Startup> server)
{
Console.WriteLine("In Docker?" + AreWe.InDockerOrBuildServer);
if (AreWe.InDockerOrBuildServer) return;
Server = server;
Client = server.CreateClient(); //weird side effecty thing here. This shouldn't be required but it is.
var opts = new ChromeOptions();
//opts.AddArgument("--headless");
opts.SetLoggingPreference(OpenQA.Selenium.LogType.Browser, LogLevel.All);
var driver = new RemoteWebDriver(opts);
Browser = driver;
Logs = new RemoteLogs(driver); //TODO: Still not bringing the logs over yet?
}
[SkippableFact(typeof(WebDriverException))]
public void LoadTheMainPageAndCheckPageTitle()
{
Skip.If(AreWe.InDockerOrBuildServer);
Browser.Navigate().GoToUrl(Server.RootUri);
Assert.StartsWith("My DasBlog!", Browser.Title);
}
[SkippableFact(typeof(WebDriverException))]
public void FrontPageH2PostTitle()
{
Skip.If(AreWe.InDockerOrBuildServer);
Browser.Navigate().GoToUrl(Server.RootUri);
var headerSelector = By.TagName("h2");
Assert.Equal("Welcome to DasBlog Core", Browser.FindElement(headerSelector).Text);
}
[SkippableFact(typeof(WebDriverException))]
public void WelcomePostCheckPageBrowserTitle()
{
Skip.If(AreWe.InDockerOrBuildServer);
Browser.Navigate().GoToUrl(Server.RootUri + "/welcome-to-dasblog-core");
Assert.StartsWith("Welcome to DasBlog Core", Browser.Title);
}
[SkippableFact(typeof(WebDriverException))]
public void WelcomePostH2PostTitle()
{
Skip.If(AreWe.InDockerOrBuildServer);
Browser.Navigate().GoToUrl(Server.RootUri + "/welcome-to-dasblog-core");
var headerSelector = By.TagName("h2");
Assert.Equal("Welcome to DasBlog Core", Browser.FindElement(headerSelector).Text);
}
[SkippableFact(typeof(WebDriverException))]
public void NavigateToWelcomePostThenGoHome()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
Browser.Navigate().GoToUrl(Server.RootUri + "/welcome-to-dasblog-core");
var headerSelector = By.LinkText("Home");
var link = Browser.FindElement(headerSelector);
link.Click();
Assert.Equal(Browser.Url.TrimEnd('/'), Server.RootUri);
}
[SkippableFact(typeof(WebDriverException))]
public void NavigateToPageOneAndBack()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
Browser.Navigate().GoToUrl(Server.RootUri);
var olderpostSelector = By.LinkText("<< Older Posts");
var link = Browser.FindElement(olderpostSelector);
link.Click();
Assert.Equal(Server.RootUri + "/page/1", Browser.Url.TrimEnd('/'));
var newerpostSelector = By.LinkText("Newer Posts >>");
var link2 = Browser.FindElement(newerpostSelector);
link2.Click();
Assert.Equal(Server.RootUri + "/page/0", Browser.Url.TrimEnd('/'));
}
[SkippableFact(typeof(WebDriverException))]
public void NavigateToCategory()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
Browser.Navigate().GoToUrl(Server.RootUri + "/category");
Assert.StartsWith("Category - My DasBlog!", Browser.Title);
}
[SkippableFact(typeof(WebDriverException))]
public void NavigateToSpecificCategoryNavigateToPost()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
Browser.Navigate().GoToUrl(Server.RootUri + "/category/dasblog-core");
Assert.StartsWith("Category - My DasBlog!", Browser.Title);
var headerSelector = By.TagName("h4");
Assert.Equal("Dasblog Core (1)", Browser.FindElement(headerSelector).Text);
var titleSelector = By.LinkText("Welcome to DasBlog Core");
Browser.FindElement(titleSelector).Click();
Assert.StartsWith("Welcome to DasBlog Core", Browser.Title);
}
[SkippableFact(typeof(WebDriverException))]
public void NavigateToSpecificArchiveDate()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
Browser.Navigate().GoToUrl(Server.RootUri + "/archive/2020/2/27");
Assert.StartsWith("Archive - My DasBlog!", Browser.Title);
var postSelector = By.PartialLinkText("Welcome to DasBlog Core");
var link = Browser.FindElement(postSelector);
link.Click();
Assert.Equal(Server.RootUri + "/welcome-to-dasblog-core", Browser.Url.TrimEnd('/'));
}
[SkippableFact(typeof(WebDriverException))]
public void NavigateToArchiveUseBackCalendarControls()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
Browser.Navigate().GoToUrl(Server.RootUri + "/archive/2020/2");
Assert.StartsWith("Archive - My DasBlog!", Browser.Title);
var navSelector = By.LinkText("<<");
var link = Browser.FindElement(navSelector);
link.Click();
Assert.Equal(Server.RootUri + "/archive/2020/1", Browser.Url.TrimEnd('/'));
}
[SkippableFact(typeof(WebDriverException))]
public void NavigateToArchiveUseForwardCalendarControls()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
Browser.Navigate().GoToUrl(Server.RootUri + "/archive/2020/2");
Assert.StartsWith("Archive - My DasBlog!", Browser.Title);
var navSelector = By.LinkText(">>");
var link = Browser.FindElement(navSelector);
link.Click();
Assert.Equal(Server.RootUri + "/archive/2020/3", Browser.Url.TrimEnd('/'));
}
[SkippableFact(typeof(WebDriverException))]
public void NavigateToRSSFeed()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
Browser.Navigate().GoToUrl(Server.RootUri + "/feed/rss");
Assert.Equal(Browser.Url.TrimEnd('/'), Server.RootUri + "/feed/rss");
}
[SkippableFact(typeof(WebDriverException))]
public void NavigateToPostAndCreateCommentDeleteComment()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
// Add comment
const string commentname = "First Name";
Browser.Navigate().GoToUrl(Server.RootUri + "/welcome-to-dasblog-core");
SendKeysToElement("Name", commentname);
SendKeysToElement("Email", "someemail@someplace.com");
SendKeysToElement("HomePage", "https://www.github.com/poppastring/dasblog-core");
SendKeysToElement("CheesyQuestionAnswered", "7");
SendKeysToElement("Content", "A comment about this blog post");
var navSelector = By.Id("SaveContentButton");
var link = Browser.FindElement(navSelector);
link.Click();
Assert.Equal(Server.RootUri + "/welcome-to-dasblog-core/comments#comments-start", Browser.Url.TrimEnd('/'));
var elementid = By.ClassName("dbc-comment-user-homepage-name");
Assert.Equal(commentname, Browser.FindElement(elementid).Text); ;
LoginToSite();
// Delete this comment
Browser.Navigate().GoToUrl(Server.RootUri + "/welcome-to-dasblog-core");
var deleteSelector = By.LinkText("Delete this comment");
var deletelink = Browser.FindElements(deleteSelector);
var deletecount = deletelink.Count;
deletelink[0].Click();
Browser.SwitchTo().Alert().Accept();
Browser.Navigate().GoToUrl(Server.RootUri);
Thread.Sleep(2000);
Browser.Navigate().GoToUrl(Server.RootUri + "/welcome-to-dasblog-core");
deleteSelector = By.LinkText("Delete this comment");
var deletelinks = Browser.FindElements(deleteSelector);
Assert.True(deletecount - 1 == deletelinks.Count);
}
[SkippableFact(typeof(WebDriverException))]
public void NavigateToPostAndCreateCommentManageCommentsPage()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
// Add comment
const string commentname = "Second Name";
Browser.Navigate().GoToUrl(Server.RootUri + "/welcome-to-dasblog-core");
SendKeysToElement("Name", commentname);
SendKeysToElement("Email", "otheremail@someplace.com");
SendKeysToElement("HomePage", "https://www.github.com/poppastring/dasblog-core");
SendKeysToElement("CheesyQuestionAnswered", "7");
SendKeysToElement("Content", "Another comment on this blog post");
var navSelector = By.Id("SaveContentButton");
var link = Browser.FindElement(navSelector);
link.Click();
LoginToSite();
// Navigate to comment management
Browser.Navigate().GoToUrl(Server.RootUri + "/admin/manage-comments");
Assert.Equal(Server.RootUri + "/admin/manage-comments", Browser.Url.TrimEnd('/'));
var postSelector = By.PartialLinkText("Delete this comment");
var link2 = Browser.FindElements(postSelector);
var deletecount = link2.Count;
link2[0].Click();
Browser.SwitchTo().Alert().Accept();
// Navigate to comment management
Browser.Navigate().GoToUrl(Server.RootUri + "/admin/manage-comments");
var deleteSelector = By.LinkText("Delete this comment");
var deletelink = Browser.FindElements(deleteSelector);
var deletecount2 = deletelink.Count;
Assert.True(deletecount - deletecount2 == 1, "Comment was not deleted");
}
[SkippableFact(typeof(WebDriverException))]
public void NavigateToLoginPageLoginThenLogout()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
Browser.Navigate().GoToUrl(Server.RootUri + "/post/create");
Assert.Equal(Server.RootUri + "/account/login?ReturnUrl=%2Fpost%2Fcreate", Browser.Url.TrimEnd('/'));
LoginToSite();
Browser.Navigate().GoToUrl(Server.RootUri + "/post/create");
Assert.Equal(Server.RootUri + "/post/create", Browser.Url.TrimEnd('/') );
Browser.Navigate().GoToUrl(Server.RootUri + "/account/logout");
try
{
var createpostSelector = By.Id("CreatePostLink");
var createpostlink = Browser.FindElement(createpostSelector);
}
catch(Exception)
{
Assert.StartsWith("My DasBlog!", Browser.Title);
}
}
[SkippableFact(typeof(WebDriverException))]
public void LoginCreateAPostThenEditPostThenDeletAPost()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
LoginToSite();
// Fill out post
Browser.Navigate().GoToUrl(Server.RootUri + "/post/create");
SendKeysToElement("BlogTitle", "A New Post");
// SendKeysToElement("tinymce", "We certainly hope this works...");
SendKeysToElement("BlogNewCategoryName", "Test Category");
// Add a new category
var newCategorySelector = By.Id("NewCategorySubmit");
var newcategorylink = Browser.FindElement(newCategorySelector);
newcategorylink.Click();
Assert.Equal(Browser.Url.TrimEnd('/'), Server.RootUri + "/post/create");
var blogpostSelector = By.Id("BlogPostCreateSubmit");
var blogpostSubmitlink = Browser.FindElement(blogpostSelector);
blogpostSubmitlink.Click();
// Check new post
Browser.Navigate().GoToUrl(Server.RootUri);
Browser.Navigate().GoToUrl(Server.RootUri + "/a-new-post");
Assert.StartsWith("A New Post", Browser.Title);
// Check new category
Browser.Navigate().GoToUrl(Server.RootUri + "/category/test-category");
var titleSelector = By.LinkText("A New Post");
Browser.FindElement(titleSelector).Click();
Assert.StartsWith("A New Post", Browser.Title);
//Navigate back to the main page and post
Browser.Navigate().GoToUrl(Server.RootUri);
Browser.Navigate().GoToUrl(Server.RootUri + "/a-new-post");
Assert.StartsWith("A New Post", Browser.Title);
//Edit the post title
var editpostSelector = By.LinkText("Edit this post");
var editpostSubmitlink = Browser.FindElement(editpostSelector);
editpostSubmitlink.Click();
SendKeysToElement("BlogTitle", " Now Edit");
blogpostSelector = By.Id("BlogPostEditSubmit");
blogpostSubmitlink = Browser.FindElement(blogpostSelector);
blogpostSubmitlink.Click();
//Check the new post title
Browser.Navigate().GoToUrl(Server.RootUri);
Browser.Navigate().GoToUrl(Server.RootUri + "/a-new-post-now-edit");
Assert.StartsWith("A New Post Now Edit", Browser.Title);
//Delete this post
var deletepostSelector = By.LinkText("Delete this post");
var deletepostSubmitlink = Browser.FindElement(deletepostSelector);
deletepostSubmitlink.Click();
Browser.SwitchTo().Alert().Accept();
// logout
Browser.Navigate().GoToUrl(Server.RootUri + "/account/logout");
var titledeleteSelector = By.LinkText("A New Post Now Edit");
var deletedLink = Browser.FindElements(titledeleteSelector);
Assert.True(deletedLink.Count == 0);
}
[SkippableFact(typeof(WebDriverException))]
public void LoginNavigateSiteAdmin()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
LoginToSite();
Browser.Navigate().GoToUrl(Server.RootUri + "/admin/settings");
var siteRoot = By.Id("SiteConfig_Root");
var roottext = Browser.FindElement(siteRoot);
Assert.Contains("https://localhost:5001/", roottext.GetAttribute("Value"));
}
[SkippableFact(typeof(WebDriverException))]
public void LoginNavigateUserAdmin()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
LoginToSite();
Browser.Navigate().GoToUrl(Server.RootUri + "/users/myemail@myemail.com");
var emailAddress = By.Name("EmailAddress");
var address = Browser.FindElement(emailAddress);
Assert.Contains("myemail@myemail.com", address.GetAttribute("Value"));
}
[SkippableFact(typeof(WebDriverException))]
public void LoginNavigateActivity()
{
Skip.If(AreWe.InDockerOrBuildServer, "In Docker!");
LoginToSite();
Browser.Navigate().GoToUrl(Server.RootUri + "/activity/list");
var forwardLink = By.LinkText(">|");
var forward = Browser.FindElement(forwardLink);
forward.Click();
var tablecolumn = By.ClassName("dbc-activity-table-column");
var tablecolumns = Browser.FindElements(tablecolumn);
Assert.True(tablecolumns.Count > 0);
}
private void LoginToSite()
{
Browser.Navigate().GoToUrl(Server.RootUri + "/account/login");
SendKeysToElement("Email", "myemail@myemail.com");
SendKeysToElement("Password", "admin");
var navSelector = By.Id("LoginButton");
var link = Browser.FindElement(navSelector);
link.Click();
}
private void SendKeysToElement(string element, string keystosend)
{
var elementid = By.Id(element);
var eleementlink = Browser.FindElement(elementid);
eleementlink.SendKeys(keystosend);
}
public void Dispose()
{
if (Browser != null)
Browser.Dispose();
}
}
}
| 30.942184 | 111 | 0.7191 | [
"MIT"
] | Korn1699/dasblog-core | source/DasBlog.Tests/DasBlog.Test.Integration/SeleniumPageTests.cs | 14,452 | C# |
public enum AddLifeType
{
OneUpMushroom,
Coin,
} | 11.2 | 23 | 0.678571 | [
"MIT"
] | GarfieldJiang/SMB_ECS | Assets/__MAIN__/Scripts/AddLifeType.cs | 56 | 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 elasticmapreduce-2009-03-31.normal.json service model.
*/
using System;
using System.Runtime.ExceptionServices;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using Amazon.ElasticMapReduce.Model;
using Amazon.ElasticMapReduce.Model.Internal.MarshallTransformations;
using Amazon.ElasticMapReduce.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.ElasticMapReduce
{
/// <summary>
/// Implementation for accessing ElasticMapReduce
///
/// Amazon EMR is a web service that makes it easy to process large amounts of data efficiently.
/// Amazon EMR uses Hadoop processing combined with several AWS products to do tasks such
/// as web indexing, data mining, log file analysis, machine learning, scientific simulation,
/// and data warehousing.
/// </summary>
public partial class AmazonElasticMapReduceClient : AmazonServiceClient, IAmazonElasticMapReduce
{
private static IServiceMetadata serviceMetadata = new AmazonElasticMapReduceMetadata();
#region Constructors
#if CORECLR
/// <summary>
/// Constructs AmazonElasticMapReduceClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
public AmazonElasticMapReduceClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonElasticMapReduceConfig()) { }
/// <summary>
/// Constructs AmazonElasticMapReduceClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name="region">The region to connect.</param>
public AmazonElasticMapReduceClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonElasticMapReduceConfig{RegionEndpoint = region}) { }
/// <summary>
/// Constructs AmazonElasticMapReduceClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name="config">The AmazonElasticMapReduceClient Configuration Object</param>
public AmazonElasticMapReduceClient(AmazonElasticMapReduceConfig config)
: base(FallbackCredentialsFactory.GetCredentials(), config) { }
#endif
/// <summary>
/// Constructs AmazonElasticMapReduceClient with AWS Credentials
/// </summary>
/// <param name="credentials">AWS Credentials</param>
public AmazonElasticMapReduceClient(AWSCredentials credentials)
: this(credentials, new AmazonElasticMapReduceConfig())
{
}
/// <summary>
/// Constructs AmazonElasticMapReduceClient with AWS Credentials
/// </summary>
/// <param name="credentials">AWS Credentials</param>
/// <param name="region">The region to connect.</param>
public AmazonElasticMapReduceClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonElasticMapReduceConfig{RegionEndpoint = region})
{
}
/// <summary>
/// Constructs AmazonElasticMapReduceClient with AWS Credentials and an
/// AmazonElasticMapReduceClient Configuration object.
/// </summary>
/// <param name="credentials">AWS Credentials</param>
/// <param name="clientConfig">The AmazonElasticMapReduceClient Configuration Object</param>
public AmazonElasticMapReduceClient(AWSCredentials credentials, AmazonElasticMapReduceConfig clientConfig)
: base(credentials, clientConfig)
{
}
/// <summary>
/// Constructs AmazonElasticMapReduceClient 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 AmazonElasticMapReduceClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonElasticMapReduceConfig())
{
}
/// <summary>
/// Constructs AmazonElasticMapReduceClient 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 AmazonElasticMapReduceClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonElasticMapReduceConfig() {RegionEndpoint=region})
{
}
/// <summary>
/// Constructs AmazonElasticMapReduceClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonElasticMapReduceClient Configuration object.
/// </summary>
/// <param name="awsAccessKeyId">AWS Access Key ID</param>
/// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
/// <param name="clientConfig">The AmazonElasticMapReduceClient Configuration Object</param>
public AmazonElasticMapReduceClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonElasticMapReduceConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
/// <summary>
/// Constructs AmazonElasticMapReduceClient 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 AmazonElasticMapReduceClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonElasticMapReduceConfig())
{
}
/// <summary>
/// Constructs AmazonElasticMapReduceClient 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 AmazonElasticMapReduceClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonElasticMapReduceConfig{RegionEndpoint = region})
{
}
/// <summary>
/// Constructs AmazonElasticMapReduceClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonElasticMapReduceClient 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 AmazonElasticMapReduceClient Configuration Object</param>
public AmazonElasticMapReduceClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonElasticMapReduceConfig 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 AddInstanceFleet
internal virtual AddInstanceFleetResponse AddInstanceFleet(AddInstanceFleetRequest request)
{
var marshaller = AddInstanceFleetRequestMarshaller.Instance;
var unmarshaller = AddInstanceFleetResponseUnmarshaller.Instance;
return Invoke<AddInstanceFleetRequest,AddInstanceFleetResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the AddInstanceFleet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AddInstanceFleet operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceFleet">REST API Reference for AddInstanceFleet Operation</seealso>
public virtual Task<AddInstanceFleetResponse> AddInstanceFleetAsync(AddInstanceFleetRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = AddInstanceFleetRequestMarshaller.Instance;
var unmarshaller = AddInstanceFleetResponseUnmarshaller.Instance;
return InvokeAsync<AddInstanceFleetRequest,AddInstanceFleetResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region AddInstanceGroups
internal virtual AddInstanceGroupsResponse AddInstanceGroups(AddInstanceGroupsRequest request)
{
var marshaller = AddInstanceGroupsRequestMarshaller.Instance;
var unmarshaller = AddInstanceGroupsResponseUnmarshaller.Instance;
return Invoke<AddInstanceGroupsRequest,AddInstanceGroupsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the AddInstanceGroups operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AddInstanceGroups operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceGroups">REST API Reference for AddInstanceGroups Operation</seealso>
public virtual Task<AddInstanceGroupsResponse> AddInstanceGroupsAsync(AddInstanceGroupsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = AddInstanceGroupsRequestMarshaller.Instance;
var unmarshaller = AddInstanceGroupsResponseUnmarshaller.Instance;
return InvokeAsync<AddInstanceGroupsRequest,AddInstanceGroupsResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region AddJobFlowSteps
internal virtual AddJobFlowStepsResponse AddJobFlowSteps(AddJobFlowStepsRequest request)
{
var marshaller = AddJobFlowStepsRequestMarshaller.Instance;
var unmarshaller = AddJobFlowStepsResponseUnmarshaller.Instance;
return Invoke<AddJobFlowStepsRequest,AddJobFlowStepsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the AddJobFlowSteps operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AddJobFlowSteps operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddJobFlowSteps">REST API Reference for AddJobFlowSteps Operation</seealso>
public virtual Task<AddJobFlowStepsResponse> AddJobFlowStepsAsync(AddJobFlowStepsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = AddJobFlowStepsRequestMarshaller.Instance;
var unmarshaller = AddJobFlowStepsResponseUnmarshaller.Instance;
return InvokeAsync<AddJobFlowStepsRequest,AddJobFlowStepsResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region AddTags
internal virtual AddTagsResponse AddTags(AddTagsRequest request)
{
var marshaller = AddTagsRequestMarshaller.Instance;
var unmarshaller = AddTagsResponseUnmarshaller.Instance;
return Invoke<AddTagsRequest,AddTagsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the AddTags operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AddTags operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddTags">REST API Reference for AddTags Operation</seealso>
public virtual Task<AddTagsResponse> AddTagsAsync(AddTagsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = AddTagsRequestMarshaller.Instance;
var unmarshaller = AddTagsResponseUnmarshaller.Instance;
return InvokeAsync<AddTagsRequest,AddTagsResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region CancelSteps
internal virtual CancelStepsResponse CancelSteps(CancelStepsRequest request)
{
var marshaller = CancelStepsRequestMarshaller.Instance;
var unmarshaller = CancelStepsResponseUnmarshaller.Instance;
return Invoke<CancelStepsRequest,CancelStepsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CancelSteps operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CancelSteps operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CancelSteps">REST API Reference for CancelSteps Operation</seealso>
public virtual Task<CancelStepsResponse> CancelStepsAsync(CancelStepsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = CancelStepsRequestMarshaller.Instance;
var unmarshaller = CancelStepsResponseUnmarshaller.Instance;
return InvokeAsync<CancelStepsRequest,CancelStepsResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region CreateSecurityConfiguration
internal virtual CreateSecurityConfigurationResponse CreateSecurityConfiguration(CreateSecurityConfigurationRequest request)
{
var marshaller = CreateSecurityConfigurationRequestMarshaller.Instance;
var unmarshaller = CreateSecurityConfigurationResponseUnmarshaller.Instance;
return Invoke<CreateSecurityConfigurationRequest,CreateSecurityConfigurationResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateSecurityConfiguration operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateSecurityConfiguration operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CreateSecurityConfiguration">REST API Reference for CreateSecurityConfiguration Operation</seealso>
public virtual Task<CreateSecurityConfigurationResponse> CreateSecurityConfigurationAsync(CreateSecurityConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = CreateSecurityConfigurationRequestMarshaller.Instance;
var unmarshaller = CreateSecurityConfigurationResponseUnmarshaller.Instance;
return InvokeAsync<CreateSecurityConfigurationRequest,CreateSecurityConfigurationResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region DeleteSecurityConfiguration
internal virtual DeleteSecurityConfigurationResponse DeleteSecurityConfiguration(DeleteSecurityConfigurationRequest request)
{
var marshaller = DeleteSecurityConfigurationRequestMarshaller.Instance;
var unmarshaller = DeleteSecurityConfigurationResponseUnmarshaller.Instance;
return Invoke<DeleteSecurityConfigurationRequest,DeleteSecurityConfigurationResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteSecurityConfiguration operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteSecurityConfiguration operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DeleteSecurityConfiguration">REST API Reference for DeleteSecurityConfiguration Operation</seealso>
public virtual Task<DeleteSecurityConfigurationResponse> DeleteSecurityConfigurationAsync(DeleteSecurityConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = DeleteSecurityConfigurationRequestMarshaller.Instance;
var unmarshaller = DeleteSecurityConfigurationResponseUnmarshaller.Instance;
return InvokeAsync<DeleteSecurityConfigurationRequest,DeleteSecurityConfigurationResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region DescribeCluster
internal virtual DescribeClusterResponse DescribeCluster()
{
return DescribeCluster(new DescribeClusterRequest());
}
internal virtual DescribeClusterResponse DescribeCluster(DescribeClusterRequest request)
{
var marshaller = DescribeClusterRequestMarshaller.Instance;
var unmarshaller = DescribeClusterResponseUnmarshaller.Instance;
return Invoke<DescribeClusterRequest,DescribeClusterResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Provides cluster-level details including status, hardware and software configuration,
/// VPC settings, and so on.
/// </summary>
/// <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 DescribeCluster service method, as returned by ElasticMapReduce.</returns>
/// <exception cref="Amazon.ElasticMapReduce.Model.InternalServerException">
/// This exception occurs when there is an internal failure in the EMR service.
/// </exception>
/// <exception cref="Amazon.ElasticMapReduce.Model.InvalidRequestException">
/// This exception occurs when there is something wrong with user input.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeCluster">REST API Reference for DescribeCluster Operation</seealso>
public virtual Task<DescribeClusterResponse> DescribeClusterAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
return DescribeClusterAsync(new DescribeClusterRequest(), cancellationToken);
}
/// <summary>
/// Initiates the asynchronous execution of the DescribeCluster operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeCluster operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeCluster">REST API Reference for DescribeCluster Operation</seealso>
public virtual Task<DescribeClusterResponse> DescribeClusterAsync(DescribeClusterRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = DescribeClusterRequestMarshaller.Instance;
var unmarshaller = DescribeClusterResponseUnmarshaller.Instance;
return InvokeAsync<DescribeClusterRequest,DescribeClusterResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region DescribeJobFlows
[Obsolete("This API is deprecated and will eventually be removed. We recommend that you use ListClusters, DescribeCluster, ListSteps, ListInstanceGroups and ListBootstrapActions instead.")]
internal virtual DescribeJobFlowsResponse DescribeJobFlows()
{
return DescribeJobFlows(new DescribeJobFlowsRequest());
}
[Obsolete("This API is deprecated and will eventually be removed. We recommend that you use ListClusters, DescribeCluster, ListSteps, ListInstanceGroups and ListBootstrapActions instead.")]
internal virtual DescribeJobFlowsResponse DescribeJobFlows(DescribeJobFlowsRequest request)
{
var marshaller = DescribeJobFlowsRequestMarshaller.Instance;
var unmarshaller = DescribeJobFlowsResponseUnmarshaller.Instance;
return Invoke<DescribeJobFlowsRequest,DescribeJobFlowsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// This API is deprecated and will eventually be removed. We recommend you use <a>ListClusters</a>,
/// <a>DescribeCluster</a>, <a>ListSteps</a>, <a>ListInstanceGroups</a> and <a>ListBootstrapActions</a>
/// instead.
///
///
/// <para>
/// DescribeJobFlows returns a list of job flows that match all of the supplied parameters.
/// The parameters can include a list of job flow IDs, job flow states, and restrictions
/// on job flow creation date and time.
/// </para>
///
/// <para>
/// Regardless of supplied parameters, only job flows created within the last two months
/// are returned.
/// </para>
///
/// <para>
/// If no parameters are supplied, then job flows matching either of the following criteria
/// are returned:
/// </para>
/// <ul> <li>
/// <para>
/// Job flows created and completed in the last two weeks
/// </para>
/// </li> <li>
/// <para>
/// Job flows created within the last two months that are in one of the following states:
/// <code>RUNNING</code>, <code>WAITING</code>, <code>SHUTTING_DOWN</code>, <code>STARTING</code>
///
/// </para>
/// </li> </ul>
/// <para>
/// Amazon EMR can return a maximum of 512 job flow descriptions.
/// </para>
/// </summary>
/// <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 DescribeJobFlows service method, as returned by ElasticMapReduce.</returns>
/// <exception cref="Amazon.ElasticMapReduce.Model.InternalServerErrorException">
/// Indicates that an error occurred while processing the request and that the request
/// was not completed.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeJobFlows">REST API Reference for DescribeJobFlows Operation</seealso>
[Obsolete("This API is deprecated and will eventually be removed. We recommend that you use ListClusters, DescribeCluster, ListSteps, ListInstanceGroups and ListBootstrapActions instead.")]
public virtual Task<DescribeJobFlowsResponse> DescribeJobFlowsAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
return DescribeJobFlowsAsync(new DescribeJobFlowsRequest(), cancellationToken);
}
/// <summary>
/// Initiates the asynchronous execution of the DescribeJobFlows operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeJobFlows operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeJobFlows">REST API Reference for DescribeJobFlows Operation</seealso>
[Obsolete("This API is deprecated and will eventually be removed. We recommend that you use ListClusters, DescribeCluster, ListSteps, ListInstanceGroups and ListBootstrapActions instead.")]
public virtual Task<DescribeJobFlowsResponse> DescribeJobFlowsAsync(DescribeJobFlowsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = DescribeJobFlowsRequestMarshaller.Instance;
var unmarshaller = DescribeJobFlowsResponseUnmarshaller.Instance;
return InvokeAsync<DescribeJobFlowsRequest,DescribeJobFlowsResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region DescribeSecurityConfiguration
internal virtual DescribeSecurityConfigurationResponse DescribeSecurityConfiguration(DescribeSecurityConfigurationRequest request)
{
var marshaller = DescribeSecurityConfigurationRequestMarshaller.Instance;
var unmarshaller = DescribeSecurityConfigurationResponseUnmarshaller.Instance;
return Invoke<DescribeSecurityConfigurationRequest,DescribeSecurityConfigurationResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the DescribeSecurityConfiguration operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeSecurityConfiguration operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeSecurityConfiguration">REST API Reference for DescribeSecurityConfiguration Operation</seealso>
public virtual Task<DescribeSecurityConfigurationResponse> DescribeSecurityConfigurationAsync(DescribeSecurityConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = DescribeSecurityConfigurationRequestMarshaller.Instance;
var unmarshaller = DescribeSecurityConfigurationResponseUnmarshaller.Instance;
return InvokeAsync<DescribeSecurityConfigurationRequest,DescribeSecurityConfigurationResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region DescribeStep
internal virtual DescribeStepResponse DescribeStep()
{
return DescribeStep(new DescribeStepRequest());
}
internal virtual DescribeStepResponse DescribeStep(DescribeStepRequest request)
{
var marshaller = DescribeStepRequestMarshaller.Instance;
var unmarshaller = DescribeStepResponseUnmarshaller.Instance;
return Invoke<DescribeStepRequest,DescribeStepResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Provides more detail about the cluster step.
/// </summary>
/// <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 DescribeStep service method, as returned by ElasticMapReduce.</returns>
/// <exception cref="Amazon.ElasticMapReduce.Model.InternalServerException">
/// This exception occurs when there is an internal failure in the EMR service.
/// </exception>
/// <exception cref="Amazon.ElasticMapReduce.Model.InvalidRequestException">
/// This exception occurs when there is something wrong with user input.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeStep">REST API Reference for DescribeStep Operation</seealso>
public virtual Task<DescribeStepResponse> DescribeStepAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
return DescribeStepAsync(new DescribeStepRequest(), cancellationToken);
}
/// <summary>
/// Initiates the asynchronous execution of the DescribeStep operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeStep operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeStep">REST API Reference for DescribeStep Operation</seealso>
public virtual Task<DescribeStepResponse> DescribeStepAsync(DescribeStepRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = DescribeStepRequestMarshaller.Instance;
var unmarshaller = DescribeStepResponseUnmarshaller.Instance;
return InvokeAsync<DescribeStepRequest,DescribeStepResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region ListBootstrapActions
internal virtual ListBootstrapActionsResponse ListBootstrapActions()
{
return ListBootstrapActions(new ListBootstrapActionsRequest());
}
internal virtual ListBootstrapActionsResponse ListBootstrapActions(ListBootstrapActionsRequest request)
{
var marshaller = ListBootstrapActionsRequestMarshaller.Instance;
var unmarshaller = ListBootstrapActionsResponseUnmarshaller.Instance;
return Invoke<ListBootstrapActionsRequest,ListBootstrapActionsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Provides information about the bootstrap actions associated with a cluster.
/// </summary>
/// <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 ListBootstrapActions service method, as returned by ElasticMapReduce.</returns>
/// <exception cref="Amazon.ElasticMapReduce.Model.InternalServerException">
/// This exception occurs when there is an internal failure in the EMR service.
/// </exception>
/// <exception cref="Amazon.ElasticMapReduce.Model.InvalidRequestException">
/// This exception occurs when there is something wrong with user input.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListBootstrapActions">REST API Reference for ListBootstrapActions Operation</seealso>
public virtual Task<ListBootstrapActionsResponse> ListBootstrapActionsAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
return ListBootstrapActionsAsync(new ListBootstrapActionsRequest(), cancellationToken);
}
/// <summary>
/// Initiates the asynchronous execution of the ListBootstrapActions operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListBootstrapActions operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListBootstrapActions">REST API Reference for ListBootstrapActions Operation</seealso>
public virtual Task<ListBootstrapActionsResponse> ListBootstrapActionsAsync(ListBootstrapActionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = ListBootstrapActionsRequestMarshaller.Instance;
var unmarshaller = ListBootstrapActionsResponseUnmarshaller.Instance;
return InvokeAsync<ListBootstrapActionsRequest,ListBootstrapActionsResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region ListClusters
internal virtual ListClustersResponse ListClusters()
{
return ListClusters(new ListClustersRequest());
}
internal virtual ListClustersResponse ListClusters(ListClustersRequest request)
{
var marshaller = ListClustersRequestMarshaller.Instance;
var unmarshaller = ListClustersResponseUnmarshaller.Instance;
return Invoke<ListClustersRequest,ListClustersResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Provides the status of all clusters visible to this AWS account. Allows you to filter
/// the list of clusters based on certain criteria; for example, filtering by cluster
/// creation date and time or by status. This call returns a maximum of 50 clusters per
/// call, but returns a marker to track the paging of the cluster list across multiple
/// ListClusters calls.
/// </summary>
/// <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 ListClusters service method, as returned by ElasticMapReduce.</returns>
/// <exception cref="Amazon.ElasticMapReduce.Model.InternalServerException">
/// This exception occurs when there is an internal failure in the EMR service.
/// </exception>
/// <exception cref="Amazon.ElasticMapReduce.Model.InvalidRequestException">
/// This exception occurs when there is something wrong with user input.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListClusters">REST API Reference for ListClusters Operation</seealso>
public virtual Task<ListClustersResponse> ListClustersAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
return ListClustersAsync(new ListClustersRequest(), cancellationToken);
}
/// <summary>
/// Initiates the asynchronous execution of the ListClusters operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListClusters operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListClusters">REST API Reference for ListClusters Operation</seealso>
public virtual Task<ListClustersResponse> ListClustersAsync(ListClustersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = ListClustersRequestMarshaller.Instance;
var unmarshaller = ListClustersResponseUnmarshaller.Instance;
return InvokeAsync<ListClustersRequest,ListClustersResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region ListInstanceFleets
internal virtual ListInstanceFleetsResponse ListInstanceFleets(ListInstanceFleetsRequest request)
{
var marshaller = ListInstanceFleetsRequestMarshaller.Instance;
var unmarshaller = ListInstanceFleetsResponseUnmarshaller.Instance;
return Invoke<ListInstanceFleetsRequest,ListInstanceFleetsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the ListInstanceFleets operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListInstanceFleets operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceFleets">REST API Reference for ListInstanceFleets Operation</seealso>
public virtual Task<ListInstanceFleetsResponse> ListInstanceFleetsAsync(ListInstanceFleetsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = ListInstanceFleetsRequestMarshaller.Instance;
var unmarshaller = ListInstanceFleetsResponseUnmarshaller.Instance;
return InvokeAsync<ListInstanceFleetsRequest,ListInstanceFleetsResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region ListInstanceGroups
internal virtual ListInstanceGroupsResponse ListInstanceGroups()
{
return ListInstanceGroups(new ListInstanceGroupsRequest());
}
internal virtual ListInstanceGroupsResponse ListInstanceGroups(ListInstanceGroupsRequest request)
{
var marshaller = ListInstanceGroupsRequestMarshaller.Instance;
var unmarshaller = ListInstanceGroupsResponseUnmarshaller.Instance;
return Invoke<ListInstanceGroupsRequest,ListInstanceGroupsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Provides all available details about the instance groups in a cluster.
/// </summary>
/// <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 ListInstanceGroups service method, as returned by ElasticMapReduce.</returns>
/// <exception cref="Amazon.ElasticMapReduce.Model.InternalServerException">
/// This exception occurs when there is an internal failure in the EMR service.
/// </exception>
/// <exception cref="Amazon.ElasticMapReduce.Model.InvalidRequestException">
/// This exception occurs when there is something wrong with user input.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceGroups">REST API Reference for ListInstanceGroups Operation</seealso>
public virtual Task<ListInstanceGroupsResponse> ListInstanceGroupsAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
return ListInstanceGroupsAsync(new ListInstanceGroupsRequest(), cancellationToken);
}
/// <summary>
/// Initiates the asynchronous execution of the ListInstanceGroups operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListInstanceGroups operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceGroups">REST API Reference for ListInstanceGroups Operation</seealso>
public virtual Task<ListInstanceGroupsResponse> ListInstanceGroupsAsync(ListInstanceGroupsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = ListInstanceGroupsRequestMarshaller.Instance;
var unmarshaller = ListInstanceGroupsResponseUnmarshaller.Instance;
return InvokeAsync<ListInstanceGroupsRequest,ListInstanceGroupsResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region ListInstances
internal virtual ListInstancesResponse ListInstances()
{
return ListInstances(new ListInstancesRequest());
}
internal virtual ListInstancesResponse ListInstances(ListInstancesRequest request)
{
var marshaller = ListInstancesRequestMarshaller.Instance;
var unmarshaller = ListInstancesResponseUnmarshaller.Instance;
return Invoke<ListInstancesRequest,ListInstancesResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Provides information for all active EC2 instances and EC2 instances terminated in
/// the last 30 days, up to a maximum of 2,000. EC2 instances in any of the following
/// states are considered active: AWAITING_FULFILLMENT, PROVISIONING, BOOTSTRAPPING, RUNNING.
/// </summary>
/// <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 ListInstances service method, as returned by ElasticMapReduce.</returns>
/// <exception cref="Amazon.ElasticMapReduce.Model.InternalServerException">
/// This exception occurs when there is an internal failure in the EMR service.
/// </exception>
/// <exception cref="Amazon.ElasticMapReduce.Model.InvalidRequestException">
/// This exception occurs when there is something wrong with user input.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstances">REST API Reference for ListInstances Operation</seealso>
public virtual Task<ListInstancesResponse> ListInstancesAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
return ListInstancesAsync(new ListInstancesRequest(), cancellationToken);
}
/// <summary>
/// Initiates the asynchronous execution of the ListInstances operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListInstances operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstances">REST API Reference for ListInstances Operation</seealso>
public virtual Task<ListInstancesResponse> ListInstancesAsync(ListInstancesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = ListInstancesRequestMarshaller.Instance;
var unmarshaller = ListInstancesResponseUnmarshaller.Instance;
return InvokeAsync<ListInstancesRequest,ListInstancesResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region ListSecurityConfigurations
internal virtual ListSecurityConfigurationsResponse ListSecurityConfigurations(ListSecurityConfigurationsRequest request)
{
var marshaller = ListSecurityConfigurationsRequestMarshaller.Instance;
var unmarshaller = ListSecurityConfigurationsResponseUnmarshaller.Instance;
return Invoke<ListSecurityConfigurationsRequest,ListSecurityConfigurationsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the ListSecurityConfigurations operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListSecurityConfigurations operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListSecurityConfigurations">REST API Reference for ListSecurityConfigurations Operation</seealso>
public virtual Task<ListSecurityConfigurationsResponse> ListSecurityConfigurationsAsync(ListSecurityConfigurationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = ListSecurityConfigurationsRequestMarshaller.Instance;
var unmarshaller = ListSecurityConfigurationsResponseUnmarshaller.Instance;
return InvokeAsync<ListSecurityConfigurationsRequest,ListSecurityConfigurationsResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region ListSteps
internal virtual ListStepsResponse ListSteps()
{
return ListSteps(new ListStepsRequest());
}
internal virtual ListStepsResponse ListSteps(ListStepsRequest request)
{
var marshaller = ListStepsRequestMarshaller.Instance;
var unmarshaller = ListStepsResponseUnmarshaller.Instance;
return Invoke<ListStepsRequest,ListStepsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Provides a list of steps for the cluster in reverse order unless you specify stepIds
/// with the request.
/// </summary>
/// <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 ListSteps service method, as returned by ElasticMapReduce.</returns>
/// <exception cref="Amazon.ElasticMapReduce.Model.InternalServerException">
/// This exception occurs when there is an internal failure in the EMR service.
/// </exception>
/// <exception cref="Amazon.ElasticMapReduce.Model.InvalidRequestException">
/// This exception occurs when there is something wrong with user input.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListSteps">REST API Reference for ListSteps Operation</seealso>
public virtual Task<ListStepsResponse> ListStepsAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
return ListStepsAsync(new ListStepsRequest(), cancellationToken);
}
/// <summary>
/// Initiates the asynchronous execution of the ListSteps operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListSteps operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListSteps">REST API Reference for ListSteps Operation</seealso>
public virtual Task<ListStepsResponse> ListStepsAsync(ListStepsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = ListStepsRequestMarshaller.Instance;
var unmarshaller = ListStepsResponseUnmarshaller.Instance;
return InvokeAsync<ListStepsRequest,ListStepsResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region ModifyInstanceFleet
internal virtual ModifyInstanceFleetResponse ModifyInstanceFleet(ModifyInstanceFleetRequest request)
{
var marshaller = ModifyInstanceFleetRequestMarshaller.Instance;
var unmarshaller = ModifyInstanceFleetResponseUnmarshaller.Instance;
return Invoke<ModifyInstanceFleetRequest,ModifyInstanceFleetResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the ModifyInstanceFleet operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ModifyInstanceFleet operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyInstanceFleet">REST API Reference for ModifyInstanceFleet Operation</seealso>
public virtual Task<ModifyInstanceFleetResponse> ModifyInstanceFleetAsync(ModifyInstanceFleetRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = ModifyInstanceFleetRequestMarshaller.Instance;
var unmarshaller = ModifyInstanceFleetResponseUnmarshaller.Instance;
return InvokeAsync<ModifyInstanceFleetRequest,ModifyInstanceFleetResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region ModifyInstanceGroups
internal virtual ModifyInstanceGroupsResponse ModifyInstanceGroups(ModifyInstanceGroupsRequest request)
{
var marshaller = ModifyInstanceGroupsRequestMarshaller.Instance;
var unmarshaller = ModifyInstanceGroupsResponseUnmarshaller.Instance;
return Invoke<ModifyInstanceGroupsRequest,ModifyInstanceGroupsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the ModifyInstanceGroups operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ModifyInstanceGroups operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyInstanceGroups">REST API Reference for ModifyInstanceGroups Operation</seealso>
public virtual Task<ModifyInstanceGroupsResponse> ModifyInstanceGroupsAsync(ModifyInstanceGroupsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = ModifyInstanceGroupsRequestMarshaller.Instance;
var unmarshaller = ModifyInstanceGroupsResponseUnmarshaller.Instance;
return InvokeAsync<ModifyInstanceGroupsRequest,ModifyInstanceGroupsResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region PutAutoScalingPolicy
internal virtual PutAutoScalingPolicyResponse PutAutoScalingPolicy(PutAutoScalingPolicyRequest request)
{
var marshaller = PutAutoScalingPolicyRequestMarshaller.Instance;
var unmarshaller = PutAutoScalingPolicyResponseUnmarshaller.Instance;
return Invoke<PutAutoScalingPolicyRequest,PutAutoScalingPolicyResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the PutAutoScalingPolicy operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the PutAutoScalingPolicy operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/PutAutoScalingPolicy">REST API Reference for PutAutoScalingPolicy Operation</seealso>
public virtual Task<PutAutoScalingPolicyResponse> PutAutoScalingPolicyAsync(PutAutoScalingPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = PutAutoScalingPolicyRequestMarshaller.Instance;
var unmarshaller = PutAutoScalingPolicyResponseUnmarshaller.Instance;
return InvokeAsync<PutAutoScalingPolicyRequest,PutAutoScalingPolicyResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region RemoveAutoScalingPolicy
internal virtual RemoveAutoScalingPolicyResponse RemoveAutoScalingPolicy(RemoveAutoScalingPolicyRequest request)
{
var marshaller = RemoveAutoScalingPolicyRequestMarshaller.Instance;
var unmarshaller = RemoveAutoScalingPolicyResponseUnmarshaller.Instance;
return Invoke<RemoveAutoScalingPolicyRequest,RemoveAutoScalingPolicyResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the RemoveAutoScalingPolicy operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the RemoveAutoScalingPolicy operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RemoveAutoScalingPolicy">REST API Reference for RemoveAutoScalingPolicy Operation</seealso>
public virtual Task<RemoveAutoScalingPolicyResponse> RemoveAutoScalingPolicyAsync(RemoveAutoScalingPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = RemoveAutoScalingPolicyRequestMarshaller.Instance;
var unmarshaller = RemoveAutoScalingPolicyResponseUnmarshaller.Instance;
return InvokeAsync<RemoveAutoScalingPolicyRequest,RemoveAutoScalingPolicyResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region RemoveTags
internal virtual RemoveTagsResponse RemoveTags(RemoveTagsRequest request)
{
var marshaller = RemoveTagsRequestMarshaller.Instance;
var unmarshaller = RemoveTagsResponseUnmarshaller.Instance;
return Invoke<RemoveTagsRequest,RemoveTagsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the RemoveTags operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the RemoveTags operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RemoveTags">REST API Reference for RemoveTags Operation</seealso>
public virtual Task<RemoveTagsResponse> RemoveTagsAsync(RemoveTagsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = RemoveTagsRequestMarshaller.Instance;
var unmarshaller = RemoveTagsResponseUnmarshaller.Instance;
return InvokeAsync<RemoveTagsRequest,RemoveTagsResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region RunJobFlow
internal virtual RunJobFlowResponse RunJobFlow(RunJobFlowRequest request)
{
var marshaller = RunJobFlowRequestMarshaller.Instance;
var unmarshaller = RunJobFlowResponseUnmarshaller.Instance;
return Invoke<RunJobFlowRequest,RunJobFlowResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the RunJobFlow operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the RunJobFlow operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RunJobFlow">REST API Reference for RunJobFlow Operation</seealso>
public virtual Task<RunJobFlowResponse> RunJobFlowAsync(RunJobFlowRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = RunJobFlowRequestMarshaller.Instance;
var unmarshaller = RunJobFlowResponseUnmarshaller.Instance;
return InvokeAsync<RunJobFlowRequest,RunJobFlowResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region SetTerminationProtection
internal virtual SetTerminationProtectionResponse SetTerminationProtection(SetTerminationProtectionRequest request)
{
var marshaller = SetTerminationProtectionRequestMarshaller.Instance;
var unmarshaller = SetTerminationProtectionResponseUnmarshaller.Instance;
return Invoke<SetTerminationProtectionRequest,SetTerminationProtectionResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the SetTerminationProtection operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the SetTerminationProtection operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SetTerminationProtection">REST API Reference for SetTerminationProtection Operation</seealso>
public virtual Task<SetTerminationProtectionResponse> SetTerminationProtectionAsync(SetTerminationProtectionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = SetTerminationProtectionRequestMarshaller.Instance;
var unmarshaller = SetTerminationProtectionResponseUnmarshaller.Instance;
return InvokeAsync<SetTerminationProtectionRequest,SetTerminationProtectionResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region SetVisibleToAllUsers
internal virtual SetVisibleToAllUsersResponse SetVisibleToAllUsers(SetVisibleToAllUsersRequest request)
{
var marshaller = SetVisibleToAllUsersRequestMarshaller.Instance;
var unmarshaller = SetVisibleToAllUsersResponseUnmarshaller.Instance;
return Invoke<SetVisibleToAllUsersRequest,SetVisibleToAllUsersResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the SetVisibleToAllUsers operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the SetVisibleToAllUsers operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/SetVisibleToAllUsers">REST API Reference for SetVisibleToAllUsers Operation</seealso>
public virtual Task<SetVisibleToAllUsersResponse> SetVisibleToAllUsersAsync(SetVisibleToAllUsersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = SetVisibleToAllUsersRequestMarshaller.Instance;
var unmarshaller = SetVisibleToAllUsersResponseUnmarshaller.Instance;
return InvokeAsync<SetVisibleToAllUsersRequest,SetVisibleToAllUsersResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
#region TerminateJobFlows
internal virtual TerminateJobFlowsResponse TerminateJobFlows(TerminateJobFlowsRequest request)
{
var marshaller = TerminateJobFlowsRequestMarshaller.Instance;
var unmarshaller = TerminateJobFlowsResponseUnmarshaller.Instance;
return Invoke<TerminateJobFlowsRequest,TerminateJobFlowsResponse>(request, marshaller, unmarshaller);
}
/// <summary>
/// Initiates the asynchronous execution of the TerminateJobFlows operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the TerminateJobFlows operation.</param>
/// <param name="cancellationToken">
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
/// </param>
/// <returns>The task object representing the asynchronous operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/TerminateJobFlows">REST API Reference for TerminateJobFlows Operation</seealso>
public virtual Task<TerminateJobFlowsResponse> TerminateJobFlowsAsync(TerminateJobFlowsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var marshaller = TerminateJobFlowsRequestMarshaller.Instance;
var unmarshaller = TerminateJobFlowsResponseUnmarshaller.Instance;
return InvokeAsync<TerminateJobFlowsRequest,TerminateJobFlowsResponse>(request, marshaller,
unmarshaller, cancellationToken);
}
#endregion
}
} | 51.913717 | 230 | 0.693828 | [
"Apache-2.0"
] | DalavanCloud/aws-sdk-net | sdk/src/Services/ElasticMapReduce/Generated/_mobile/AmazonElasticMapReduceClient.cs | 70,395 | 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 0.13.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
namespace Microsoft.Azure.Management.Network
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
public static partial class ExpressRouteCircuitAuthorizationsOperationsExtensions
{
/// <summary>
/// The delete authorization operation deletes the specified authorization
/// from the specified ExpressRouteCircuit.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='circuitName'>
/// The name of the express route circuit.
/// </param>
/// <param name='authorizationName'>
/// The name of the authorization.
/// </param>
public static void Delete(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName)
{
Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).DeleteAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// The delete authorization operation deletes the specified authorization
/// from the specified ExpressRouteCircuit.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='circuitName'>
/// The name of the express route circuit.
/// </param>
/// <param name='authorizationName'>
/// The name of the authorization.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task DeleteAsync( this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken))
{
await operations.DeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// The delete authorization operation deletes the specified authorization
/// from the specified ExpressRouteCircuit.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='circuitName'>
/// The name of the express route circuit.
/// </param>
/// <param name='authorizationName'>
/// The name of the authorization.
/// </param>
public static void BeginDelete(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName)
{
Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).BeginDeleteAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// The delete authorization operation deletes the specified authorization
/// from the specified ExpressRouteCircuit.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='circuitName'>
/// The name of the express route circuit.
/// </param>
/// <param name='authorizationName'>
/// The name of the authorization.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task BeginDeleteAsync( this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken))
{
await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// The GET authorization operation retrieves the specified authorization from
/// the specified ExpressRouteCircuit.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='circuitName'>
/// The name of the express route circuit.
/// </param>
/// <param name='authorizationName'>
/// The name of the authorization.
/// </param>
public static ExpressRouteCircuitAuthorization Get(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName)
{
return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).GetAsync(resourceGroupName, circuitName, authorizationName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// The GET authorization operation retrieves the specified authorization from
/// the specified ExpressRouteCircuit.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='circuitName'>
/// The name of the express route circuit.
/// </param>
/// <param name='authorizationName'>
/// The name of the authorization.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<ExpressRouteCircuitAuthorization> GetAsync( this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, CancellationToken cancellationToken = default(CancellationToken))
{
AzureOperationResponse<ExpressRouteCircuitAuthorization> result = await operations.GetWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, null, cancellationToken).ConfigureAwait(false);
return result.Body;
}
/// <summary>
/// The Put Authorization operation creates/updates an authorization in
/// thespecified ExpressRouteCircuits
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='circuitName'>
/// The name of the express route circuit.
/// </param>
/// <param name='authorizationName'>
/// The name of the authorization.
/// </param>
/// <param name='authorizationParameters'>
/// Parameters supplied to the create/update ExpressRouteCircuitAuthorization
/// operation
/// </param>
public static ExpressRouteCircuitAuthorization CreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters)
{
return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).CreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// The Put Authorization operation creates/updates an authorization in
/// thespecified ExpressRouteCircuits
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='circuitName'>
/// The name of the express route circuit.
/// </param>
/// <param name='authorizationName'>
/// The name of the authorization.
/// </param>
/// <param name='authorizationParameters'>
/// Parameters supplied to the create/update ExpressRouteCircuitAuthorization
/// operation
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<ExpressRouteCircuitAuthorization> CreateOrUpdateAsync( this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, CancellationToken cancellationToken = default(CancellationToken))
{
AzureOperationResponse<ExpressRouteCircuitAuthorization> result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false);
return result.Body;
}
/// <summary>
/// The Put Authorization operation creates/updates an authorization in
/// thespecified ExpressRouteCircuits
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='circuitName'>
/// The name of the express route circuit.
/// </param>
/// <param name='authorizationName'>
/// The name of the authorization.
/// </param>
/// <param name='authorizationParameters'>
/// Parameters supplied to the create/update ExpressRouteCircuitAuthorization
/// operation
/// </param>
public static ExpressRouteCircuitAuthorization BeginCreateOrUpdate(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters)
{
return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).BeginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// The Put Authorization operation creates/updates an authorization in
/// thespecified ExpressRouteCircuits
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='circuitName'>
/// The name of the express route circuit.
/// </param>
/// <param name='authorizationName'>
/// The name of the authorization.
/// </param>
/// <param name='authorizationParameters'>
/// Parameters supplied to the create/update ExpressRouteCircuitAuthorization
/// operation
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<ExpressRouteCircuitAuthorization> BeginCreateOrUpdateAsync( this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, string authorizationName, ExpressRouteCircuitAuthorization authorizationParameters, CancellationToken cancellationToken = default(CancellationToken))
{
AzureOperationResponse<ExpressRouteCircuitAuthorization> result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters, null, cancellationToken).ConfigureAwait(false);
return result.Body;
}
/// <summary>
/// The List authorization operation retrieves all the authorizations in an
/// ExpressRouteCircuit.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='circuitName'>
/// The name of the curcuit.
/// </param>
public static IPage<ExpressRouteCircuitAuthorization> List(this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName)
{
return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).ListAsync(resourceGroupName, circuitName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// The List authorization operation retrieves all the authorizations in an
/// ExpressRouteCircuit.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='circuitName'>
/// The name of the curcuit.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<ExpressRouteCircuitAuthorization>> ListAsync( this IExpressRouteCircuitAuthorizationsOperations operations, string resourceGroupName, string circuitName, CancellationToken cancellationToken = default(CancellationToken))
{
AzureOperationResponse<IPage<ExpressRouteCircuitAuthorization>> result = await operations.ListWithHttpMessagesAsync(resourceGroupName, circuitName, null, cancellationToken).ConfigureAwait(false);
return result.Body;
}
/// <summary>
/// The List authorization operation retrieves all the authorizations in an
/// ExpressRouteCircuit.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
public static IPage<ExpressRouteCircuitAuthorization> ListNext(this IExpressRouteCircuitAuthorizationsOperations operations, string nextPageLink)
{
return Task.Factory.StartNew(s => ((IExpressRouteCircuitAuthorizationsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// The List authorization operation retrieves all the authorizations in an
/// ExpressRouteCircuit.
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<IPage<ExpressRouteCircuitAuthorization>> ListNextAsync( this IExpressRouteCircuitAuthorizationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
AzureOperationResponse<IPage<ExpressRouteCircuitAuthorization>> result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false);
return result.Body;
}
}
}
| 55.502924 | 355 | 0.608419 | [
"MIT"
] | AzureDataBox/azure-powershell | src/ResourceManager/Network/Stack/Commands.Network/Generated/ExpressRouteCircuitAuthorizationsOperationsExtensions.cs | 18,641 | C# |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Globalization;
using System.Threading;
using Microsoft.Build.Internal;
using Microsoft.Build.Shared;
using BuildParameters = Microsoft.Build.Execution.BuildParameters;
using NodeEngineShutdownReason = Microsoft.Build.Execution.NodeEngineShutdownReason;
namespace Microsoft.Build.BackEnd
{
/// <summary>
/// An implementation of a node provider for in-proc nodes.
/// </summary>
internal class NodeProviderInProc : INodeProvider, INodePacketFactory, IDisposable
{
#region Private Data
/// <summary>
/// The invalid in-proc node id
/// </summary>
private const int InvalidInProcNodeId = 0;
/// <summary>
/// Flag indicating we have disposed.
/// </summary>
private bool _disposed = false;
/// <summary>
/// Value used to ensure multiple in-proc nodes which save the operating environment are not created.
/// </summary>
private static Semaphore InProcNodeOwningOperatingEnvironment;
/// <summary>
/// The component host.
/// </summary>
private IBuildComponentHost _componentHost;
/// <summary>
/// The in-proc node.
/// </summary>
private INode _inProcNode;
/// <summary>
/// The in-proc node endpoint.
/// </summary>
private INodeEndpoint _inProcNodeEndpoint;
/// <summary>
/// The packet factory used to route packets from the node.
/// </summary>
private INodePacketFactory _packetFactory;
/// <summary>
/// The in-proc node thread.
/// </summary>
private Thread _inProcNodeThread;
/// <summary>
/// Event which is raised when the in-proc endpoint is connected.
/// </summary>
private AutoResetEvent _endpointConnectedEvent;
/// <summary>
/// The ID of the in-proc node.
/// </summary>
private int _inProcNodeId = InvalidInProcNodeId;
/// <summary>
/// Check to allow the inproc node to have exclusive ownership of the operating environment
/// </summary>
private bool _exclusiveOperatingEnvironment = false;
#endregion
#region Constructor
/// <summary>
/// Initializes the node provider.
/// </summary>
public NodeProviderInProc()
{
_endpointConnectedEvent = new AutoResetEvent(false);
}
#endregion
/// <summary>
/// Finalizer
/// </summary>
~NodeProviderInProc()
{
Dispose(false /* disposing */);
}
/// <summary>
/// Returns the type of nodes managed by this provider.
/// </summary>
public NodeProviderType ProviderType
{
get { return NodeProviderType.InProc; }
}
/// <summary>
/// Returns the number of nodes available to create on this provider.
/// </summary>
public int AvailableNodes
{
get
{
if (_inProcNodeId != InvalidInProcNodeId)
{
return 0;
}
return 1;
}
}
#region IBuildComponent Members
/// <summary>
/// Sets the build component host.
/// </summary>
/// <param name="host">The component host.</param>
public void InitializeComponent(IBuildComponentHost host)
{
_componentHost = host;
}
/// <summary>
/// Shuts down this component.
/// </summary>
public void ShutdownComponent()
{
_componentHost = null;
_inProcNode = null;
}
#endregion
#region INodeProvider Members
/// <summary>
/// Sends data to the specified node.
/// </summary>
/// <param name="nodeId">The node to which data should be sent.</param>
/// <param name="packet">The data to send.</param>
public void SendData(int nodeId, INodePacket packet)
{
ErrorUtilities.VerifyThrowArgumentOutOfRange(nodeId == _inProcNodeId, "node");
ErrorUtilities.VerifyThrowArgumentNull(packet, nameof(packet));
if (null == _inProcNode)
{
return;
}
_inProcNodeEndpoint.SendData(packet);
}
/// <summary>
/// Causes all connected nodes to be shut down.
/// </summary>
/// <param name="enableReuse">Flag indicating if the nodes should prepare for reuse.</param>
public void ShutdownConnectedNodes(bool enableReuse)
{
if (null != _inProcNode)
{
_inProcNodeEndpoint.SendData(new NodeBuildComplete(enableReuse));
}
}
/// <summary>
/// Causes all nodes to be shut down permanently - for InProc nodes it is the same as ShutdownConnectedNodes
/// with enableReuse = false
/// </summary>
public void ShutdownAllNodes()
{
ShutdownConnectedNodes(false /* no node reuse */);
}
/// <summary>
/// Requests that a node be created on the specified machine.
/// </summary>
/// <param name="nodeId">The id of the node to create.</param>
/// <param name="factory">The factory to use to create packets from this node.</param>
/// <param name="configuration">The configuration for the node.</param>
public bool CreateNode(int nodeId, INodePacketFactory factory, NodeConfiguration configuration)
{
ErrorUtilities.VerifyThrow(nodeId != InvalidInProcNodeId, "Cannot create in-proc node.");
// Attempt to get the operating environment semaphore if requested.
if (_componentHost.BuildParameters.SaveOperatingEnvironment)
{
// We can only create additional in-proc nodes if we have decided not to save the operating environment. This is the global
// DTAR case in Visual Studio, but other clients might enable this as well under certain special circumstances.
if (Environment.GetEnvironmentVariable("MSBUILDINPROCENVCHECK") == "1")
{
_exclusiveOperatingEnvironment = true;
}
if (_exclusiveOperatingEnvironment)
{
if (InProcNodeOwningOperatingEnvironment == null)
{
InProcNodeOwningOperatingEnvironment = new Semaphore(1, 1);
}
if (!InProcNodeOwningOperatingEnvironment.WaitOne(0))
{
// Can't take the operating environment.
return false;
}
}
}
// If it doesn't already exist, create it.
if (_inProcNode == null)
{
if (!InstantiateNode(factory))
{
return false;
}
}
_inProcNodeEndpoint.SendData(configuration);
_inProcNodeId = nodeId;
return true;
}
#endregion
#region INodePacketFactory Members
/// <summary>
/// Registers a packet handler. Not used in the in-proc node.
/// </summary>
public void RegisterPacketHandler(NodePacketType packetType, NodePacketFactoryMethod factory, INodePacketHandler handler)
{
// Not used
ErrorUtilities.ThrowInternalErrorUnreachable();
}
/// <summary>
/// Unregisters a packet handler. Not used in the in-proc node.
/// </summary>
public void UnregisterPacketHandler(NodePacketType packetType)
{
// Not used
ErrorUtilities.ThrowInternalErrorUnreachable();
}
/// <summary>
/// Deserializes and routes a packet. Not used in the in-proc node.
/// </summary>
public void DeserializeAndRoutePacket(int nodeId, NodePacketType packetType, ITranslator translator)
{
// Not used
ErrorUtilities.ThrowInternalErrorUnreachable();
}
/// <summary>
/// Routes a packet.
/// </summary>
/// <param name="nodeId">The id of the node from which the packet is being routed.</param>
/// <param name="packet">The packet to route.</param>
public void RoutePacket(int nodeId, INodePacket packet)
{
INodePacketFactory factory = _packetFactory;
if (_inProcNodeId != InvalidInProcNodeId)
{
// If this was a shutdown packet, we are done with the node. Release all context associated with it. Do this here, rather
// than after we route the packet, because otherwise callbacks to the NodeManager to determine if we have available nodes
// will report that the in-proc node is still in use when it has actually shut down.
int savedInProcNodeId = _inProcNodeId;
if (packet.Type == NodePacketType.NodeShutdown)
{
_inProcNodeId = InvalidInProcNodeId;
// Release the operating environment semaphore if we were holding it.
if ((_componentHost.BuildParameters.SaveOperatingEnvironment) &&
(InProcNodeOwningOperatingEnvironment != null))
{
InProcNodeOwningOperatingEnvironment.Release();
InProcNodeOwningOperatingEnvironment.Dispose();
InProcNodeOwningOperatingEnvironment = null;
}
if (!_componentHost.BuildParameters.EnableNodeReuse)
{
_inProcNode = null;
_inProcNodeEndpoint = null;
_inProcNodeThread = null;
_packetFactory = null;
}
}
// Route the packet back to the NodeManager.
factory.RoutePacket(savedInProcNodeId, packet);
}
}
#endregion
/// <summary>
/// IDisposable implementation
/// </summary>
public void Dispose()
{
Dispose(true /* disposing */);
GC.SuppressFinalize(this);
}
/// <summary>
/// Factory for component creation.
/// </summary>
static internal IBuildComponent CreateComponent(BuildComponentType type)
{
ErrorUtilities.VerifyThrow(type == BuildComponentType.InProcNodeProvider, "Cannot create component of type {0}", type);
return new NodeProviderInProc();
}
#region Private Methods
/// <summary>
/// Creates a new in-proc node.
/// </summary>
private bool InstantiateNode(INodePacketFactory factory)
{
ErrorUtilities.VerifyThrow(null == _inProcNode, "In Proc node already instantiated.");
ErrorUtilities.VerifyThrow(null == _inProcNodeEndpoint, "In Proc node endpoint already instantiated.");
NodeEndpointInProc.EndpointPair endpoints = NodeEndpointInProc.CreateInProcEndpoints(NodeEndpointInProc.EndpointMode.Synchronous, _componentHost);
_inProcNodeEndpoint = endpoints.ManagerEndpoint;
_inProcNodeEndpoint.OnLinkStatusChanged += new LinkStatusChangedDelegate(InProcNodeEndpoint_OnLinkStatusChanged);
_packetFactory = factory;
_inProcNode = new InProcNode(_componentHost, endpoints.NodeEndpoint);
#if FEATURE_THREAD_CULTURE
_inProcNodeThread = new Thread(InProcNodeThreadProc, BuildParameters.ThreadStackSize);
#else
CultureInfo culture = _componentHost.BuildParameters.Culture;
CultureInfo uiCulture = _componentHost.BuildParameters.UICulture;
_inProcNodeThread = new Thread(() =>
{
CultureInfo.CurrentCulture = culture;
CultureInfo.CurrentUICulture = uiCulture;
InProcNodeThreadProc();
});
#endif
_inProcNodeThread.Name = String.Format(CultureInfo.CurrentCulture, "In-proc Node ({0})", _componentHost.Name);
_inProcNodeThread.IsBackground = true;
#if FEATURE_THREAD_CULTURE
_inProcNodeThread.CurrentCulture = _componentHost.BuildParameters.Culture;
_inProcNodeThread.CurrentUICulture = _componentHost.BuildParameters.UICulture;
#endif
_inProcNodeThread.Start();
_inProcNodeEndpoint.Connect(this);
int connectionTimeout = CommunicationsUtilities.NodeConnectionTimeout;
bool connected = _endpointConnectedEvent.WaitOne(connectionTimeout);
ErrorUtilities.VerifyThrow(connected, "In-proc node failed to start up within {0}ms", connectionTimeout);
return true;
}
/// <summary>
/// Thread proc which runs the in-proc node.
/// </summary>
private void InProcNodeThreadProc()
{
Exception e;
NodeEngineShutdownReason reason = _inProcNode.Run(out e);
InProcNodeShutdown(reason, e);
}
/// <summary>
/// Callback invoked when the link status of the endpoint has changed.
/// </summary>
/// <param name="endpoint">The endpoint whose status has changed.</param>
/// <param name="status">The new link status.</param>
private void InProcNodeEndpoint_OnLinkStatusChanged(INodeEndpoint endpoint, LinkStatus status)
{
if (status == LinkStatus.Active)
{
// We don't verify this outside of the 'if' because we don't care about the link going down, which will occur
// after we have cleared the inProcNodeEndpoint due to shutting down the node.
ErrorUtilities.VerifyThrow(endpoint == _inProcNodeEndpoint, "Received link status event for a node other than our peer.");
_endpointConnectedEvent.Set();
}
}
/// <summary>
/// Callback invoked when the endpoint shuts down.
/// </summary>
/// <param name="reason">The reason the endpoint is shutting down.</param>
/// <param name="e">Any exception which was raised that caused the endpoint to shut down.</param>
private void InProcNodeShutdown(NodeEngineShutdownReason reason, Exception e)
{
switch (reason)
{
case NodeEngineShutdownReason.BuildComplete:
case NodeEngineShutdownReason.BuildCompleteReuse:
case NodeEngineShutdownReason.Error:
break;
case NodeEngineShutdownReason.ConnectionFailed:
ErrorUtilities.ThrowInternalError("Unexpected shutdown code {0} received.", reason);
break;
}
}
/// <summary>
/// Dispose implementation.
/// </summary>
private void Dispose(bool disposing)
{
if (!_disposed)
{
if (disposing)
{
if (_endpointConnectedEvent != null)
{
_endpointConnectedEvent.Dispose();
_endpointConnectedEvent = null;
}
}
_disposed = true;
}
}
#endregion
}
}
| 35.923251 | 158 | 0.573709 | [
"MIT"
] | corob-msft/msbuild | src/Build/BackEnd/Components/Communications/NodeProviderInProc.cs | 15,914 | C# |
ο»Ώusing System.Windows.Controls;
namespace Tests.Controls
{
public partial class SimpleUIBuiltWithXaml : UserControl
{
public SimpleUIBuiltWithXaml()
{
InitializeComponent();
}
}
} | 19 | 60 | 0.631579 | [
"MIT"
] | CaliburnFx/Caliburn | src/Tests.Controls/SimpleUIBuiltWithXaml.xaml.cs | 230 | C# |
namespace Poseidon.WebAPI.Server.Areas.HelpPage.ModelDescriptions
{
public class EnumValueDescription
{
public string Documentation { get; set; }
public string Name { get; set; }
public string Value { get; set; }
}
} | 23.090909 | 65 | 0.653543 | [
"MIT"
] | robertzml/Poseidon.WebAPI | Poseidon.WebAPI.Server/Areas/HelpPage/ModelDescriptions/EnumValueDescription.cs | 254 | C# |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Akamai.Properties.Outputs
{
[OutputType]
public sealed class GetPropertyRulesRuleRuleRuleRuleRuleBehaviorResult
{
/// <summary>
/// βΒ (Required) The name of the behavior.
/// </summary>
public readonly string Name;
/// <summary>
/// β (Optional) One or more options for the behavior.
/// </summary>
public readonly ImmutableArray<Outputs.GetPropertyRulesRuleRuleRuleRuleRuleBehaviorOptionResult> Options;
[OutputConstructor]
private GetPropertyRulesRuleRuleRuleRuleRuleBehaviorResult(
string name,
ImmutableArray<Outputs.GetPropertyRulesRuleRuleRuleRuleRuleBehaviorOptionResult> options)
{
Name = name;
Options = options;
}
}
}
| 31.194444 | 113 | 0.674978 | [
"ECL-2.0",
"Apache-2.0"
] | yliu-d/pulumi-akamai | sdk/dotnet/Properties/Outputs/GetPropertyRulesRuleRuleRuleRuleRuleBehaviorResult.cs | 1,128 | C# |
ο»Ώ// -----------------------------------------------------------------
// <copyright file="GameLogOutPacket.cs" company="2Dudes">
// Copyright (c) | Jose L. Nunez de Caceres et al.
// https://linkedin.com/in/nunezdecaceres
//
// All Rights Reserved.
//
// Licensed under the MIT License. See LICENSE in the project root for license information.
// </copyright>
// -----------------------------------------------------------------
namespace Fibula.Communications.Packets.Incoming
{
using Fibula.Communications.Contracts.Abstractions;
using Fibula.Communications.Contracts.Enumerations;
using Fibula.Communications.Packets.Contracts.Abstractions;
/// <summary>
/// Class that represents a logout packet routed to the game server.
/// </summary>
public sealed class GameLogOutPacket : IIncomingPacket, IActionWithoutContentInfo
{
/// <summary>
/// Gets the action to do.
/// </summary>
public IncomingPacketType Action => IncomingPacketType.LogOut;
}
}
| 35.137931 | 91 | 0.610402 | [
"MIT"
] | jlnunez89/fibula-mmo | src/Fibula.Communications.Packets/Incoming/GameLogOutPacket.cs | 1,021 | C# |
ο»Ώusing Kata.December2017;
using NUnit.Framework;
using System;
using System.Linq;
namespace KeithKatas.Tests.December2017
{
[TestFixture]
public class TwoToOneTests
{
private static Random rnd = new Random();
[Test]
public static void TwoToOne_Longest_Test1()
{
Assert.AreEqual("aehrsty", TwoToOne.Longest("aretheyhere", "yestheyarehere"));
Assert.AreEqual("abcdefghilnoprstu", TwoToOne.Longest("loopingisfunbutdangerous", "lessdangerousthancoding"));
Assert.AreEqual("acefghilmnoprstuy", TwoToOne.Longest("inmanylanguages", "theresapairoffunctions"));
Assert.AreEqual("adefghklmnorstu", TwoToOne.Longest("lordsofthefallen", "gamekult"));
Assert.AreEqual("acdeorsw", TwoToOne.Longest("codewars", "codewars"));
Assert.AreEqual("acdefghilmnorstuw", TwoToOne.Longest("agenerationmustconfrontthelooming", "codewarrs"));
}
[Test]
public static void TwoToOne_Longest_RandomTest()
{
Console.WriteLine("200 Random Tests");
for (int i = 0; i < 200; i++)
{
string s1 = DoEx(rnd.Next(1, 10));
string s2 = DoEx(rnd.Next(1, 8));
Assert.AreEqual(LongestSol(s1, s2), TwoToOne.Longest(s1, s2));
}
}
private static string DoEx(int k)
{
String res = "";
int n = -1;
for (int i = 0; i < 15; i++)
{
n = rnd.Next(97 + k, 122);
for (int j = 0; j < rnd.Next(1, 5); j++)
res += (char)n;
}
return res;
}
private static string LongestSol(string s1, string s2)
{
int[] alpha1 = new int[26];
for (int i = 0; i < alpha1.Length; i++) alpha1[i] = 0;
int[] alpha2 = new int[26];
for (int i = 0; i < alpha2.Length; i++) alpha2[i] = 0;
for (int i = 0; i < s1.Length; i++)
{
int c = (int)s1[i];
if (c >= 97 && c <= 122)
alpha1[c - 97]++;
}
for (int i = 0; i < s2.Length; i++)
{
int c = (int)s2[i];
if (c >= 97 && c <= 122)
alpha2[c - 97]++;
}
string res = "";
for (int i = 0; i < 26; i++)
{
if (alpha1[i] != 0)
{
res += (char)(i + 97);
alpha2[i] = 0;
}
}
for (int i = 0; i < 26; i++)
{
if (alpha2[i] != 0)
res += (char)(i + 97);
}
char[] lstr = res.ToCharArray();
Array.Sort(lstr);
res = string.Join("", lstr);
return res;
}
}
}
| 33.034091 | 122 | 0.451324 | [
"MIT"
] | ssfcultra/Katas | KeithKatas.Tests/201712/TwoToOneTests.cs | 2,909 | C# |
ο»Ώusing System.Collections.Generic;
using Essensoft.AspNetCore.Payment.Alipay.Response;
namespace Essensoft.AspNetCore.Payment.Alipay.Request
{
/// <summary>
/// alipay.marketing.tool.fengdie.space.create
/// </summary>
public class AlipayMarketingToolFengdieSpaceCreateRequest : IAlipayRequest<AlipayMarketingToolFengdieSpaceCreateResponse>
{
/// <summary>
/// εε»Ίη©Ίι΄
/// </summary>
public string BizContent { get; set; }
#region IAlipayRequest Members
private bool needEncrypt = false;
private string apiVersion = "1.0";
private string terminalType;
private string terminalInfo;
private string prodCode;
private string notifyUrl;
private string returnUrl;
private AlipayObject bizModel;
public void SetNeedEncrypt(bool needEncrypt)
{
this.needEncrypt = needEncrypt;
}
public bool GetNeedEncrypt()
{
return needEncrypt;
}
public void SetNotifyUrl(string notifyUrl)
{
this.notifyUrl = notifyUrl;
}
public string GetNotifyUrl()
{
return notifyUrl;
}
public void SetReturnUrl(string returnUrl)
{
this.returnUrl = returnUrl;
}
public string GetReturnUrl()
{
return returnUrl;
}
public void SetTerminalType(string terminalType)
{
this.terminalType = terminalType;
}
public string GetTerminalType()
{
return terminalType;
}
public void SetTerminalInfo(string terminalInfo)
{
this.terminalInfo = terminalInfo;
}
public string GetTerminalInfo()
{
return terminalInfo;
}
public void SetProdCode(string prodCode)
{
this.prodCode = prodCode;
}
public string GetProdCode()
{
return prodCode;
}
public string GetApiName()
{
return "alipay.marketing.tool.fengdie.space.create";
}
public void SetApiVersion(string apiVersion)
{
this.apiVersion = apiVersion;
}
public string GetApiVersion()
{
return apiVersion;
}
public IDictionary<string, string> GetParameters()
{
var parameters = new AlipayDictionary
{
{ "biz_content", BizContent }
};
return parameters;
}
public AlipayObject GetBizModel()
{
return bizModel;
}
public void SetBizModel(AlipayObject bizModel)
{
this.bizModel = bizModel;
}
#endregion
}
}
| 22.967742 | 125 | 0.552317 | [
"MIT"
] | Msy1989/payment | src/Essensoft.AspNetCore.Payment.Alipay/Request/AlipayMarketingToolFengdieSpaceCreateRequest.cs | 2,858 | C# |
ο»Ώ//Copyright Β© 2014 Sony Computer Entertainment America LLC. See License.txt.
using System;
using System.Collections.Generic;
using NUnit.Framework;
using Sce.Atf.Adaptation;
using Sce.Atf.Dom;
namespace UnitTests.Atf.Dom
{
[TestFixture]
public class TestValidator : DomTest
{
private DomNodeType m_rootType;
private DomNodeType m_childType;
private AttributeInfo m_stringAttrInfo;
private AttributeInfo m_refAttrInfo;
private ChildInfo m_childInfo;
public TestValidator()
{
// define a tree of validation contexts
m_childType = new DomNodeType("test");
m_stringAttrInfo = GetStringAttribute("string");
m_childType.Define(m_stringAttrInfo);
m_refAttrInfo = GetRefAttribute("ref");
m_childType.Define(m_refAttrInfo);
m_childInfo = new ChildInfo("child", m_childType);
m_childType.Define(m_childInfo);
m_childType.Define(new ExtensionInfo<ValidationContext>());
// define a distinct root type with the validator
m_rootType = new DomNodeType("root");
m_rootType.BaseType = m_childType;
m_rootType.Define(new ExtensionInfo<Validator>());
IEnumerable<AttributeInfo> attributes = m_rootType.Attributes; // freezes the types
}
private DomNode CreateTree()
{
DomNode root = new DomNode(m_rootType);
DomNode child = new DomNode(m_childType);
DomNode grandchild = new DomNode(m_childType);
child.SetChild(m_childInfo, grandchild);
root.SetChild(m_childInfo, child);
return root;
}
[Test]
public void TestOnAttributeSet()
{
DomNode root = CreateTree();
Validator validator = root.As<Validator>();
DomNode grandchild = root.GetChild(m_childInfo).GetChild(m_childInfo);
grandchild.SetAttribute(m_stringAttrInfo, "foo");
Assert.AreSame(validator.Sender, root);
AttributeEventArgs e = (AttributeEventArgs)validator.E;
Assert.NotNull(e);
Assert.AreSame(e.DomNode, grandchild);
}
[Test]
public void TestOnChildInserted()
{
DomNode root = new DomNode(m_rootType);
Validator validator = root.As<Validator>();
DomNode child = new DomNode(m_childType);
root.SetChild(m_childInfo, child);
Assert.AreSame(validator.Sender, root);
ChildEventArgs e = (ChildEventArgs)validator.E;
Assert.NotNull(e);
Assert.AreSame(e.Parent, root);
}
[Test]
public void TestOnChildRemoved()
{
DomNode root = new DomNode(m_rootType);
Validator validator = root.As<Validator>();
DomNode child = new DomNode(m_childType);
root.SetChild(m_childInfo, child);
root.SetChild(m_childInfo, null);
Assert.AreSame(validator.Sender, root);
ChildEventArgs e = (ChildEventArgs)validator.E;
Assert.NotNull(e);
Assert.AreSame(e.Parent, root);
}
[Test]
public void TestBeginning()
{
DomNode root = CreateTree();
Validator validator = root.As<Validator>();
ValidationContext context = root.As<ValidationContext>();
context.RaiseBeginning();
Assert.True(validator.IsValidating);
Assert.AreSame(validator.Sender, context);
Assert.AreSame(validator.E, EventArgs.Empty);
}
[Test]
public void TestEnding()
{
DomNode root = CreateTree();
Validator validator = root.As<Validator>();
ValidationContext context = root.As<ValidationContext>();
context.RaiseBeginning();
Assert.True(validator.IsValidating);
context.RaiseEnding();
Assert.False(validator.IsValidating);
Assert.AreSame(validator.Sender, context);
Assert.AreSame(validator.E, EventArgs.Empty);
}
[Test]
public void TestEnded()
{
DomNode root = CreateTree();
Validator validator = root.As<Validator>();
ValidationContext context = root.As<ValidationContext>();
context.RaiseBeginning();
context.RaiseEnding();
context.RaiseEnded();
Assert.False(validator.IsValidating);
Assert.AreSame(validator.Sender, context);
Assert.AreSame(validator.E, EventArgs.Empty);
}
[Test]
public void TestCancelled()
{
DomNode root = CreateTree();
Validator validator = root.As<Validator>();
ValidationContext context = root.As<ValidationContext>();
context.RaiseBeginning();
context.RaiseCancelled();
Assert.False(validator.IsValidating);
Assert.AreSame(validator.Sender, context);
Assert.AreSame(validator.E, EventArgs.Empty);
}
[Test]
public void TestSubscribeAndUnsubscribe()
{
DomNode root = new DomNode(m_rootType);
Validator validator = root.As<Validator>();
DomNode child = new DomNode(m_childType);
DomNode grandchild = new DomNode(m_childType);
child.SetChild(m_childInfo, grandchild);
root.SetChild(m_childInfo, child);
ValidationContext context = grandchild.As<ValidationContext>();
context.RaiseBeginning();
Assert.True(validator.IsValidating);
Assert.AreSame(validator.Sender, context);
Assert.AreSame(validator.E, EventArgs.Empty);
context.RaiseEnded();
root.SetChild(m_childInfo, null);
context.RaiseBeginning();
Assert.False(validator.IsValidating);
}
}
}
| 36.928571 | 96 | 0.58011 | [
"Apache-2.0"
] | gamebytes/ATF | Test/UnitTests/Sce.Atf/Dom/TestValidator.cs | 6,040 | C# |
ο»Ώusing Ezreal.Moredian.ApiClient.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ezreal.Moredian.ApiClient.ApiParameterModels.Request.Device
{
public class DeviceControlInfoUpdateRequestModel
{
public string DeviceId { get; set; }
public int MultiPerson { get; set; }
public int ControlDoorTime { get; set; }
}
}
| 23.263158 | 69 | 0.733032 | [
"MIT"
] | EzrealJ/Moredian | Ezreal.Moredian.ApiClient/Ezreal.Moredian.ApiClient/ApiParameterModels/Request/Device/DeviceControlInfoUpdateRequestModel.cs | 444 | C# |
ο»Ώusing System.Collections.Generic;
namespace Quanda.Shared.Models
{
public class Tag
{
public Tag()
{
QuestionTags = new HashSet<QuestionTag>();
InverseIdMainTagsNavigation = new HashSet<Tag>();
TagUsers = new HashSet<TagUser>();
}
public int IdTag { get; set; }
public string Name { get; set; }
public int? IdMainTag { get; set; }
public string Description { get; set; }
public virtual ICollection<QuestionTag> QuestionTags { get; set; }
public virtual Tag IdMainTagNavigation { get; set; }
public virtual ICollection<Tag> InverseIdMainTagsNavigation { get; set; }
public virtual ICollection<TagUser> TagUsers { get; set; }
}
}
| 30.72 | 81 | 0.613281 | [
"Apache-2.0"
] | Ventan00/quanda | Shared/Models/Tag.cs | 770 | 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("DataAnalysis.Interface")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("DataAnalysis.Interface")]
[assembly: AssemblyCopyright("Copyright Β© Microsoft 2015")]
[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("6d08832f-7df7-435d-b992-b63a9965b74f")]
// 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.783784 | 84 | 0.750523 | [
"MIT"
] | rentianhua/surfboard | Source/Modules/DataAnalysis/DataAnalysis.Interface/Properties/AssemblyInfo.cs | 1,438 | C# |
// Copyright (c) Bottlenose Labs Inc. (https://github.com/bottlenoselabs). All rights reserved.
// Licensed under the MIT license. See LICENSE file in the Git repository root directory for full license information.
using System.Collections.Immutable;
using System.Text.Json;
using System.Text.Json.Serialization;
using C2CS.Feature.BindgenCSharp.Data;
using C2CS.Feature.BindgenCSharp.Logic;
using C2CS.Feature.ExtractAbstractSyntaxTreeC.Data;
using C2CS.Feature.ExtractAbstractSyntaxTreeC.Data.Serialization;
namespace C2CS.Feature.BindgenCSharp;
public class UseCase : UseCaseHandler<Input, Output>
{
protected override void Execute(Input input, Output output)
{
Validate(input);
var abstractSyntaxTree = LoadCAbstractSyntaxTreeFromFileStorage(input.InputFilePath);
var abstractSyntaxTreeCSharp = MapCAbstractSyntaxTreeToCSharp(
abstractSyntaxTree,
input.TypeAliases,
input.IgnoredTypeNames,
abstractSyntaxTree.Bitness,
Diagnostics);
var codeCSharp = GenerateCSharpCode(
abstractSyntaxTreeCSharp,
input.ClassName,
input.LibraryName,
input.NamespaceName,
input.HeaderCodeRegion,
input.FooterCodeRegion);
WriteCSharpCodeToFileStorage(input.OutputFilePath, codeCSharp);
}
private static void Validate(Input request)
{
if (!File.Exists(request.InputFilePath))
{
throw new UseCaseException($"File does not exist: `{request.InputFilePath}`.");
}
}
[UseCaseStep("Load C abstract syntax tree from file storage.")]
private CAbstractSyntaxTree LoadCAbstractSyntaxTreeFromFileStorage(string inputFilePath)
{
BeginStep();
var fileContents = File.ReadAllText(inputFilePath);
var serializerOptions = new JsonSerializerOptions
{
WriteIndented = true,
Converters =
{
new JsonStringEnumConverter(JsonNamingPolicy.CamelCase)
}
};
var serializerContext = new CJsonSerializerContext(serializerOptions);
var abstractSyntaxTree = JsonSerializer.Deserialize(fileContents, serializerContext.CAbstractSyntaxTree)!;
EndStep();
return abstractSyntaxTree;
}
[UseCaseStep("Map C abstract syntax tree to C#")]
private CSharpAbstractSyntaxTree MapCAbstractSyntaxTreeToCSharp(
CAbstractSyntaxTree abstractSyntaxTree,
ImmutableArray<CSharpTypeAlias> typeAliases,
ImmutableArray<string> ignoredTypeNames,
int bitness,
DiagnosticsSink diagnostics)
{
BeginStep();
var mapperParameters = new CSharpMapperParameters(
typeAliases, ignoredTypeNames, bitness, diagnostics);
var mapper = new CSharpMapper(mapperParameters);
var result = mapper.AbstractSyntaxTree(abstractSyntaxTree);
EndStep();
return result;
}
[UseCaseStep("Generate C# code")]
private string GenerateCSharpCode(
CSharpAbstractSyntaxTree abstractSyntaxTree,
string className,
string libraryName,
string namespaceName,
string headerCodeRegion,
string footerCodeRegion)
{
BeginStep();
var codeGenerator = new CSharpCodeGenerator(
className, libraryName, namespaceName, headerCodeRegion, footerCodeRegion);
var result = codeGenerator.EmitCode(abstractSyntaxTree);
EndStep();
return result;
}
[UseCaseStep("Write C# code to file storage")]
private void WriteCSharpCodeToFileStorage(
string outputFilePath, string codeCSharp)
{
BeginStep();
var outputDirectory = Path.GetDirectoryName(outputFilePath)!;
if (string.IsNullOrEmpty(outputDirectory))
{
outputDirectory = AppContext.BaseDirectory;
outputFilePath = Path.Combine(Environment.CurrentDirectory, outputFilePath);
}
if (!Directory.Exists(outputDirectory))
{
Directory.CreateDirectory(outputDirectory);
}
File.WriteAllText(outputFilePath, codeCSharp);
Console.WriteLine(outputFilePath);
EndStep();
}
}
| 33.809524 | 118 | 0.679108 | [
"MIT"
] | waldnercharles/c2cs | src/cs/production/C2CS.Feature.BindgenCSharp/UseCase.cs | 4,260 | C# |
ο»Ώ// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
namespace Microsoft.Bot.Connector.Authentication
{
public static class TimeSpanExtensions
{
private static readonly Random _random = new Random();
#pragma warning disable CA1801 // Review unused parameters (we can't change this without breaking binary compat)
public static TimeSpan WithJitter(this TimeSpan delay, double multiplier = 0.1)
#pragma warning restore CA1801 // Review unused parameters
{
// Generate an uniform distribution between zero and 10% of the proposed delay and add it as
// random noise. The reason for this is that if there are multiple threads about to retry
// at the same time, it can overload the server again and trigger throttling again.
// By adding a bit of random noise, we distribute requests a across time.
return delay + TimeSpan.FromMilliseconds(_random.NextDouble() * delay.TotalMilliseconds * 0.1);
}
}
}
| 44.25 | 112 | 0.706215 | [
"MIT"
] | Bhaskers-Blu-Org2/botbuilder-dotnet | libraries/Microsoft.Bot.Connector/Authentication/TimeSpanExtensions.cs | 1,064 | C# |
using System;
using System.Collections.Generic;
using System.Text;
namespace AdventOfCode.Solutions.Year2016
{
class Day06 : ASolution
{
string partOne;
string partTwo;
public Day06() : base(06, 2016, "")
{
Dictionary<char, int>[] letterFrequencies = new Dictionary<char, int>[8];
for (int i = 0; i < 8; i++) letterFrequencies[i] = new Dictionary<char, int>();
foreach (string line in Input.SplitByNewline())
{
for (int i = 0; i < 8; i++)
{
letterFrequencies[i][line[i]] = letterFrequencies[i].GetValueOrDefault(line[i], 0) + 1;
}
}
partOne = string.Empty;
for (int i = 0; i < 8; i++)
{
int mostCommenCount = 0;
int leastCommenCount = int.MaxValue;
char mostCommenChar = '\0';
char leastCommenChar ='\0';
foreach (char c in letterFrequencies[i].Keys)
{
if (letterFrequencies[i][c] > mostCommenCount)
{
mostCommenChar = c;
mostCommenCount = letterFrequencies[i][c];
}
if (letterFrequencies[i][c] < leastCommenCount)
{
leastCommenChar = c;
leastCommenCount = letterFrequencies[i][c];
}
}
partOne += mostCommenChar;
partTwo += leastCommenChar;
}
}
protected override string SolvePartOne()
{
return partOne;
}
protected override string SolvePartTwo()
{
return partTwo;
}
}
}
| 27.507463 | 107 | 0.456864 | [
"MIT"
] | DqwertyC/AdventOfCode | AdventOfCode/Solutions/Year2016/Day06-Solution.cs | 1,843 | C# |
ο»Ώ//{[{
using Param_RootNamespace.Views;
using Param_RootNamespace.ViewModels;
//}]}
namespace Param_RootNamespace.Activation
{
internal class SchemeActivationHandler : ActivationHandler<ProtocolActivatedEventArgs>
{
//{[{
public NavigationServiceEx NavigationService => ViewModelLocator.Current.NavigationService;
// By default, this handler expects URIs of the format 'wtsapp:sample?paramName1=paramValue1¶mName2=paramValue2'
protected override async Task HandleInternalAsync(ProtocolActivatedEventArgs args)
{
// Create data from activation Uri in ProtocolActivatedEventArgs
var data = new SchemeActivationData(args.Uri);
if (data.IsValid)
{
NavigationService.Navigate(data.ViewModelName, data.Parameters);
}
await Task.CompletedTask;
}
//}]}
}
}
| 32.964286 | 125 | 0.667389 | [
"MIT"
] | Alfian878787/WindowsTemplateStudio | templates/Uwp/_comp/MVVMLight/Feat.DeepLinking_Blank/Activation/SchemeActivationHandler_postaction.cs | 898 | 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("Contracts")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Contracts")]
[assembly: AssemblyCopyright("Copyright Β© 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("55275247-8d2e-421f-ab35-4ba77449b05a")]
// 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.432432 | 85 | 0.727848 | [
"MIT"
] | Winzarten/SecondMonitor | Foundation/Contracts/Properties/AssemblyInfo.cs | 1,425 | C# |
using System;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using UnityStandardAssets.CrossPlatformInput;
[RequireComponent(typeof (Image))]
public class ForcedReset : MonoBehaviour
{
private void Update()
{
// if we have forced a reset ...
if (CrossPlatformInputManager.GetButtonDown("ResetObject"))
{
//... reload the scene
SceneManager.LoadScene(SceneManager.GetSceneAt(0).name);
}
}
}
| 24.4 | 68 | 0.67623 | [
"MIT"
] | 0xitsHimanshu/Multiplayer-FPS | Assets/Standard Assets/Utility/ForcedReset.cs | 488 | C# |
ο»Ώusing System;
using Xms.Module.Abstractions;
namespace Xms.Security.Resource
{
/// <summary>
/// 樑εζθΏ°
/// </summary>
public class ModuleEntry : IModule
{
public string Name
{
get
{
return "Security.Resource";
}
}
public Action<ModuleDescriptor> Configure()
{
return (o) =>
{
o.Identity = 33;
o.Name = this.Name;
};
}
public void OnStarting()
{
}
}
} | 17.78125 | 51 | 0.42355 | [
"MIT"
] | 861191244/xms | Libraries/Security/Xms.Security.Resource/ModuleEntry.cs | 579 | C# |
ο»Ώusing UnityEngine;
using UnityEngine.SceneManagement;
namespace UI
{
public class Buttons : MonoBehaviour
{
public void Play()
{
SceneManager.LoadScene(1);
}
public void Next()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}
}
}
| 17.35 | 81 | 0.567723 | [
"MIT"
] | Minecraftian14/NoName | Assets/Scripts/UI/Buttons.cs | 349 | 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 Lucene.Net.Index;
using Lucene.Net.Store;
using Lucene.Net.Support;
using Lucene.Net.Util;
using IndexReader = Lucene.Net.Index.IndexReader;
using ToStringUtils = Lucene.Net.Util.ToStringUtils;
using Query = Lucene.Net.Search.Query;
namespace Lucene.Net.Search.Spans
{
/// <summary>Matches the union of its clauses.</summary>
[Serializable]
public class SpanOrQuery : SpanQuery, System.ICloneable
{
private class AnonymousClassSpans : Spans
{
public AnonymousClassSpans(Lucene.Net.Index.IndexReader reader, SpanOrQuery enclosingInstance)
{
InitBlock(reader, enclosingInstance);
}
private void InitBlock(Lucene.Net.Index.IndexReader reader, SpanOrQuery enclosingInstance)
{
this.reader = reader;
this.enclosingInstance = enclosingInstance;
}
private Lucene.Net.Index.IndexReader reader;
private SpanOrQuery enclosingInstance;
public SpanOrQuery Enclosing_Instance
{
get
{
return enclosingInstance;
}
}
private SpanQueue queue = null;
private bool InitSpanQueue(int target, IState state)
{
queue = new SpanQueue(enclosingInstance, Enclosing_Instance.clauses.Count);
System.Collections.Generic.IEnumerator<SpanQuery> i = Enclosing_Instance.clauses.GetEnumerator();
while (i.MoveNext())
{
Spans spans = i.Current.GetSpans(reader, state);
if (((target == - 1) && spans.Next(state)) || ((target != - 1) && spans.SkipTo(target, state)))
{
queue.Add(spans);
}
}
return queue.Size() != 0;
}
public override bool Next(IState state)
{
if (queue == null)
{
return InitSpanQueue(- 1, state);
}
if (queue.Size() == 0)
{
// all done
return false;
}
if (Top().Next(state))
{
// move to next
queue.UpdateTop();
return true;
}
queue.Pop(); // exhausted a clause
return queue.Size() != 0;
}
private Spans Top()
{
return queue.Top();
}
public override bool SkipTo(int target, IState state)
{
if (queue == null)
{
return InitSpanQueue(target, state);
}
bool skipCalled = false;
while (queue.Size() != 0 && Top().Doc() < target)
{
if (Top().SkipTo(target, state))
{
queue.UpdateTop();
}
else
{
queue.Pop();
}
skipCalled = true;
}
if (skipCalled)
{
return queue.Size() != 0;
}
return Next(state);
}
public override int Doc()
{
return Top().Doc();
}
public override int Start()
{
return Top().Start();
}
public override int End()
{
return Top().End();
}
public override ICollection<byte[]> GetPayload(IState state)
{
System.Collections.Generic.ICollection<byte[]> result = null;
Spans theTop = Top();
if (theTop != null && theTop.IsPayloadAvailable())
{
result = theTop.GetPayload(state);
}
return result;
}
public override bool IsPayloadAvailable()
{
Spans top = Top();
return top != null && top.IsPayloadAvailable();
}
public override System.String ToString()
{
return "spans(" + Enclosing_Instance + ")@" + ((queue == null)?"START":(queue.Size() > 0?(Doc() + ":" + Start() + "-" + End()):"END"));
}
}
private EquatableList<SpanQuery> clauses;
private System.String field;
/// <summary>Construct a SpanOrQuery merging the provided clauses. </summary>
public SpanOrQuery(params SpanQuery[] clauses)
{
// copy clauses array into an ArrayList
this.clauses = new EquatableList<SpanQuery>(clauses.Length);
for (int i = 0; i < clauses.Length; i++)
{
SpanQuery clause = clauses[i];
if (i == 0)
{
// check field
field = clause.Field;
}
else if (!clause.Field.Equals(field))
{
throw new System.ArgumentException("Clauses must have same field.");
}
this.clauses.Add(clause);
}
}
/// <summary>Return the clauses whose spans are matched. </summary>
public virtual SpanQuery[] GetClauses()
{
return clauses.ToArray();
}
public override string Field
{
get { return field; }
}
public override void ExtractTerms(System.Collections.Generic.ISet<Term> terms)
{
foreach(SpanQuery clause in clauses)
{
clause.ExtractTerms(terms);
}
}
public override System.Object Clone()
{
int sz = clauses.Count;
SpanQuery[] newClauses = new SpanQuery[sz];
for (int i = 0; i < sz; i++)
{
newClauses[i] = (SpanQuery) clauses[i].Clone();
}
SpanOrQuery soq = new SpanOrQuery(newClauses);
soq.Boost = Boost;
return soq;
}
public override Query Rewrite(IndexReader reader, IState state)
{
SpanOrQuery clone = null;
for (int i = 0; i < clauses.Count; i++)
{
SpanQuery c = clauses[i];
SpanQuery query = (SpanQuery) c.Rewrite(reader, state);
if (query != c)
{
// clause rewrote: must clone
if (clone == null)
clone = (SpanOrQuery) this.Clone();
clone.clauses[i] = query;
}
}
if (clone != null)
{
return clone; // some clauses rewrote
}
else
{
return this; // no clauses rewrote
}
}
public override System.String ToString(System.String field)
{
System.Text.StringBuilder buffer = new System.Text.StringBuilder();
buffer.Append("spanOr([");
System.Collections.Generic.IEnumerator<SpanQuery> i = clauses.GetEnumerator();
int j = 0;
while (i.MoveNext())
{
j++;
SpanQuery clause = i.Current;
buffer.Append(clause.ToString(field));
if (j < clauses.Count)
{
buffer.Append(", ");
}
}
buffer.Append("])");
buffer.Append(ToStringUtils.Boost(Boost));
return buffer.ToString();
}
public override bool Equals(System.Object o)
{
if (this == o)
return true;
if (o == null || GetType() != o.GetType())
return false;
SpanOrQuery that = (SpanOrQuery) o;
if (!clauses.Equals(that.clauses))
return false;
if (!(clauses.Count == 0) && !field.Equals(that.field))
return false;
return Boost == that.Boost;
}
public override int GetHashCode()
{
int h = clauses.GetHashCode();
h ^= ((h << 10) | (Number.URShift(h, 23)));
h ^= System.Convert.ToInt32(Boost);
return h;
}
private class SpanQueue : PriorityQueue<Spans>
{
private void InitBlock(SpanOrQuery enclosingInstance)
{
this.enclosingInstance = enclosingInstance;
}
private SpanOrQuery enclosingInstance;
public SpanOrQuery Enclosing_Instance
{
get
{
return enclosingInstance;
}
}
public SpanQueue(SpanOrQuery enclosingInstance, int size)
{
InitBlock(enclosingInstance);
Initialize(size);
}
public override bool LessThan(Spans spans1, Spans spans2)
{
if (spans1.Doc() == spans2.Doc())
{
if (spans1.Start() == spans2.Start())
{
return spans1.End() < spans2.End();
}
else
{
return spans1.Start() < spans2.Start();
}
}
else
{
return spans1.Doc() < spans2.Doc();
}
}
}
public override Spans GetSpans(IndexReader reader, IState state)
{
if (clauses.Count == 1)
// optimize 1-clause case
return (clauses[0]).GetSpans(reader, state);
return new AnonymousClassSpans(reader, this);
}
}
} | 24.265896 | 139 | 0.614221 | [
"Apache-2.0"
] | grisha-kotler/lucenenet | src/Lucene.Net/Search/Spans/SpanOrQuery.cs | 8,396 | C# |
using System;
using System.IO;
namespace Icarus.Constants
{
public class DirectoryPaths
{
public static string CoverArtPath =>
Directory.GetCurrentDirectory() + "/Images/Stock/CoverArt.png";
}
}
| 19 | 75 | 0.671053 | [
"MIT"
] | amazing-username/Icarus | Constants/DirectoryPaths.cs | 228 | C# |
ο»Ώusing NetControl4BioMed.Data.Interfaces;
using System;
namespace NetControl4BioMed.Data.Models
{
/// <summary>
/// Represents the database model of a one-to-one relationship between a network and a registered user who has access to it.
/// </summary>
public class NetworkUser : INetworkDependent, IUserDependent
{
/// <summary>
/// Gets or sets the date when the relationship was created.
/// </summary>
public DateTime DateTimeCreated { get; set; }
/// <summary>
/// Gets or sets the network ID of the relationship.
/// </summary>
public string NetworkId { get; set; }
/// <summary>
/// Gets or sets the network of the relationship.
/// </summary>
public Network Network { get; set; }
/// <summary>
/// Gets or sets the user ID of the relationship.
/// </summary>
public string UserId { get; set; }
/// <summary>
/// Gets or sets the user of the relationship.
/// </summary>
public User User { get; set; }
/// <summary>
/// Gets or sets the e-mail of the relationship.
/// </summary>
public string Email { get; set; }
}
}
| 29.666667 | 128 | 0.573034 | [
"MIT"
] | Vilksar/NetControl4BioMed | NetControl4BioMed/Data/Models/NetworkUser.cs | 1,248 | C# |
ο»Ώusing Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using SFA.DAS.Api.Common.Configuration;
using SFA.DAS.FindApprenticeshipTraining.Configuration;
using SFA.DAS.SharedOuterApi.Configuration;
namespace SFA.DAS.FindApprenticeshipTraining.Api.AppStart
{
public static class AddConfigurationOptionsExtension
{
public static void AddConfigurationOptions(this IServiceCollection services, IConfiguration configuration)
{
services.AddOptions();
services.Configure<CoursesApiConfiguration>(configuration.GetSection(nameof(CoursesApiConfiguration)));
services.AddSingleton(cfg => cfg.GetService<IOptions<CoursesApiConfiguration>>().Value);
services.Configure<CourseDeliveryApiConfiguration>(configuration.GetSection(nameof(CourseDeliveryApiConfiguration)));
services.AddSingleton(cfg => cfg.GetService<IOptions<CourseDeliveryApiConfiguration>>().Value);
services.Configure<FindApprenticeshipTrainingConfiguration>(configuration.GetSection(nameof(FindApprenticeshipTrainingConfiguration)));
services.AddSingleton(cfg => cfg.GetService<IOptions<FindApprenticeshipTrainingConfiguration>>().Value);
services.Configure<LocationApiConfiguration>(configuration.GetSection(nameof(LocationApiConfiguration)));
services.AddSingleton(cfg => cfg.GetService<IOptions<LocationApiConfiguration>>().Value);
services.Configure<AzureActiveDirectoryConfiguration>(configuration.GetSection("AzureAd"));
services.AddSingleton(cfg => cfg.GetService<IOptions<AzureActiveDirectoryConfiguration>>().Value);
}
}
} | 63.814815 | 147 | 0.775972 | [
"MIT"
] | SkillsFundingAgency/das-apim-endpoints | src/SFA.DAS.FindApprenticeshipTraining.Api/AppStart/AddConfigurationOptionsExtension.cs | 1,725 | C# |
ο»Ώ// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Linq;
using System.Reflection;
using System.Text;
using dnlib.DotNet;
using dnSpy.Contracts.Decompiler;
using dnSpy.Contracts.Text;
using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.NRefactory.PatternMatching;
namespace ICSharpCode.Decompiler.Ast.Transforms {
/// <summary>
/// Replaces method calls with the appropriate operator expressions.
/// Also simplifies "x = x op y" into "x op= y" where possible.
/// </summary>
public class ReplaceMethodCallsWithOperators : DepthFirstAstVisitor<object, object>, IAstTransformPoolObject
{
static readonly MemberReferenceExpression typeHandleOnTypeOfPattern = new MemberReferenceExpression {
Target = new Choice {
new TypeOfExpression(new AnyNode()),
new UndocumentedExpression { UndocumentedExpressionType = UndocumentedExpressionType.RefType, Arguments = { new AnyNode() } }
},
MemberName = "TypeHandle"
};
DecompilerContext context;
readonly StringBuilder stringBuilder;
public ReplaceMethodCallsWithOperators(DecompilerContext context)
{
this.stringBuilder = new StringBuilder();
Reset(context);
}
public void Reset(DecompilerContext context)
{
this.context = context;
}
public override object VisitInvocationExpression(InvocationExpression invocationExpression, object data)
{
base.VisitInvocationExpression(invocationExpression, data);
ProcessInvocationExpression(invocationExpression, stringBuilder);
return null;
}
static bool CheckType(ITypeDefOrRef tdr, UTF8String expNs, UTF8String expName)
{
// PERF: Don't allocate a System.String by calling FullName etc.
var tr = tdr as TypeRef;
if (tr != null)
return tr.Name == expName && tr.Namespace == expNs;
var td = tdr as TypeDef;
if (td != null)
return td.Name == expName && td.Namespace == expNs;
return false;
}
static readonly UTF8String systemString = new UTF8String("System");
static readonly UTF8String typeString = new UTF8String("Type");
static readonly UTF8String decimalString = new UTF8String("Decimal");
static readonly UTF8String activatortring = new UTF8String("Activator");
static readonly UTF8String systemReflectionString = new UTF8String("System.Reflection");
static readonly UTF8String fieldInfoString = new UTF8String("FieldInfo");
internal static void ProcessInvocationExpression(InvocationExpression invocationExpression, StringBuilder sb)
{
IMethod methodRef = invocationExpression.Annotation<IMethod>();
if (methodRef == null)
return;
var builder = invocationExpression.Annotation<MethodDebugInfoBuilder>();
var arguments = invocationExpression.Arguments.ToArray();
// Reduce "String.Concat(a, b)" to "a + b"
if (methodRef.Name == "Concat" && methodRef.DeclaringType != null && arguments.Length >= 2 && methodRef.DeclaringType.FullName == "System.String")
{
invocationExpression.Arguments.Clear(); // detach arguments from invocationExpression
Expression expr = arguments[0];
for (int i = 1; i < arguments.Length; i++) {
expr = new BinaryOperatorExpression(expr, BinaryOperatorType.Add, arguments[i]);
}
expr.CopyAnnotationsFrom(invocationExpression);
invocationExpression.ReplaceWith(expr);
expr.AddAnnotation(invocationExpression.GetAllRecursiveILSpans());
expr.AddAnnotation(builder);
return;
}
if (methodRef.Name == "CreateInstance" && CheckType(methodRef.DeclaringType, systemString, activatortring) &&
arguments.Length == 0 && methodRef is MethodSpec spec && methodRef.NumberOfGenericParameters > 0 &&
spec.GenericInstMethodSig.GenericArguments[0] is GenericSig genSig &&
genSig.GenericParam.HasDefaultConstructorConstraint) {
invocationExpression.ReplaceWith(
new ObjectCreateExpression(AstBuilder.ConvertType(spec.GenericInstMethodSig.GenericArguments[0], sb)).WithAnnotation(invocationExpression
.GetAllRecursiveILSpans()));
}
bool isSupportedType = CheckType(methodRef.DeclaringType, systemString, typeString) ||
CheckType(methodRef.DeclaringType, systemReflectionString, fieldInfoString);
switch (isSupportedType ? methodRef.Name.String : string.Empty) {
case "GetTypeFromHandle":
if (arguments.Length == 1 && methodRef.FullName == "System.Type System.Type::GetTypeFromHandle(System.RuntimeTypeHandle)") {
if (typeHandleOnTypeOfPattern.IsMatch(arguments[0])) {
invocationExpression.ReplaceWith(((MemberReferenceExpression)arguments[0]).Target
.WithAnnotation(invocationExpression.GetAllRecursiveILSpans()).WithAnnotation(builder));
return;
}
}
break;
case "GetFieldFromHandle":
if (arguments.Length == 1 && methodRef.FullName == "System.Reflection.FieldInfo System.Reflection.FieldInfo::GetFieldFromHandle(System.RuntimeFieldHandle)") {
MemberReferenceExpression mre = arguments[0] as MemberReferenceExpression;
if (mre != null && mre.MemberName == "FieldHandle" && mre.Target.Annotation<LdTokenAnnotation>() != null) {
invocationExpression.ReplaceWith(mre.Target
.WithAnnotation(invocationExpression.GetAllRecursiveILSpans()).WithAnnotation(builder));
return;
}
}
else if (arguments.Length == 2 && methodRef.FullName == "System.Reflection.FieldInfo System.Reflection.FieldInfo::GetFieldFromHandle(System.RuntimeFieldHandle,System.RuntimeTypeHandle)") {
MemberReferenceExpression mre1 = arguments[0] as MemberReferenceExpression;
MemberReferenceExpression mre2 = arguments[1] as MemberReferenceExpression;
if (mre1 != null && mre1.MemberName == "FieldHandle" && mre1.Target.Annotation<LdTokenAnnotation>() != null) {
if (mre2 != null && mre2.MemberName == "TypeHandle" && mre2.Target is TypeOfExpression) {
Expression oldArg = ((InvocationExpression)mre1.Target).Arguments.Single();
IField field = oldArg.Annotation<IField>();
if (field != null) {
var ilSpans = invocationExpression.GetAllRecursiveILSpans();
AstType declaringType = ((TypeOfExpression)mre2.Target).Type.Detach();
oldArg.ReplaceWith(declaringType.Member(field.Name, field).WithAnnotation(field));
invocationExpression.ReplaceWith(mre1.Target.WithAnnotation(ilSpans).WithAnnotation(builder));
return;
}
}
}
}
break;
}
BinaryOperatorType? bop = GetBinaryOperatorTypeFromMetadataName(methodRef.Name);
if (bop != null && arguments.Length == 2) {
invocationExpression.Arguments.Clear(); // detach arguments from invocationExpression
invocationExpression.ReplaceWith(
new BinaryOperatorExpression(arguments[0], bop.Value, arguments[1]).WithAnnotation(methodRef)
.WithAnnotation(invocationExpression.GetAllRecursiveILSpans()).WithAnnotation(builder)
);
return;
}
UnaryOperatorType? uop = GetUnaryOperatorTypeFromMetadataName(methodRef.Name);
if (uop != null && arguments.Length == 1) {
if (uop == UnaryOperatorType.Increment || uop == UnaryOperatorType.Decrement) {
// `op_Increment(a)` is not equivalent to `++a`,
// because it doesn't assign the incremented value to a.
if (CheckType(methodRef.DeclaringType, systemString, decimalString)) {
// Legacy csc optimizes "d + 1m" to "op_Increment(d)",
// so reverse that optimization here:
invocationExpression.ReplaceWith(
new BinaryOperatorExpression(
arguments[0].Detach(),
(uop == UnaryOperatorType.Increment ? BinaryOperatorType.Add : BinaryOperatorType.Subtract),
new PrimitiveExpression(1m)
).CopyAnnotationsFrom(invocationExpression)
);
}
return;
}
arguments[0].Remove(); // detach argument
invocationExpression.ReplaceWith(
new UnaryOperatorExpression(uop.Value, arguments[0]).WithAnnotation(methodRef)
.WithAnnotation(invocationExpression.GetAllRecursiveILSpans()).WithAnnotation(builder)
);
return;
}
if (methodRef.Name == "op_Explicit" && arguments.Length == 1) {
arguments[0].Remove(); // detach argument
invocationExpression.ReplaceWith(
arguments[0].CastTo(AstBuilder.ConvertType(methodRef.MethodSig.GetRetType(), sb))
.WithAnnotation(methodRef)
.WithAnnotation(invocationExpression.GetAllRecursiveILSpans())
.WithAnnotation(builder)
);
return;
}
if (methodRef.Name == "op_Implicit" && arguments.Length == 1) {
invocationExpression.ReplaceWith(arguments[0].WithAnnotation(invocationExpression.GetAllRecursiveILSpans()).WithAnnotation(builder));
return;
}
if (methodRef.Name == "op_True" && arguments.Length == 1 && invocationExpression.Role == Roles.Condition) {
invocationExpression.ReplaceWith(arguments[0].WithAnnotation(invocationExpression.GetAllRecursiveILSpans()).WithAnnotation(builder));
return;
}
return;
}
static BinaryOperatorType? GetBinaryOperatorTypeFromMetadataName(string name)
{
switch (name) {
case "op_Addition":
return BinaryOperatorType.Add;
case "op_Subtraction":
return BinaryOperatorType.Subtract;
case "op_Multiply":
return BinaryOperatorType.Multiply;
case "op_Division":
return BinaryOperatorType.Divide;
case "op_Modulus":
return BinaryOperatorType.Modulus;
case "op_BitwiseAnd":
return BinaryOperatorType.BitwiseAnd;
case "op_BitwiseOr":
return BinaryOperatorType.BitwiseOr;
case "op_ExclusiveOr":
return BinaryOperatorType.ExclusiveOr;
case "op_LeftShift":
return BinaryOperatorType.ShiftLeft;
case "op_RightShift":
return BinaryOperatorType.ShiftRight;
case "op_Equality":
return BinaryOperatorType.Equality;
case "op_Inequality":
return BinaryOperatorType.InEquality;
case "op_LessThan":
return BinaryOperatorType.LessThan;
case "op_LessThanOrEqual":
return BinaryOperatorType.LessThanOrEqual;
case "op_GreaterThan":
return BinaryOperatorType.GreaterThan;
case "op_GreaterThanOrEqual":
return BinaryOperatorType.GreaterThanOrEqual;
default:
return null;
}
}
static UnaryOperatorType? GetUnaryOperatorTypeFromMetadataName(string name)
{
switch (name) {
case "op_LogicalNot":
return UnaryOperatorType.Not;
case "op_OnesComplement":
return UnaryOperatorType.BitNot;
case "op_UnaryNegation":
return UnaryOperatorType.Minus;
case "op_UnaryPlus":
return UnaryOperatorType.Plus;
case "op_Increment":
return UnaryOperatorType.Increment;
case "op_Decrement":
return UnaryOperatorType.Decrement;
default:
return null;
}
}
/// <summary>
/// This annotation is used to convert a compound assignment "a += 2;" or increment operator "a++;"
/// back to the original "a = a + 2;". This is sometimes necessary when the checked/unchecked semantics
/// cannot be guaranteed otherwise (see CheckedUnchecked.ForWithCheckedInitializerAndUncheckedIterator test)
/// </summary>
public class RestoreOriginalAssignOperatorAnnotation
{
readonly BinaryOperatorExpression binaryOperatorExpression;
public RestoreOriginalAssignOperatorAnnotation(BinaryOperatorExpression binaryOperatorExpression)
{
this.binaryOperatorExpression = binaryOperatorExpression;
}
public AssignmentExpression Restore(Expression expression)
{
var ilSpans = expression.GetAllRecursiveILSpans();
expression.RemoveAnnotations<RestoreOriginalAssignOperatorAnnotation>();
AssignmentExpression assign = expression as AssignmentExpression;
if (assign == null) {
UnaryOperatorExpression uoe = (UnaryOperatorExpression)expression;
assign = new AssignmentExpression(uoe.Expression.Detach(), new PrimitiveExpression(1));
} else {
assign.Operator = AssignmentOperatorType.Assign;
}
binaryOperatorExpression.Right = assign.Right.Detach();
assign.Right = binaryOperatorExpression;
assign.AddAnnotation(ilSpans);
return assign;
}
}
public override object VisitAssignmentExpression(AssignmentExpression assignment, object data)
{
base.VisitAssignmentExpression(assignment, data);
// Combine "x = x op y" into "x op= y"
BinaryOperatorExpression binary = assignment.Right as BinaryOperatorExpression;
if (binary != null && assignment.Operator == AssignmentOperatorType.Assign) {
if (CanConvertToCompoundAssignment(assignment.Left) && assignment.Left.IsMatch(binary.Left)) {
assignment.Operator = GetAssignmentOperatorForBinaryOperator(binary.Operator);
if (assignment.Operator != AssignmentOperatorType.Assign) {
// If we found a shorter operator, get rid of the BinaryOperatorExpression:
assignment.CopyAnnotationsFrom(binary);
assignment.Right = binary.Right.WithAnnotation(assignment.Right.GetAllRecursiveILSpans());
assignment.AddAnnotation(new RestoreOriginalAssignOperatorAnnotation(binary));
}
}
}
if (context.Settings.IntroduceIncrementAndDecrement && (assignment.Operator == AssignmentOperatorType.Add || assignment.Operator == AssignmentOperatorType.Subtract)) {
// detect increment/decrement
if (assignment.Right.IsMatch(new PrimitiveExpression(1))) {
// only if it's not a custom operator
if (assignment.Annotation<IMethod>() == null) {
UnaryOperatorType type;
// When the parent is an expression statement, pre- or post-increment doesn't matter;
// so we can pick post-increment which is more commonly used (for (int i = 0; i < x; i++))
if (assignment.Parent is ExpressionStatement)
type = (assignment.Operator == AssignmentOperatorType.Add) ? UnaryOperatorType.PostIncrement : UnaryOperatorType.PostDecrement;
else
type = (assignment.Operator == AssignmentOperatorType.Add) ? UnaryOperatorType.Increment : UnaryOperatorType.Decrement;
assignment.ReplaceWith(new UnaryOperatorExpression(type, assignment.Left.Detach()).CopyAnnotationsFrom(assignment).WithAnnotation(assignment.GetAllRecursiveILSpans()));
}
}
}
return null;
}
public static AssignmentOperatorType GetAssignmentOperatorForBinaryOperator(BinaryOperatorType bop)
{
switch (bop) {
case BinaryOperatorType.Add:
return AssignmentOperatorType.Add;
case BinaryOperatorType.Subtract:
return AssignmentOperatorType.Subtract;
case BinaryOperatorType.Multiply:
return AssignmentOperatorType.Multiply;
case BinaryOperatorType.Divide:
return AssignmentOperatorType.Divide;
case BinaryOperatorType.Modulus:
return AssignmentOperatorType.Modulus;
case BinaryOperatorType.ShiftLeft:
return AssignmentOperatorType.ShiftLeft;
case BinaryOperatorType.ShiftRight:
return AssignmentOperatorType.ShiftRight;
case BinaryOperatorType.BitwiseAnd:
return AssignmentOperatorType.BitwiseAnd;
case BinaryOperatorType.BitwiseOr:
return AssignmentOperatorType.BitwiseOr;
case BinaryOperatorType.ExclusiveOr:
return AssignmentOperatorType.ExclusiveOr;
default:
return AssignmentOperatorType.Assign;
}
}
static bool CanConvertToCompoundAssignment(Expression left)
{
MemberReferenceExpression mre = left as MemberReferenceExpression;
if (mre != null)
return IsWithoutSideEffects(mre.Target);
IndexerExpression ie = left as IndexerExpression;
if (ie != null)
return IsWithoutSideEffects(ie.Target) && ie.Arguments.All(IsWithoutSideEffects);
UnaryOperatorExpression uoe = left as UnaryOperatorExpression;
if (uoe != null && uoe.Operator == UnaryOperatorType.Dereference)
return IsWithoutSideEffects(uoe.Expression);
return IsWithoutSideEffects(left);
}
static bool IsWithoutSideEffects(Expression left)
{
return left is ThisReferenceExpression || left is IdentifierExpression || left is TypeReferenceExpression || left is BaseReferenceExpression;
}
static readonly Expression getMethodOrConstructorFromHandlePattern =
new TypePattern(typeof(MethodBase)).ToType().Invoke2(
BoxedTextColor.StaticMethod,
"GetMethodFromHandle",
new NamedNode("ldtokenNode", new LdTokenPattern("method")).ToExpression().Member("MethodHandle", BoxedTextColor.InstanceProperty),
new OptionalNode(new TypeOfExpression(new AnyNode("declaringType")).Member("TypeHandle", BoxedTextColor.InstanceProperty))
).CastTo(new Choice {
new TypePattern(typeof(MethodInfo)),
new TypePattern(typeof(ConstructorInfo))
});
public override object VisitCastExpression(CastExpression castExpression, object data)
{
base.VisitCastExpression(castExpression, data);
// Handle methodof
Match m = getMethodOrConstructorFromHandlePattern.Match(castExpression);
if (m.Success) {
var ilSpans = castExpression.GetAllRecursiveILSpans();
IMethod method = m.Get<AstNode>("method").Single().Annotation<IMethod>();
if (method != null && m.Has("declaringType")) {
Expression newNode = m.Get<AstType>("declaringType").Single().Detach().Member(method.Name, method);
newNode = newNode.Invoke(method.MethodSig.GetParameters().Select(p => new TypeReferenceExpression(AstBuilder.ConvertType(p, stringBuilder))));
newNode.AddAnnotation(method);
m.Get<AstNode>("method").Single().ReplaceWith(newNode);
}
castExpression.ReplaceWith(m.Get<AstNode>("ldtokenNode").Single().WithAnnotation(ilSpans));
}
return null;
}
void IAstTransform.Run(AstNode node)
{
node.AcceptVisitor(this, null);
}
}
}
| 43.985782 | 193 | 0.742539 | [
"MIT"
] | dnSpyEx/ILSpy | ICSharpCode.Decompiler/Ast/Transforms/ReplaceMethodCallsWithOperators.cs | 18,564 | C# |
ο»Ώnamespace MRU
{
using MRULib;
using MRULib.MRU.Interfaces;
using System;
/// <summary>
/// Implements a simple test generating procedure that simulates adding
/// multiple MRU entries over time.
/// </summary>
internal static class GenerateTestData
{
internal static IMRUListViewModel CreateTestData()
{
var retList = MRU_Service.Create_List();
var now = DateTime.Now;
retList.UpdateEntry(MRU_Service.Create_Entry(@"C:tmp\t0_now.txt", false));
// This should be shown yesterday if update and grouping work correctly
retList.UpdateEntry(MRU_Service.Create_Entry(@"C:tmp\t15_yesterday.txt", now.Add(new TimeSpan(-20, 0, 0, 0)), false));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:\tmp\t15_yesterday.txt", now.Add(new TimeSpan(-1, 0, 0, 0)), false));
retList.UpdateEntry(MRU_Service.Create_Entry(@"f:tmp\t1_today.txt", now.Add(new TimeSpan(-1, 0, 0, 0)), true ));
retList.UpdateEntry(MRU_Service.Create_Entry(@"f:tmp\Readme.txt" , now.Add(new TimeSpan(-1, 0, 0, 0)), true));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:tmp\t2_today.txt", now.Add(new TimeSpan(0, -1, 0, 0)), false ));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:tmp\t3_today.txt", now.Add(new TimeSpan(0, -10, 0, 0)), false ));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:tmp\t4_today.txt", now.Add(new TimeSpan(0, 0, -1, 0)), false ));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:tmp\t5_today.txt", now.Add(new TimeSpan(0,-20, 0, 0)), false ));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:tmp\t5_today.txt", now.Add(new TimeSpan(0, -20, 0, 0)), false));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:tmp\t6_today.txt", now.Add(new TimeSpan(0,-44, 0, 0)), false ));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:tmp\directory1\directory2\directory3\t7_today.txt", now.Add(new TimeSpan( -30, 0, 0, 0) ),true ));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:tmp\directory1\directory2\directory3\t8_today.txt", now.Add(new TimeSpan( -25, 0, 0, 0) ),false));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:tmp\directory1\directory2\directory3\t9_today.txt", now.Add(new TimeSpan( -20, 0, 0, 0) ),false));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:tmp\directory1\directory2\directory3\t10_today.txt", now.Add(new TimeSpan(-10, 0, 0, 0) ),false));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:tmp\directory1\directory2\directory3\t11_today.txt", now.Add(new TimeSpan( -5, 0, 0, 0) ),false));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:tmp\directory1\directory2\directory3\t12_today.txt", now.Add(new TimeSpan( -4, 0, 0, 0) ),false));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:tmp\directory1\directory2\directory3\t13_today.txt", now.Add(new TimeSpan( -3, 0, 0, 0) ),false));
retList.UpdateEntry(MRU_Service.Create_Entry(@"c:tmp\directory1\directory2\directory3\t14_today.txt", now.Add(new TimeSpan( -2, 0, 0, 0) ),false));
return retList;
}
}
}
| 65.816327 | 159 | 0.666977 | [
"MIT"
] | Dirkster99/MRULib | source/MRUDemo/GenerateTestData.cs | 3,227 | C# |
ο»Ώnamespace DemoAcmeAp.Domain.Services
{
using DemoAcmeAp.Domain.Entities;
using DemoAcmeAp.Domain.Interfaces.Services;
using DemoAcmeAp.Domain.Interfaces.UoW;
using System.Collections.Generic;
using System.Threading.Tasks;
internal class InstalacaoService : ServiceBase<Instalacao>, IInstalacaoService
{
private readonly IUnitOfWork uow;
public InstalacaoService(IUnitOfWork uow) : base(uow.Instalacoes)
{
this.uow = uow;
}
public async Task<Instalacao> FindByCodigo(string codigo)
{
return await uow.Instalacoes.FindByCodigo(codigo);
}
public async Task<IEnumerable<Instalacao>> FindByClienteCpf(string clienteCpf)
{
return await uow.Instalacoes.FindByClienteCpf(clienteCpf);
}
}
} | 29.785714 | 86 | 0.67506 | [
"MIT"
] | EngBrunoAlves/ArquiteturaSoftware | DemoAcmeAp/src/DemoAcmeAp.Domain/Services/InstalacaoService.cs | 836 | C# |
ο»Ώusing System;
using System.Collections.Generic;
using SwapperV2.Graphics;
namespace SwapperV2.Content
{
public class SpriteLoader
{
// This list both keeps track of loaders and keeps them alive (garbage collection)
public static List<SpriteLoader> Loaders = new List<SpriteLoader>();
public string Path;
public Action<Image> Load;
public SpriteLoader(string path, Action<Image> load)
{
Path = path;
Load = load;
if (Sprites.Loaded)
Resolve();
else
Loaders.Add(this);
}
public void Resolve()
{
Load(Sprites.Dict[Path]);
}
}
}
| 21.69697 | 90 | 0.560056 | [
"MIT"
] | iSkLz/Swapper2 | Code/Content/SpriteLoader.cs | 718 | C# |
ο»Ώusing System.Globalization;
using System.IO;
using System.Threading;
using UnityEditor;
using UnityEngine;
namespace mFramework.Editor
{
// ReSharper disable once UnusedMember.Global
[InitializeOnLoad]
public sealed class mEditor
{
public static mEditor Instance { get; }
static mEditor()
{
Instance = new mEditor();
}
private mEditor()
{
if (Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator != ".")
{
var definition = (CultureInfo) Thread.CurrentThread.CurrentCulture.Clone();
definition.NumberFormat.NumberDecimalSeparator = ".";
Thread.CurrentThread.CurrentCulture = definition;
}
Debug.Log("[mEditor] Attached");
EditorApplication.playModeStateChanged += EditorApplicationOnPlayModeStateChanged;
EditorApplication.hierarchyChanged += EditorApplicationOnHierarchyChanged;
}
~mEditor()
{
EditorApplication.playModeStateChanged -= EditorApplicationOnPlayModeStateChanged;
EditorApplication.hierarchyChanged -= EditorApplicationOnHierarchyChanged;
Debug.Log("[mEditor] ~mEditor");
}
private static void EditorApplicationOnPlayModeStateChanged(PlayModeStateChange state)
{
Debug.Log($"state = {state}");
}
private static void EditorApplicationOnHierarchyChanged()
{
}
// ReSharper disable once UnusedMember.Local
[MenuItem("Assets/Build AssetBundles")]
private static void BuildAllAssetBundles()
{
const string folderName = "AssetBundles";
var filePath = Path.Combine(Application.streamingAssetsPath, folderName);
if (!Directory.Exists(filePath))
Directory.CreateDirectory(filePath);
BuildPipeline.BuildAssetBundles(filePath, BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget);
AssetDatabase.Refresh();
}
}
}
| 32.136364 | 127 | 0.639793 | [
"MIT"
] | Matodor/mFramework | Scripts/Editor/mEditor.cs | 2,123 | C# |
ο»Ώusing System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace LibKidsNoteForEveryone
{
public class KidsNoteClientResponse
{
public HttpResponseMessage Response { get; set; }
public string Html { get; set; }
public Stream Binary { get; set; }
public KidsNoteClientResponse(HttpResponseMessage response, string html, Stream binary = null)
{
Response = response;
Html = html;
Binary = binary;
}
}
public class KidsNoteClient
{
public delegate Configuration GetCurrentConfigurationDelegate();
public delegate void KidsNoteClientProgressMessageDelegate(string message);
public GetCurrentConfigurationDelegate GetCurrentConfiguration;
public KidsNoteClientProgressMessageDelegate KidsNoteClientProgressMessage;
private KidsNoteClientParser Parser;
private HttpClient WebClient;
private HttpClientHandler WebClientHandler;
private CookieContainer Cookies;
private bool LoggedIn;
private bool RoleSelected;
private enum LoginStage
{
SIGNING_IN = 0,
LOGGED_IN,
};
public KidsNoteClient()
{
Parser = new KidsNoteClientParser();
Cookies = new CookieContainer();
WebClientHandler = new HttpClientHandler();
WebClientHandler.CookieContainer = Cookies;
WebClient = new HttpClient(WebClientHandler);
LoggedIn = false;
RoleSelected = false;
}
private string ContentTypeUrl(ContentType type)
{
switch (type)
{
case ContentType.REPORT:
return Constants.KIDSNOTE_URL + "/reports/";
case ContentType.NOTICE:
return Constants.KIDSNOTE_URL + "/notices/";
case ContentType.ALBUM:
return Constants.KIDSNOTE_URL + "/albums/";
case ContentType.CALENDAR:
return Constants.KIDSNOTE_URL + "/calendars/";
case ContentType.MENUTABLE:
return Constants.KIDSNOTE_URL + "/menus/";
case ContentType.MEDS_REQUEST:
return Constants.KIDSNOTE_URL + "/medication-requests/";
case ContentType.RETURN_HOME_NOTICE:
return Constants.KIDSNOTE_URL + "/return-home-notices/";
default:
break;
}
return "";
}
private string CssClassPrefix(ContentType type)
{
switch (type)
{
case ContentType.REPORT:
return "report";
case ContentType.NOTICE:
return "notice";
case ContentType.ALBUM:
return "album";
//case ContentType.CALENDAR:
// return "calendars";
//case ContentType.MENUTABLE:
// return "menus";
case ContentType.MEDS_REQUEST:
return "medication";
case ContentType.RETURN_HOME_NOTICE:
return "return-home";
default:
break;
}
return "";
}
private KidsNoteClientResponse DownloadPage(string url, bool asBinary = false)
{
KidsNoteClientResponse info = null;
try
{
WebClient.DefaultRequestHeaders.Add("Accept-Language", "ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3");
Task<HttpResponseMessage> getTask = WebClient.GetAsync(url);
getTask.Wait();
HttpResponseMessage response = getTask.Result;
string html = "";
Stream binary = null;
if (asBinary)
{
//binary = response.Content.ReadAsByteArrayAsync().Result;
binary = response.Content.ReadAsStreamAsync().Result;
}
else
{
html = response.Content.ReadAsStringAsync().Result;
}
info = new KidsNoteClientResponse(response, html, binary);
}
catch (Exception)
{
info = null;
}
return info;
}
public KidsNoteContentDownloadResult DownloadContent(ContentType type, UInt64 lastContentId, int page = 1)
{
KidsNoteContentDownloadResult result = new KidsNoteContentDownloadResult();
#if !DEBUG
// μλ¨νλ μμ·¨ μ¬λΆλ μκ΄μμ΄ μμμ΄ λ§λ€μ΄μ§κ³ λμ μ
λ°μ΄νΈ λλ κ²μΌλ‘ 보μΈλ€.
// λ§μ§λ§ cron μμ
λ κΈ°μ€μΌλ‘ 체ν¬νλ€.
if (type == ContentType.MENUTABLE)
{
Configuration conf = GetCurrentConfiguration();
int endHour = conf.OperationHourEnd != 0 ? conf.OperationHourEnd : 20;
DateTime now = DateTime.Now;
if (now.Hour < endHour)
{
result.NotNow = true;
return result;
}
}
#endif
string url = ContentTypeUrl(type);
if (url == "")
{
result.Description = "URL μ μ μ μμ";
return result;
}
if (page > 1)
{
url += String.Format("?page={0}", page);
}
KidsNoteClientResponse response = DownloadPage(Constants.KIDSNOTE_URL);
if (!LoggedIn && response != null && IsLoginPage(response.Html))
{
KidsNoteClientResponse loginResult = Login(response.Html);
LoggedIn = (loginResult.Response.StatusCode == HttpStatusCode.Found ||
loginResult.Response.StatusCode == HttpStatusCode.OK);
}
if (!LoggedIn)
{
if (KidsNoteClientProgressMessage != null)
{
KidsNoteClientProgressMessage("Login Failed");
}
result.Description = "λ‘κ·ΈμΈ μ€ν¨";
return result;
}
KidsNoteClientResponse downLoadResult = DownloadPage(url);
if (downLoadResult == null)
{
result.Description = "νμ΄μ§ λ€μ΄λ‘λ μ€ν¨";
return result;
}
if (page > 1 && downLoadResult.Response.StatusCode == HttpStatusCode.NotFound)
{
result.Description = "νμ΄μ§ λ€μ΄λ‘λ μ€ν¨ : NotFound";
result.ContentList = new LinkedList<KidsNoteContent>();
return result;
}
if (downLoadResult.Response.StatusCode == HttpStatusCode.OK)
{
result.Html = downLoadResult.Html;
string prefix = CssClassPrefix(type);
if (type == ContentType.MENUTABLE)
{
// μλ¨νλ λͺ©λ‘κ΅¬μ± μμ΄ λΉμΌ λ°μ΄ν°λ§ μμ§νλ€.
result.ContentList = Parser.ParseMenuTable(type, downLoadResult.Html);
}
else
{
result.ContentList = Parser.ParseArticleList(type, downLoadResult.Html, prefix);
}
if (result.ContentList == null)
{
result.Description = "Parse μ€ν¨";
return result;
}
var node = result.ContentList.First;
while (node != null)
{
var next = node.Next;
if (node.Value.Id <= lastContentId)
{
result.ContentList.Remove(node);
}
node = next;
}
foreach (var each in result.ContentList)
{
if (each.Type == ContentType.MENUTABLE)
{
foreach (var content in result.ContentList)
{
foreach (var attach in content.Attachments)
{
KidsNoteClientResponse resp = DownloadPage(attach.DownloadUrl, true);
if (resp.Response.StatusCode == HttpStatusCode.OK)
{
attach.Data = resp.Binary;
}
else
{
result.Description = "Download μ€ν¨ : μ²¨λΆ μ΄λ―Έμ§ λ€μ΄λ‘λ μ€ν¨";
}
}
}
}
else
{
KidsNoteClientResponse eachResp = DownloadPage(each.OriginalPageUrl);
if (eachResp != null && eachResp.Response.StatusCode == HttpStatusCode.OK)
{
result.Html = eachResp.Html;
if (!RoleSelected && Parser.IsRoleSelectionPage(eachResp.Html))
{
RoleSelected = true;
string csrfMiddlewareToken = Parser.GetCsrfMiddlewareToken(eachResp.Html);
string next = each.OriginalPageUrl.Substring(Constants.KIDSNOTE_URL.Length);
FormUrlEncodedContent content = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("csrfmiddlewaretoken", csrfMiddlewareToken),
new KeyValuePair<string, string>("nickname", "father"),
new KeyValuePair<string, string>("next", next)
}); ;
KidsNoteClientResponse roleResp = PostData(Constants.KIDSNOTE_ROLE_POST_URL, content);
if (roleResp.Response.StatusCode != HttpStatusCode.OK)
{
result.Description = "Role μ€μ μ€ν¨";
return result;
}
}
// Get Again
eachResp = DownloadPage(each.PageUrl);
if (eachResp != null && eachResp.Response.StatusCode == HttpStatusCode.OK)
{
Parser.ParseContent(each, eachResp.Html, prefix);
bool hasNoContent = each.Title.Length == 0 ||
(each.Content.Length == 0 && each.Attachments.Count == 0);
if (type != ContentType.MENUTABLE && hasNoContent)
{
result.Description = "λ³Έλ¬Έ/μ λͺ© Parse μ€ν¨";
return result;
}
}
foreach (var attach in each.Attachments)
{
KidsNoteClientResponse resp = DownloadPage(attach.DownloadUrl, true);
if (resp.Response.StatusCode == HttpStatusCode.OK)
{
attach.Data = resp.Binary;
}
else if (attach.ImageSource != "")
{
// URL μλ¬Έμ΄ νκΈλ‘ λμ΄ μμΌλ©΄ λ€μ΄λ‘λκ° μλλ λ― νλ€.
// KidsNote μΉμλ² (nginx) λ¬Έμ μΈμ§, ν€μ¦λ
ΈνΈ μλΉμ€ λ¬Έμ μΈμ§λ λΆνμ€.
// μ΄ κ²½μ° img νκ·Έμ src λ‘ λ°μλ³Έλ€.
resp = DownloadPage(attach.ImageSource, true);
if (resp.Response.StatusCode == HttpStatusCode.OK)
{
attach.Data = resp.Binary;
}
else
{
result.Description = "Download μ€ν¨ : μ²¨λΆ μ΄λ―Έμ§ λ€μ΄λ‘λ μ€ν¨";
}
}
else
{
result.Description = "Download μ€ν¨ : μ½λ OK μλ";
}
}
}
}
}
return result;
}
return null;
}
private bool IsLoginPage(string html)
{
return html.IndexOf("<form action=\"/login/\"") > 0;
}
private KidsNoteClientResponse Login(string formHtml)
{
string csrfMiddlewareToken = Parser.GetCsrfMiddlewareToken(formHtml);
Configuration conf = GetCurrentConfiguration();
FormUrlEncodedContent content = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("csrfmiddlewaretoken", csrfMiddlewareToken),
new KeyValuePair<string, string>("username", conf.KidsNoteId),
new KeyValuePair<string, string>("password", conf.KidsNotePassword)
});
return PostData(Constants.KIDSNOTE_LOGIN_POST_URL, content);
}
private KidsNoteClientResponse PostData(string url, FormUrlEncodedContent form)
{
Task<HttpResponseMessage> postTask = WebClient.PostAsync(url, form);
postTask.Wait();
HttpResponseMessage response = postTask.Result;
string html = response.Content.ReadAsStringAsync().Result;
KidsNoteClientResponse info = new KidsNoteClientResponse(response, html);
return info;
}
}
}
| 37.780423 | 118 | 0.462923 | [
"MIT"
] | KuddLim/KidsNoteForEveryone | Libs/LibKidsNoteForEveryone/KidsNoteClient.cs | 14,675 | C# |
ο»Ώusing System;
using System.Collections.Concurrent;
using System.Threading;
namespace Polly.Contrib.DuplicateRequestCollapser
{
internal static class RequestCollapserEngine
{
internal static TResult Implementation<TResult>(
Func<Context, CancellationToken, TResult> action,
Context context,
CancellationToken cancellationToken,
IKeyStrategy keyStrategy,
ConcurrentDictionary<string, Lazy<object>> collapser,
ISyncLockProvider lockProvider)
{
cancellationToken.ThrowIfCancellationRequested();
string key = keyStrategy.GetKey(context);
// Fast-path if no key specified on Context (similar to CachePolicy).
if (key == null)
{
return action(context, cancellationToken);
}
Lazy<object> lazy;
using (lockProvider.AcquireLock(key, context, cancellationToken))
{
lazy = collapser.GetOrAdd(key, new Lazy<object>(() => action(context, cancellationToken), LazyThreadSafetyMode.ExecutionAndPublication)); // Note: per documentation, LazyThreadSafetyMode.ExecutionAndPublication guarantees single execution, but means the executed code must not lock, as this risks deadlocks. We should document.
}
TResult result = (TResult)lazy.Value;
// As soon as the lazy has returned a result to one thread, the concurrent request set is over, so we evict the lazy from the ConcurrentDictionary.
// We need to evict within a lock, to be sure we are not, due to potential race with new threads populating, evicting a different lazy created by a different thread.
// To reduce lock contention, first check outside the lock whether we still need to remove it (we will double-check inside the lock).
if (collapser.TryGetValue(key, out Lazy<object> currentValue))
{
if (currentValue == lazy)
{
using (lockProvider.AcquireLock(key, context, cancellationToken))
{
// Double-check that there has not been a race which updated the dictionary with a new value.
if (collapser.TryGetValue(key, out Lazy<object> valueWithinLock))
{
if (valueWithinLock == lazy)
{
collapser.TryRemove(key, out _);
}
}
}
}
}
return result;
}
}
} | 44.566667 | 344 | 0.589379 | [
"BSD-3-Clause"
] | Allen-Xiao/Polly.Contrib.DuplicateRequestCollapser | src/Polly.Contrib.DuplicateRequestCollapser/RequestCollapserEngine.cs | 2,676 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.