content
stringlengths
5
1.04M
avg_line_length
float64
1.75
12.9k
max_line_length
int64
2
244k
alphanum_fraction
float64
0
0.98
licenses
list
repository_name
stringlengths
7
92
path
stringlengths
3
249
size
int64
5
1.04M
lang
stringclasses
2 values
using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; [RequireComponent(typeof(Health), typeof(Actor), typeof(NavMeshAgent))] public class EnemyController : MonoBehaviour { [System.Serializable] public struct RendererIndexData { public Renderer renderer; public int materialIndex; public RendererIndexData(Renderer renderer, int index) { this.renderer = renderer; this.materialIndex = index; } } [Header("Parameters")] [Tooltip("The Y height at which the enemy will be automatically killed (if it falls off of the level)")] public float selfDestructYHeight = -20f; [Tooltip("The distance at which the enemy considers that it has reached its current path destination point")] public float pathReachingRadius = 2f; [Tooltip("The speed at which the enemy rotates")] public float orientationSpeed = 10f; [Tooltip("Delay after death where the GameObject is destroyed (to allow for animation)")] public float deathDuration = 0f; [Header("Weapons Parameters")] [Tooltip("Allow weapon swapping for this enemy")] public bool swapToNextWeapon = false; [Tooltip("Time delay between a weapon swap and the next attack")] public float delayAfterWeaponSwap = 0f; [Header("Eye color")] [Tooltip("Material for the eye color")] public Material eyeColorMaterial; [Tooltip("The default color of the bot's eye")] [ColorUsageAttribute(true, true)] public Color defaultEyeColor; [Tooltip("The attack color of the bot's eye")] [ColorUsageAttribute(true, true)] public Color attackEyeColor; [Header("Flash on hit")] [Tooltip("The material used for the body of the hoverbot")] public Material bodyMaterial; [Tooltip("The gradient representing the color of the flash on hit")] [GradientUsageAttribute(true)] public Gradient onHitBodyGradient; [Tooltip("The duration of the flash on hit")] public float flashOnHitDuration = 0.5f; [Header("Sounds")] [Tooltip("Sound played when recieving damages")] public AudioClip damageTick; [Header("VFX")] [Tooltip("The VFX prefab spawned when the enemy dies")] public GameObject deathVFX; [Tooltip("The point at which the death VFX is spawned")] public Transform deathVFXSpawnPoint; [Header("Loot")] [Tooltip("The object this enemy can drop when dying")] public GameObject lootPrefab; [Tooltip("The chance the object has to drop")] [Range(0, 1)] public float dropRate = 1f; [Header("Debug Display")] [Tooltip("Color of the sphere gizmo representing the path reaching range")] public Color pathReachingRangeColor = Color.yellow; [Tooltip("Color of the sphere gizmo representing the attack range")] public Color attackRangeColor = Color.red; [Tooltip("Color of the sphere gizmo representing the detection range")] public Color detectionRangeColor = Color.blue; public UnityAction onAttack; public UnityAction onDetectedTarget; public UnityAction onLostTarget; public UnityAction onDamaged; List<RendererIndexData> m_BodyRenderers = new List<RendererIndexData>(); MaterialPropertyBlock m_BodyFlashMaterialPropertyBlock; float m_LastTimeDamaged = float.NegativeInfinity; RendererIndexData m_EyeRendererData; MaterialPropertyBlock m_EyeColorMaterialPropertyBlock; public PatrolPath patrolPath { get; set; } public GameObject knownDetectedTarget => m_DetectionModule.knownDetectedTarget; public bool isTargetInAttackRange => m_DetectionModule.isTargetInAttackRange; public bool isSeeingTarget => m_DetectionModule.isSeeingTarget; public bool hadKnownTarget => m_DetectionModule.hadKnownTarget; public NavMeshAgent m_NavMeshAgent { get; private set; } public DetectionModule m_DetectionModule { get; private set; } int m_PathDestinationNodeIndex; EnemyManager m_EnemyManager; ActorsManager m_ActorsManager; Health m_Health; Actor m_Actor; Collider[] m_SelfColliders; GameFlowManager m_GameFlowManager; bool m_WasDamagedThisFrame; float m_LastTimeWeaponSwapped = Mathf.NegativeInfinity; int m_CurrentWeaponIndex; WeaponController m_CurrentWeapon; WeaponController[] m_Weapons; NavigationModule m_NavigationModule; void Start() { m_EnemyManager = FindObjectOfType<EnemyManager>(); DebugUtility.HandleErrorIfNullFindObject<EnemyManager, EnemyController>(m_EnemyManager, this); m_ActorsManager = FindObjectOfType<ActorsManager>(); DebugUtility.HandleErrorIfNullFindObject<ActorsManager, EnemyController>(m_ActorsManager, this); m_EnemyManager.RegisterEnemy(this); m_Health = GetComponent<Health>(); DebugUtility.HandleErrorIfNullGetComponent<Health, EnemyController>(m_Health, this, gameObject); m_Actor = GetComponent<Actor>(); DebugUtility.HandleErrorIfNullGetComponent<Actor, EnemyController>(m_Actor, this, gameObject); m_NavMeshAgent = GetComponent<NavMeshAgent>(); m_SelfColliders = GetComponentsInChildren<Collider>(); m_GameFlowManager = FindObjectOfType<GameFlowManager>(); DebugUtility.HandleErrorIfNullFindObject<GameFlowManager, EnemyController>(m_GameFlowManager, this); // Subscribe to damage & death actions m_Health.onDie += OnDie; m_Health.onDamaged += OnDamaged; // Find and initialize all weapons FindAndInitializeAllWeapons(); var weapon = GetCurrentWeapon(); weapon.ShowWeapon(true); var detectionModules = GetComponentsInChildren<DetectionModule>(); DebugUtility.HandleErrorIfNoComponentFound<DetectionModule, EnemyController>(detectionModules.Length, this, gameObject); DebugUtility.HandleWarningIfDuplicateObjects<DetectionModule, EnemyController>(detectionModules.Length, this, gameObject); // Initialize detection module m_DetectionModule = detectionModules[0]; m_DetectionModule.onDetectedTarget += OnDetectedTarget; m_DetectionModule.onLostTarget += OnLostTarget; onAttack += m_DetectionModule.OnAttack; var navigationModules = GetComponentsInChildren<NavigationModule>(); DebugUtility.HandleWarningIfDuplicateObjects<DetectionModule, EnemyController>(detectionModules.Length, this, gameObject); // Override navmesh agent data if (navigationModules.Length > 0) { m_NavigationModule = navigationModules[0]; m_NavMeshAgent.speed = m_NavigationModule.moveSpeed; m_NavMeshAgent.angularSpeed = m_NavigationModule.angularSpeed; m_NavMeshAgent.acceleration = m_NavigationModule.acceleration; } foreach (var renderer in GetComponentsInChildren<Renderer>(true)) { for (int i = 0; i < renderer.sharedMaterials.Length; i++) { if (renderer.sharedMaterials[i] == eyeColorMaterial) { m_EyeRendererData = new RendererIndexData(renderer, i); } if (renderer.sharedMaterials[i] == bodyMaterial) { m_BodyRenderers.Add(new RendererIndexData(renderer, i)); } } } m_BodyFlashMaterialPropertyBlock = new MaterialPropertyBlock(); // Check if we have an eye renderer for this enemy if (m_EyeRendererData.renderer != null) { m_EyeColorMaterialPropertyBlock = new MaterialPropertyBlock(); m_EyeColorMaterialPropertyBlock.SetColor("_EmissionColor", defaultEyeColor); m_EyeRendererData.renderer.SetPropertyBlock(m_EyeColorMaterialPropertyBlock, m_EyeRendererData.materialIndex); } } void Update() { EnsureIsWithinLevelBounds(); m_DetectionModule.HandleTargetDetection(m_Actor, m_SelfColliders); Color currentColor = onHitBodyGradient.Evaluate((Time.time - m_LastTimeDamaged) / flashOnHitDuration); m_BodyFlashMaterialPropertyBlock.SetColor("_EmissionColor", currentColor); foreach (var data in m_BodyRenderers) { data.renderer.SetPropertyBlock(m_BodyFlashMaterialPropertyBlock, data.materialIndex); } m_WasDamagedThisFrame = false; } void EnsureIsWithinLevelBounds() { // at every frame, this tests for conditions to kill the enemy if (transform.position.y < selfDestructYHeight) { Destroy(gameObject); return; } } void OnLostTarget() { onLostTarget.Invoke(); // Set the eye attack color and property block if the eye renderer is set if (m_EyeRendererData.renderer != null) { m_EyeColorMaterialPropertyBlock.SetColor("_EmissionColor", defaultEyeColor); m_EyeRendererData.renderer.SetPropertyBlock(m_EyeColorMaterialPropertyBlock, m_EyeRendererData.materialIndex); } } void OnDetectedTarget() { onDetectedTarget.Invoke(); // Set the eye default color and property block if the eye renderer is set if (m_EyeRendererData.renderer != null) { m_EyeColorMaterialPropertyBlock.SetColor("_EmissionColor", attackEyeColor); m_EyeRendererData.renderer.SetPropertyBlock(m_EyeColorMaterialPropertyBlock, m_EyeRendererData.materialIndex); } } public void OrientTowards(Vector3 lookPosition) { Vector3 lookDirection = Vector3.ProjectOnPlane(lookPosition - transform.position, Vector3.up).normalized; if (lookDirection.sqrMagnitude != 0f) { Quaternion targetRotation = Quaternion.LookRotation(lookDirection); transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * orientationSpeed); } } private bool IsPathValid() { return patrolPath && patrolPath.pathNodes.Count > 0; } public void ResetPathDestination() { m_PathDestinationNodeIndex = 0; } public void SetPathDestinationToClosestNode() { if (IsPathValid()) { int closestPathNodeIndex = 0; for (int i = 0; i < patrolPath.pathNodes.Count; i++) { float distanceToPathNode = patrolPath.GetDistanceToNode(transform.position, i); if (distanceToPathNode < patrolPath.GetDistanceToNode(transform.position, closestPathNodeIndex)) { closestPathNodeIndex = i; } } m_PathDestinationNodeIndex = closestPathNodeIndex; } else { m_PathDestinationNodeIndex = 0; } } public Vector3 GetDestinationOnPath() { if (IsPathValid()) { return patrolPath.GetPositionOfPathNode(m_PathDestinationNodeIndex); } else { return transform.position; } } public void SetNavDestination(Vector3 destination) { if (m_NavMeshAgent) { m_NavMeshAgent.SetDestination(destination); } } public void UpdatePathDestination(bool inverseOrder = false) { if (IsPathValid()) { // Check if reached the path destination if ((transform.position - GetDestinationOnPath()).magnitude <= pathReachingRadius) { // increment path destination index m_PathDestinationNodeIndex = inverseOrder ? (m_PathDestinationNodeIndex - 1) : (m_PathDestinationNodeIndex + 1); if (m_PathDestinationNodeIndex < 0) { m_PathDestinationNodeIndex += patrolPath.pathNodes.Count; } if (m_PathDestinationNodeIndex >= patrolPath.pathNodes.Count) { m_PathDestinationNodeIndex -= patrolPath.pathNodes.Count; } } } } void OnDamaged(float damage, GameObject damageSource) { // test if the damage source is the player if (damageSource && damageSource.GetComponent<PlayerCharacterController>()) { // pursue the player m_DetectionModule.OnDamaged(damageSource); if (onDamaged != null) { onDamaged.Invoke(); } m_LastTimeDamaged = Time.time; // play the damage tick sound if (damageTick && !m_WasDamagedThisFrame) AudioUtility.CreateSFX(damageTick, transform.position, AudioUtility.AudioGroups.DamageTick, 0f); m_WasDamagedThisFrame = true; } } void OnDie() { // spawn a particle system when dying var vfx = Instantiate(deathVFX, deathVFXSpawnPoint.position, Quaternion.identity); Destroy(vfx, 5f); // tells the game flow manager to handle the enemy destuction m_EnemyManager.UnregisterEnemy(this); // loot an object if (TryDropItem()) { Instantiate(lootPrefab, transform.position, Quaternion.identity); } // this will call the OnDestroy function Destroy(gameObject, deathDuration); } private void OnDrawGizmosSelected() { // Path reaching range Gizmos.color = pathReachingRangeColor; Gizmos.DrawWireSphere(transform.position, pathReachingRadius); if (m_DetectionModule != null) { // Detection range Gizmos.color = detectionRangeColor; Gizmos.DrawWireSphere(transform.position, m_DetectionModule.detectionRange); // Attack range Gizmos.color = attackRangeColor; Gizmos.DrawWireSphere(transform.position, m_DetectionModule.attackRange); } } public void OrientWeaponsTowards(Vector3 lookPosition) { for (int i = 0; i < m_Weapons.Length; i++) { // orient weapon towards player Vector3 weaponForward = (lookPosition - m_Weapons[i].weaponRoot.transform.position).normalized; m_Weapons[i].transform.forward = weaponForward; } } public bool TryAtack(Vector3 enemyPosition) { if (m_GameFlowManager.gameIsEnding) return false; OrientWeaponsTowards(enemyPosition); if ((m_LastTimeWeaponSwapped + delayAfterWeaponSwap) >= Time.time) return false; // Shoot the weapon bool didFire = GetCurrentWeapon().HandleShootInputs(false, true, false); if (didFire && onAttack != null) { onAttack.Invoke(); if (swapToNextWeapon && m_Weapons.Length > 1) { int nextWeaponIndex = (m_CurrentWeaponIndex + 1) % m_Weapons.Length; SetCurrentWeapon(nextWeaponIndex); } } return didFire; } public bool TryDropItem() { if (dropRate == 0 || lootPrefab == null) return false; else if (dropRate == 1) return true; else return (Random.value <= dropRate); } void FindAndInitializeAllWeapons() { // Check if we already found and initialized the weapons if (m_Weapons == null) { m_Weapons = GetComponentsInChildren<WeaponController>(); DebugUtility.HandleErrorIfNoComponentFound<WeaponController, EnemyController>(m_Weapons.Length, this, gameObject); for (int i = 0; i < m_Weapons.Length; i++) { m_Weapons[i].owner = gameObject; } } } public WeaponController GetCurrentWeapon() { FindAndInitializeAllWeapons(); // Check if no weapon is currently selected if (m_CurrentWeapon == null) { // Set the first weapon of the weapons list as the current weapon SetCurrentWeapon(0); } DebugUtility.HandleErrorIfNullGetComponent<WeaponController, EnemyController>(m_CurrentWeapon, this, gameObject); return m_CurrentWeapon; } void SetCurrentWeapon(int index) { m_CurrentWeaponIndex = index; m_CurrentWeapon = m_Weapons[m_CurrentWeaponIndex]; if (swapToNextWeapon) { m_LastTimeWeaponSwapped = Time.time; } else { m_LastTimeWeaponSwapped = Mathf.NegativeInfinity; } } }
34.748954
130
0.654485
[ "MIT" ]
AkshaySharmaDEV/Gone-Alone
Assets/GameMain/Mobile FPS/Assets/FPS/Scripts/EnemyController.cs
16,612
C#
/* * ****************************************************************************** * Copyright 2014-2017 Spectra Logic Corporation. 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://www.apache.org/licenses/LICENSE-2.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. * **************************************************************************** */ // This code is auto-generated, do not modify using Ds3.Calls; using Ds3.Models; using Ds3.Runtime; using System.Linq; using System.Net; using System.Xml.Linq; namespace Ds3.ResponseParsers { internal class GetDegradedBlobsSpectraS3ResponseParser : IResponseParser<GetDegradedBlobsSpectraS3Request, GetDegradedBlobsSpectraS3Response> { public GetDegradedBlobsSpectraS3Response Parse(GetDegradedBlobsSpectraS3Request request, IWebResponse response) { using (response) { ResponseParseUtilities.HandleStatusCode(response, (HttpStatusCode)200); using (var stream = response.GetResponseStream()) { return new GetDegradedBlobsSpectraS3Response( ModelParsers.ParseDegradedBlobList( XmlExtensions.ReadDocument(stream).ElementOrThrow("Data")), ResponseParseUtilities.ParseIntHeader("page-truncated", response.Headers), ResponseParseUtilities.ParseIntHeader("total-result-count", response.Headers) ); } } } } }
42.108696
145
0.613836
[ "Apache-2.0" ]
RachelTucker/ds3_net_sdk
Ds3/ResponseParsers/GetDegradedBlobsSpectraS3ResponseParser.cs
1,937
C#
// // Copyright (c) Microsoft. 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. // using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using System; namespace Microsoft.WindowsAzure.Build.Tasks { /// <summary> /// A Microsoft Build task that is used for generated a build string to use /// for Microsoft Azure SDK open source builds. /// </summary> public class GetBuildVersionTask : Task { /// <summary> /// Gets or sets a string representing the versioned date string to use /// for a build. /// </summary> [Output] public string Date { get; set; } /// <summary> /// Generate a string representing a build number for the current /// Microsoft Azure open source build. /// </summary> /// <returns>Returns true. Hopefully.</returns> public override bool Execute() { try { // Rooting at 2013 for Microsoft Azure Libraries const int rootYear = 2013; DateTime now = DateTime.Now; Date = (now.Year - rootYear + 1).ToString() + now.ToString("MMdd"); return true; } catch (Exception ex) { Log.LogErrorFromException(ex); return false; } } } }
31.766667
83
0.604407
[ "Apache-2.0" ]
achal3754/azure-sdk-for-net
tools/Microsoft.WindowsAzure.Build.Tasks/GetBuildVersionTask.cs
1,908
C#
using System; using System.Collections.Generic; namespace Sexy.TodLib { internal class ReanimationHolder { public void InitializeHolder() { } public void DisposeHolder() { } public Reanimation AllocReanimation(float theX, float theY, int theRenderOrder, ReanimationType theReanimationType) { Reanimation newReanimation = Reanimation.GetNewReanimation(); newReanimation.mReanimationHolder = this; newReanimation.mRenderOrder = theRenderOrder; newReanimation.ReanimationInitializeType(theX, theY, theReanimationType); newReanimation.mActive = true; this.mReanimations.Add(newReanimation); return newReanimation; } public List<Reanimation> mReanimations = new List<Reanimation>(); } }
21.285714
117
0.757047
[ "MIT" ]
OptiJuegos/Plants-VS-Zombies-NET
DotNETPvZ_Shared/Sexy.TodLib/ReanimationHolder.cs
747
C#
using System; using System.Collections.Generic; using System.Text; using Xunit; using RepeatedWord; namespace CodeChallengeTests { public class RepeatedWordTests { [Fact] public void Test_That_Repeated_Word_Returns_First_Repeated_Word() { string result = Program.FirstRepeatedWord("Once upon a time, there was a brave princess who was brave..."); Assert.Equal("a", result); } [Fact] public void Test_That_Repeated_Word_Returns_Empty_String_When_Input_Has_No_Repeat() { string result = Program.FirstRepeatedWord("People Order Our Patties"); Assert.Equal("", result); } [Fact] public void Test_That_Returns_Null_If_Input_Is_Empty_String() { string result = Program.FirstRepeatedWord(""); Assert.Null(result); } } }
19.902439
113
0.70098
[ "MIT" ]
AGValdes/data-structures-and-algorithms
dotnet/CodeChallenges/CodeChallengeTests/RepeatedWordTests.cs
816
C#
namespace Fancy.Common.Messages { public class Messages { public const string RepositoryInitializingContextError = "An instance of DbContext is required to use this repository."; public const string RequiredInputMessage = "{0} is required!"; public const string ItemCodeRequired = "Item code is required."; public const string ItemTypeRequired = "Item type is required."; public const string ItemCodeInvalidLength = "Item code length must be between 3 and 40."; public const string MainColourTypeRequired = "Colour is required."; public const string MainMaterialTypeRequired = "Material is required."; public const string PriceRequired = "Price is required."; public const string QuantityRequired = "Quantity is required."; public const string ImageRequired = "Image is required."; public const string RequiredDiscount = "Discount is required."; public const string ArgumentNullMessage = "{0} can not be null."; public const string ArgumentOutOfRangeMessage = "{0} is out of range."; public const string ObjectNotFoundInDatabaseMessage = "{0} was not found in the database."; public const string ItemNotUniqueMessage = "Item code {0} is not unique."; } }
51.64
128
0.704105
[ "MIT" ]
Telerik-Fancy/Project
Fancy/Fancy.Common/Messages/Messages.cs
1,293
C#
using System; namespace Stump.DofusProtocol.Enums { [Flags] public enum PartyJoinErrorEnum { PARTY_JOIN_ERROR_UNKNOWN = 0, PARTY_JOIN_ERROR_PLAYER_NOT_FOUND = 1, PARTY_JOIN_ERROR_PARTY_NOT_FOUND = 2, PARTY_JOIN_ERROR_PARTY_FULL = 3, PARTY_JOIN_ERROR_PLAYER_BUSY = 4, PARTY_JOIN_ERROR_PLAYER_ALREADY_INVITED = 6, PARTY_JOIN_ERROR_PLAYER_TOO_SOLLICITED = 7, PARTY_JOIN_ERROR_PLAYER_LOYAL = 8, PARTY_JOIN_ERROR_UNMODIFIABLE = 9, PARTY_JOIN_ERROR_UNMET_CRITERION = 10, PARTY_JOIN_ERROR_NOT_ENOUGH_ROOM = 11, PARTY_JOIN_ERROR_COMPOSITION_CHANGED = 12, PARTY_JOIN_ERROR_PLAYER_IN_TUTORIAL = 13 } }
35.4
52
0.716102
[ "Apache-2.0" ]
Daymortel/Stump
src/Stump.DofusProtocol/Enums/Export/PartyJoinErrorEnum.cs
708
C#
using Crossroads.Models.Profile; using Crossroads.Web.Infrastructure.Mappings; using System; using System.ComponentModel.DataAnnotations; using System.Web.Mvc; namespace Crossroads.Web.ViewModels.ProfileViewModels.Messages { public class AddMessageViewModel { [Required(ErrorMessage = "Заглавието е задължително.")] [StringLength(80, MinimumLength = 3, ErrorMessage = "Заглавието трябва да е от {2} до {1} символа.")] public string Title { get; set; } public int ProfileId { get; set; } public int? AnswerMsgId { get; set; } [AllowHtml] [UIHint("TinyMCE")] [Required(ErrorMessage = "Съдържанието е задължително.")] [StringLength(2000, MinimumLength = 10, ErrorMessage = "Съдържанието трябва да е от {2} до {1} символа.")] public string Content { get; set; } } }
33.038462
114
0.675204
[ "MIT" ]
nevena-angelova/Crossroads
Source/Crossroads.Web/ViewModels/ProfileViewModels/Messages/AddMessageViewModel.cs
971
C#
using System; namespace Daridakr.ProgGuru.Users.Skills { public class ProfSkillDto : CommonSkillDto { /* CreatorId, Name */ public Guid GroupId { get; set; } public string GroupCoverImagePath { get; set; } public int BeginningYear { get; set; } public int EndYear { get; set; } public int KnownledgeLevel { get; set; } } }
19.5
55
0.607692
[ "Apache-2.0" ]
daridakr/ProgGuru
src/Daridakr.ProgGuru.Application.Contracts/Users/Skills/ProfSkillDto.cs
392
C#
using System; using System.Collections.Generic; using CMS.Base.Web.UI; using CMS.Helpers; using System.Text; using System.Web.UI.WebControls; using CMS.Newsletters; using CMS.UIControls; public partial class CMSModules_Newsletters_Controls_GroupSizeSlider : CMSAdminControl { #region "Private variables" private bool mEnabled = true; private readonly string[] GROUP_CSSCLASSES = { "group-size-slider-group-1", "group-size-slider-group-2", "group-size-slider-group-3" }; private const string GROUP_CSSCLASS_DISABLED = "group-disabled"; private List<IssueABVariantItem> mVariants = null; #endregion #region "Properties" /// <summary> /// Gets or sets variants information (names). /// </summary> public List<IssueABVariantItem> Variants { get { if (mVariants == null) { mVariants = new List<IssueABVariantItem>(); mVariants.Add(new IssueABVariantItem(0, String.Empty, false, IssueStatusEnum.Idle)); } return mVariants; } set { mVariants = value; } } /// <summary> /// Gets or sets slider position (in percent). /// </summary> public int CurrentSize { get { if (IsRTL) { return 100 - ValidationHelper.GetInteger(hdnSize.Value, 100); } return ValidationHelper.GetInteger(hdnSize.Value, 0); } set { if (IsRTL) { hdnSize.Value = Convert.ToString(100 - value); } else { hdnSize.Value = value.ToString(); } } } /// <summary> /// Gets or sets number of total subscribers. /// </summary> public int NumberOfSubscribers { get; set; } /// <summary> /// Gets or sets number of subscribers in test group (if set value in CurrentSize is ignored). /// </summary> public int NumberOfTestSubscribers { get; set; } /// <summary> /// Enables/disables control. /// </summary> public bool Enabled { get { return mEnabled; } set { mEnabled = value; } } /// <summary> /// Indicates if slider shows final results. /// </summary> private bool ShowFinalResults { get { return NumberOfTestSubscribers > 0; } } /// <summary> /// Returns TRUE if current culture is RTL culture :-). /// </summary> private bool IsRTL { get { return CultureHelper.IsUICultureRTL(); } } #endregion #region "Methods" /// <summary> /// Reloads control data. /// </summary> /// <param name="forceReload">Indicates if force reload should be used</param> public override void ReloadData(bool forceReload) { InitVariantBoxes(); InitJQuerySlider(); } /// <summary> /// Inits boxes representing variants. /// </summary> private void InitVariantBoxes() { bool isRTL = IsRTL; int count = Variants.Count; int currentPercent = 0; int prevPercent = 0; pnlRes.Controls.Clear(); for (int i = 0; i < count; i++) { currentPercent = (100 * i + 100) / count; Panel pnl = new Panel(); pnl.ID = pnlRes.ClientID + "pnl" + i.ToString(); pnl.CssClass = GROUP_CSSCLASSES[i % GROUP_CSSCLASSES.Length] + (Enabled ? "" : " " + GROUP_CSSCLASS_DISABLED); if (!isRTL && (i == 0)) { pnl.AddCssClass("firstbox"); } else if (isRTL && (i == count - 1)) { pnl.AddCssClass("firstboxrtl"); } else { pnl.AddCssClass("otherbox"); } if (i != count - 1) { pnl.Width = new Unit(String.Format("{0}%", currentPercent - prevPercent)); } else { // Special width for the last box due to strange behaviour of IE pnl.Width = new Unit(String.Format("{0}.99%", Math.Max(currentPercent - prevPercent - 1, 0)), CultureHelper.EnglishCulture); } pnl.ToolTip = HTMLHelper.HTMLEncode(Variants[i].IssueVariantName); pnl.Visible = true; pnlRes.Controls.Add(pnl); prevPercent = currentPercent; } } /// <summary> /// Initializes JQuery slider /// </summary> private void InitJQuerySlider() { ScriptHelper.RegisterJQueryUI(Page); int varCount = Variants.Count; int subscribersCount = NumberOfSubscribers; int minPercent = 0; int subsCount = (subscribersCount <= 0 ? 1 : subscribersCount); if (!ShowFinalResults) { // Get minimal number of percent to set (or maximum under RTL culture) minPercent = (int)Math.Ceiling((double)(100 * varCount) / subsCount); if (minPercent <= 0) { minPercent = 1; } if (minPercent > 100) { minPercent = 100; } if (Enabled && (CurrentSize < minPercent)) { CurrentSize = minPercent; } if (IsRTL) { minPercent = 100 - minPercent; } } else { minPercent = 100 * NumberOfTestSubscribers / subsCount; if (minPercent <= 0) { minPercent = 1; } if (minPercent > 100) { minPercent = 100; } CurrentSize = minPercent; } StringBuilder sb = new StringBuilder(); if (!ShowFinalResults) { // Returns correct number of subscribers for specified slider position sb.Append("function getSubs(perc, varsCount, subsCount) {"); sb.Append(" var subs = (perc / 100) * subsCount;"); sb.Append(" var newSubs = Math.floor(subs / varsCount) * varsCount;"); sb.Append(" return newSubs; }"); sb.AppendLine(); } else { // Returns correct number of subscribers for specified slider position sb.Append("function getSubs(perc, varsCount, subsCount) {"); sb.Append(" return ", NumberOfTestSubscribers, "; }"); sb.AppendLine(); } // Returns TRUE if slide is allowed (i.e. between allowed range) sb.Append("function onSlide_", ClientID, "(newPos) { "); if (IsRTL) { sb.Append(" if (newPos > ", minPercent, ") { "); } else { sb.Append(" if (newPos < ", minPercent, ") { "); } sb.Append(" $cmsj('#", pnlSlider.ClientID, "').slider('option', 'value',", minPercent, ");"); sb.Append(" onChange_", ClientID, @"(", minPercent, ");"); sb.Append(" return false; }"); sb.Append(" return true; "); sb.Append(" }"); sb.AppendLine(); // Resizes variant boxes and updates info message sb.Append("function onChange_", ClientID, @"(newPos) { $cmsj('#", hdnSize.ClientID, "').val(newPos); ", (IsRTL?" newPos=100-newPos;":""), "var neww=newPos; if (neww<10) neww=10; if (neww>90) neww=90; $cmsj('#", pnlRes.ClientID, "').width(newPos + '%'); $cmsj('#", cellSub.ClientID, @"').width(neww + '%');", " var subs=getSubs(newPos, ", varCount, ", ", subscribersCount, "); ", " var msg=", ScriptHelper.GetString(GetString("newsletterissue_send.lbltestgroupsize")), "; $cmsj('#" + lblTestGroup.ClientID + "').text(msg.replace('###', subs).replace('##', newPos)); var msg=", ScriptHelper.GetString(GetString("newsletterissue_send.lbltestgroupremainder")), "; var reminderCount = ", subscribersCount, "-subs; if (reminderCount < 0) { reminderCount = 0; }", "; $cmsj('#", lblRemainder.ClientID, "').text(msg.replace('###', reminderCount).replace('##', 100-newPos)); }"); sb.AppendLine(); int currentSize = CurrentSize; if (IsRTL) { currentSize = 100 - currentSize; } // Initializes slider sb.Append("$cmsj(function() { $cmsj('#", pnlSlider.ClientID, @"').slider( { value: ", currentSize, (!Enabled ? ", disabled: true" : String.Empty), ", slide: function(event, ui) {"); if (Enabled) { sb.Append(" if (onSlide_", ClientID, "(ui.value)) { onChange_", ClientID, "(ui.value); return true; }; return false; "); } sb.Append(" } }) });"); sb.AppendLine(); ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "SliderMethods_" + ClientID, ScriptHelper.GetScript(sb.ToString())); // Updates variants boxes for the first time string script = " onChange_" + ClientID + "(" + currentSize + ");"; ScriptHelper.RegisterStartupScript(this, typeof(string), "InitSlider_" + ClientID, ScriptHelper.GetScript(script)); } #endregion }
30.145631
140
0.529469
[ "MIT" ]
BryanSoltis/KenticoMVCWidgetShowcase
CMS/CMSModules/Newsletters/Controls/GroupSizeSlider.ascx.cs
9,317
C#
using AutoFixture; using AutoFixture.AutoMoq; using AutoFixture.Xunit2; using System; namespace Ploeh.Samples.BookingApi.UnitTests { public class BookingApiTestConventionsAttribute : AutoDataAttribute { public BookingApiTestConventionsAttribute() : base(() => new Fixture().Customize(new AutoMoqCustomization())) { } } }
24.666667
75
0.702703
[ "MIT" ]
benagain/asynchronous-injection
BookingApi.UnitTests/BookingApiTestConventionsAttribute.cs
372
C#
using DGP.Genshin.Models.MiHoYo.Record; using DGP.Genshin.Services; using ModernWpf.Controls; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Windows; namespace DGP.Genshin.Pages { /// <summary> /// RecordPage.xaml 的交互逻辑 /// </summary> public partial class RecordPage : Page { public RecordPage() { if (!RecordAPI.Instance.GetLoginStatus()) { RecordService.Instance.Login(); } this.DataContext = RecordService.Instance; this.InitializeComponent(); } private void LoginButton_Click(object sender, RoutedEventArgs e) => RecordService.Instance.Login(); private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { IEnumerable<string> result = RecordService.Instance.QueryHistory.Where(i => System.String.IsNullOrEmpty(sender.Text) || i.Contains(sender.Text)); sender.ItemsSource = result.Count() == 0 ? new List<string> { "暂无记录" } : result; } } private void AutoSuggestBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args) => sender.Text = (string)args.SelectedItem; private async void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { string uid = args.QueryText; Record record = await RecordAPI.Instance.GetRecordAsync(uid); if (record.Success) { RecordService service = RecordService.Instance; service.CurrentRecord = record; service.SelectedAvatar = record.DetailedAvatars.First(); service.AddQueryHistory(uid); } else { if (record.Message.Length == 0) { await new ContentDialog() { Title = "查询失败", Content = "米游社用户信息可能不完整\n请在米游社登录账号并完善个人信息\n完善后方可查询任意玩家信息", PrimaryButtonText = "确认", DefaultButton = ContentDialogButton.Primary }.ShowAsync(); Process.Start("https://bbs.mihoyo.com/ys/"); } else { await new ContentDialog() { Title = "查询失败", Content = $"UID:{uid}\nMessage:{record.Message}", PrimaryButtonText = "确认", DefaultButton = ContentDialogButton.Primary }.ShowAsync(); } return; } } private void AutoSuggestBox_GotFocus(object sender, RoutedEventArgs e) => ((AutoSuggestBox)sender).Text = RecordService.Instance.CurrentRecord?.UserId; } }
39.025316
161
0.55952
[ "MIT" ]
benx1n/Snap.Genshin
DGP.Genshin/Pages/RecordPage.xaml.cs
3,209
C#
using Aquarius.Weixin.Entity.WeixinMessage; namespace Aquarius.Weixin.Core.Message.Handler { /// <summary> /// 语音消息处理 /// </summary> public interface IVoiceMessageHandler : IMessageHandler<VoiceMessage> { } }
21
73
0.69697
[ "MIT" ]
Weidaicheng/Aquarius.Weixin
src/Aquarius.Weixin/Aquarius.Weixin/Core/Message/Handler/IVoiceMessageHandler.cs
245
C#
namespace BudgetV2.Api.Models { public class RegisterModel { public string Username { get; set; } public string Password { get; set; } public string ConfirmPassword { get; set; } } }
18.5
51
0.608108
[ "MIT" ]
kolev9605/BudgetV2
BudgetV2.Api/Models/RegisterModel.cs
224
C#
using Data; using Microsoft.EntityFrameworkCore; using Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Repositories.GameExtraRepository { public class GameExtraRepository : IGameExtraRepository { private readonly ApplicationDbContext _appDbContext; public GameExtraRepository(ApplicationDbContext appDbContext) { _appDbContext = appDbContext; } public void Add(GameExtra gameextra) { _appDbContext.Entry(gameextra).State = EntityState.Detached; _appDbContext.GameExtras.Add(gameextra); _appDbContext.SaveChanges(); } public ICollection<GameExtra> GetGameExtras(int gameId) => _appDbContext.GameExtras.Include(x => x.Game) .Include(x => x.Extra) .Where(x => x.GameId == gameId).ToList(); } }
35.833333
127
0.587907
[ "MIT" ]
VladislavAngelski/GameProjectUni2
Repositories/GameExtraRepository/GameExtraRepository.cs
1,077
C#
using System; using System.Linq; using Microsoft.EntityFrameworkCore; using Newtonsoft.Json.Linq; using Vidyano.Service.Repository.DataLayer; namespace Vidyano.Service.EntityFrameworkCore.Dto { public class DefaultRepositoryUserStore : BaseRepositoryUserStore<UserDto, GroupDto> { private readonly DefaultRepositoryProvider context; public DefaultRepositoryUserStore(DefaultRepositoryProvider context) { this.context = context; } /// <inheritdoc /> public override IUserDto[] GetUsers() { return context.Users.ToArray<IUserDto>(); } /// <inheritdoc /> public override void AddUser(UserDto user) { context.Users.Add(user); } /// <inheritdoc /> public override IUserDto? GetUser(Guid id) { return context.Users.Find(id); } /// <inheritdoc /> public override void RemoveUser(Guid id) { WithUser(id, u => // TODO: NETCORE: Don't load entity? { context.Users.Remove(u); var userGroups = context.UserGroups.Where(ug => ug.Users_Id == id).ToArray(); context.UserGroups.RemoveRange(userGroups); }); } /// <inheritdoc /> public override bool IsUserMemberOf(Guid userId, Guid groupId) { return context.UserGroups.Any(ug => ug.Users_Id == userId && ug.Groups_Id == groupId); } /// <inheritdoc /> public override void AddUserToGroup(Guid userId, Guid groupId) { context.UserGroups.Add(new UserGroup { Users_Id = userId, Groups_Id = groupId }); // TODO: NETCORE: As SQL? Does not handle duplicates correctly } /// <inheritdoc /> public override void RemoveUserFromGroup(Guid userId, Guid groupId) { context.Database.ExecuteSqlInterpolated(SqlStatements.RemoveUserFromGroup(userId, groupId)); } /// <inheritdoc /> public override Guid[] GetGroupsForUser(Guid userId) { return context.UserGroups.Where(ug => ug.Users_Id == userId).Select(ug => ug.Groups_Id).ToArray(); } /// <inheritdoc /> public override Guid[] GetUsersForGroup(Guid groupId) { return context.UserGroups.Where(ug => ug.Groups_Id == groupId).Select(ug => ug.Users_Id).ToArray(); } /// <inheritdoc /> public override IGroupDto[] GetGroups() { return context.Groups.ToArray<IGroupDto>(); } /// <inheritdoc /> public override void AddGroup(GroupDto group) { context.Groups.Add(group); } /// <inheritdoc /> public override IGroupDto? GetGroup(Guid id) { return context.Groups.Find(id); } /// <inheritdoc /> public override void RemoveGroup(Guid id) { WithGroup(id, g => context.Groups.Remove(g)); // TODO: NETCORE: Without loading? } /// <inheritdoc /> public override void SetUserSettings(Guid id, JObject settings) { var userSetting = context.UserSettings.Find(id); if (userSetting == null) context.UserSettings.Add(userSetting = new UserSettings { Id = id }); userSetting.Settings = settings.ToString(Newtonsoft.Json.Formatting.None); } /// <inheritdoc /> public override (Guid id, JObject settings)[] GetUserSettings() { return context.UserSettings.AsEnumerable().Select(s => (s.Id, JObject.Parse(s.Settings))).ToArray(); } /// <inheritdoc /> public override JObject? GetUserSettings(Guid id) { var userSetting = context.UserSettings.Find(id); return userSetting != null ? JObject.Parse(userSetting.Settings) : null; } /// <inheritdoc /> public override void SetUserProfile(Guid id, JObject profile) { var userProfile = context.UserProfiles.Find(id); if (userProfile == null) context.UserProfiles.Add(userProfile = new UserProfile { Id = id }); userProfile.Profile = profile.ToString(Newtonsoft.Json.Formatting.None); } /// <inheritdoc /> public override JObject? GetUserProfile(Guid id) { var userProfile = context.UserProfiles.Find(id); return userProfile != null ? JObject.Parse(userProfile.Profile) : null; } /// <inheritdoc /> public override void PersistChanges() { context.SaveChanges(); } } }
33.689655
157
0.56172
[ "MIT" ]
2sky/Vidyano.EntityFrameworkCore
Vidyano.SqlServer/EntityFrameworkCore/Dto/DefaultRepositoryUserStore.cs
4,885
C#
// Copyright 2014 Tokarev Mikhail (also known as Deepscorn) // http://www.apache.org/licenses/LICENSE-2.0 using System.Collections.Generic; using UnityEngine; using Utils.Creation; namespace Assets.Main.Sources.Util { public class PersistentGizmos: InGameSingleton<PersistentGizmos> { private readonly HashSet<IGizmo> gizmos = new HashSet<IGizmo>(); public IGizmo AddRaycast(Vector3 from, Vector3 direction) { var result = new RaycastGizmo(from, direction); gizmos.Add(result); return result; } public IGizmo AddSphere(Vector3 center, float radius) { var result = new SphereGizmo(center, radius); gizmos.Add(result); return result; } public void RemoveGizmo(IGizmo gizmo) { gizmos.Remove(gizmo); } private void OnDrawGizmos() { foreach (var gizmo in gizmos) { gizmo.Draw(); } } public interface IGizmo { void Draw(); } private class SphereGizmo : IGizmo { private readonly Vector3 center; private readonly float radius; public SphereGizmo(Vector3 center, float radius) { this.center = center; this.radius = radius; } public void Draw() { Gizmos.DrawSphere(center, radius); } } private class RaycastGizmo : IGizmo { private readonly Vector3 from; private readonly Vector3 direction; private readonly Color color = ColorExt.RandomColor(); public RaycastGizmo(Vector3 from, Vector3 direction) { this.from = from; this.direction = direction; } public void Draw() { var oldColor = Gizmos.color; Gizmos.color = color; Gizmos.DrawRay(from, direction); Gizmos.color = oldColor; } } } }
25.364706
72
0.528293
[ "Apache-2.0" ]
Deepscorn/DeepLabs
Core/Utils/PersistentGizmos.cs
2,156
C#
using System; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading.Tasks; using AutoFixture.NUnit3; using FluentAssertions; using NHSD.BuyingCatalogue.Ordering.Api.UnitTests.AutoFixture; using NHSD.BuyingCatalogue.Ordering.Domain; using NHSD.BuyingCatalogue.Ordering.Persistence.Data; using NUnit.Framework; namespace NHSD.BuyingCatalogue.Ordering.Services.UnitTests { [TestFixture] [Parallelizable(ParallelScope.All)] [SuppressMessage("ReSharper", "NUnit.MethodWithParametersAndTestAttribute", Justification = "False positive")] internal static class SectionStatusServiceTests { [Test] public static void Constructor_NullAccessor_ThrowsArgumentNullException() { Assert.Throws<ArgumentNullException>(() => _ = new SectionStatusService(null)); } [Test] [InMemoryDbAutoData] public static async Task GetOrder_ReturnsNull( CallOffId callOffId, SectionStatusService service) { var result = await service.GetOrder(callOffId); result.Should().BeNull(); } [Test] [InMemoryDbAutoData] public static async Task GetOrder_ReturnsOrder( [Frozen] ApplicationDbContext context, Order order, SectionStatusService service) { context.Order.Add(order); await context.SaveChangesAsync(); var result = await service.GetOrder(order.CallOffId); result.Should().BeEquivalentTo(order); } [Test] [InMemoryDbAutoData] public static void SetSectionStatus_NullOrder_ThrowsException( string sectionId, SectionStatusService service) { Assert.ThrowsAsync<ArgumentNullException>(async () => await service.SetSectionStatus(null, sectionId)); } [Test] [InMemoryDbAutoData] public static void SetSectionStatus_NullSectionId_ThrowsException( Order order, SectionStatusService service) { Assert.ThrowsAsync<ArgumentNullException>(async () => await service.SetSectionStatus(order, null)); } [Test] [InMemoryDbInlineAutoData("additional-services", true, false, false)] [InMemoryDbInlineAutoData("catalogue-solutions", false, true, false)] [InMemoryDbInlineAutoData("associated-services", false, false, true)] public static async Task SetSectionStatus_WithSectionId_UpdatesTheSelectedStatus( string sectionId, bool additionalServicesViewed, bool catalogueSolutionsViewed, bool associatedServicesViewed, Order order, SectionStatusService service) { order.Progress.AdditionalServicesViewed = false; order.Progress.AssociatedServicesViewed = false; order.Progress.CatalogueSolutionsViewed = false; await service.SetSectionStatus(order, sectionId); order.Progress.AdditionalServicesViewed.Should().Be(additionalServicesViewed); order.Progress.AssociatedServicesViewed.Should().Be(associatedServicesViewed); order.Progress.CatalogueSolutionsViewed.Should().Be(catalogueSolutionsViewed); } [Test] [InMemoryDbInlineAutoData("additional-services", true, false, false)] [InMemoryDbInlineAutoData("catalogue-solutions", false, true, false)] [InMemoryDbInlineAutoData("associated-services", false, false, true)] public static async Task SetSectionStatus_WithSectionId_SavesToDb( string sectionId, bool additionalServicesViewed, bool catalogueSolutionsViewed, bool associatedServicesViewed, [Frozen] ApplicationDbContext context, Order order, SectionStatusService service) { context.Order.Add(order); await context.SaveChangesAsync(); order.Progress.AdditionalServicesViewed = false; order.Progress.AssociatedServicesViewed = false; order.Progress.CatalogueSolutionsViewed = false; await service.SetSectionStatus(order, sectionId); var expectedOrder = context.Set<Order>().First(o => o.Equals(order)); expectedOrder.Progress.AdditionalServicesViewed.Should().Be(additionalServicesViewed); expectedOrder.Progress.AssociatedServicesViewed.Should().Be(associatedServicesViewed); expectedOrder.Progress.CatalogueSolutionsViewed.Should().Be(catalogueSolutionsViewed); } } }
38.245902
115
0.671453
[ "MIT" ]
nhs-digital-gp-it-futures/BuyingCatalogueOrdering
tests/NHSD.BuyingCatalogue.Ordering.Services.UnitTests/SectionStatusServiceTests.cs
4,668
C#
using FindoApp.Domain.Model; using FindoApp.Model.interfaces; using FindoApp.Service.Interface; using Prism.Navigation; using Prism.Navigation.TabbedPages; using System; using System.Threading.Tasks; using System.Windows.Input; using Xamarin.Forms; namespace FindoApp.ViewModel { public class LoginMailViewModel : ViewModelBase { private IUser _userapi; private INavigationService _navigationService; private IMessageBoxService _messageBoxService; public string Mail { get; set; } public string Password { get; set; } public ICommand LoginCommand { get; set; } public LoginMailViewModel(INavigationService navigationService, IUser userapi, IMessageBoxService messageBoxService) : base(navigationService) { _userapi = userapi; _navigationService = navigationService; _messageBoxService = messageBoxService; LoginCommand = new Command(async () => await LoginCommandExecute()); } private async Task LoginCommandExecute() { try { var user = await _userapi.Authenticate(Mail, Password); if (user != null) User.AccessToken = user.Token; await _navigationService.SelectTabAsync(nameof(View.CheckListPage)); } catch(Exception ex) { _messageBoxService.ShowAlert("Error", "Login fail. Please try later", "Ok"); Console.WriteLine(ex.Message); await _navigationService.GoBackAsync(); } } } }
31.384615
150
0.632966
[ "MIT" ]
FagnerFun/Findo
FindoApp/FindoApp/FindoApp/ViewModel/LoginMailViewModel.cs
1,634
C#
// <auto-generated> // This file was generated by a tool; you should avoid making direct changes. // Consider using 'partial classes' to extend these types // Input: pose_v.proto // </auto-generated> #region Designer generated code #pragma warning disable CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 namespace cloisim.msgs { [global::ProtoBuf.ProtoContract(Name = @"Pose_V")] public partial class PoseV : global::ProtoBuf.IExtensible { private global::ProtoBuf.IExtension __pbn__extensionData; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) => global::ProtoBuf.Extensible.GetExtensionObject(ref __pbn__extensionData, createIfMissing); [global::ProtoBuf.ProtoMember(1, Name = @"pose")] public global::System.Collections.Generic.List<Pose> Poses { get; } = new global::System.Collections.Generic.List<Pose>(); } } #pragma warning restore CS0612, CS0618, CS1591, CS3021, IDE0079, IDE1006, RCS1036, RCS1057, RCS1085, RCS1192 #endregion
39.142857
130
0.733577
[ "Apache-2.0", "MIT" ]
NamWoo/cloisim
Assets/Scripts/Tools/ProtobufMessages/pose_v.cs
1,096
C#
// Copyright (c) 2019 Lykke Corp. // See the LICENSE file in the project root for more information. using System; using JetBrains.Annotations; using MessagePack; namespace MarginTrading.Backend.Contracts.Workflow.SpecialLiquidation.Commands { /// <summary> /// Quote request for particular instrument and volume. /// </summary> [MessagePackObject] public class GetPriceForSpecialLiquidationCommand { /// <summary> /// Operation Id /// </summary> [Key(0)] public string OperationId { get; set; } /// <summary> /// Command creation time /// </summary> [Key(1)] public DateTime CreationTime { get; set; } /// <summary> /// Instrument /// </summary> [Key(3)] public string Instrument { get; set; } /// <summary> /// Position volume /// </summary> [Key(4)] public decimal Volume { get; set; } /// <summary> /// Streaming number of request. Increases in case when price arrived, but volume has changed. /// </summary> [Key(5)] public int RequestNumber { get; set; } /// <summary> /// Optional. Account Id for the case then we liquidating only positions of a single account. /// </summary> [CanBeNull] [Key(6)] public string AccountId { get; set; } /// <summary> /// Flag that shows whether request comes from CA. /// </summary> [Key(7)] public bool RequestedFromCorporateActions { get; set; } } }
28.050847
103
0.54864
[ "MIT-0" ]
LykkeBusiness/MT
src/MarginTrading.Backend.Contracts/Workflow/SpecialLiquidation/Commands/GetPriceForSpecialLiquidationCommand.cs
1,655
C#
using System.Collections.Generic; using System.Threading.Tasks; namespace NetPOC.Backend.Domain.Interfaces.IRepositories { public interface ICrudRepository<T> where T : class { /// <summary> /// Serviço de coleta de todos os objetos do tipo indicado /// </summary> /// <returns>Lista de objetos do tipo indicado</returns> Task<IEnumerable<T>> GetAll(); /// <summary> /// Serviço de coleta de objeto do tipo indicado por ID /// </summary> /// <param name="id">ID do objeto a ser coletado</param> /// <returns>Objeto do tipo indicado</returns> Task<T> GetById(object id); /// <summary> /// Serviço de inserção de objeto do tipo indicado /// </summary> /// <param name="obj">Objeto do tipo indicado a ser inserido</param> Task Insert(T obj); /// <summary> /// Serviço de atualização de objeto do tipo indicado /// </summary> /// <param name="obj">Objeto do tipo indicado a ser atualizado</param> void Update(T obj); /// <summary> /// Serviço de exclusão de objeto do tipo indicado de acordo com seu ID /// </summary> /// <param name="obj">Objeto do tipo indicado a ser excluído</param> void Delete(T obj); /// <summary> /// Serviço de comprometimento de transações do repositório /// </summary> Task Save(); } }
34.25
79
0.569343
[ "MIT" ]
MrDanCoelho/NetPOC-Backend
NetPOC.Backend.Domain/Interfaces/IRepositories/ICrudRepository.cs
1,524
C#
using System.Collections; using System.Collections.Generic; using Gamekit2D; using UnityEngine; using UnityEngine.Profiling; #if UNITY_EDITOR using UnityEditor; #endif namespace Gamekit2D { [ExecuteInEditMode] [RequireComponent(typeof(MeshRenderer))] [RequireComponent(typeof(MeshFilter))] [RequireComponent(typeof(BoxCollider2D))] public class WaterArea : MonoBehaviour { protected struct WaterColumn { public float currentHeight; public float baseHeight; public float velocity; public float xPosition; public int vertexIndex; } const float NEIGHBOUR_TRANSFER = 0.001f; public int pointPerUnits = 5; public Vector2 offset; public Vector2 size = new Vector2(6f, 2f); public int sortingLayerID; public int sortingLayerOrder = 3; public float dampening = 0.93f; public float tension = 0.025f; public float neighbourTransfer = 0.03f; public RandomAudioPlayer splashPlayerPrefab; public BoxCollider2D boxCollider2D { get { return m_BoxCollider; } } protected MeshRenderer m_Renderer; protected MeshFilter m_Filter; protected Mesh m_Mesh; protected BoxCollider2D m_BoxCollider; protected Damager m_Damager; protected ParticleSystem m_Bubbles; protected ParticleSystem m_Steam; protected BuoyancyEffector2D m_BuoyancyEffector; protected WaterColumn[] m_Columns; protected float m_Width; protected Vector2 m_LowerCorner; protected RandomAudioPlayer[] m_SplashSourcePool; protected int m_CurrentSplashPlayer = 0; readonly int m_SplashPlayerPoolSize = 5; protected Vector3[] meshVertices; private void OnEnable() { GetReferences(); m_BoxCollider.isTrigger = true; #if UNITY_EDITOR if (Application.isPlaying) { //we don't want to do it in editor when not playing as it would leak object #endif if (splashPlayerPrefab != null) { m_SplashSourcePool = new RandomAudioPlayer[m_SplashPlayerPoolSize]; for (int i = 0; i < m_SplashPlayerPoolSize; ++i) { m_SplashSourcePool[i] = Instantiate(splashPlayerPrefab); m_SplashSourcePool[i].transform.SetParent(transform); m_SplashSourcePool[i].gameObject.SetActive(false); } } #if UNITY_EDITOR } #endif AdjustComponentSizes(); RecomputeMesh(); SetSortingLayer(); m_Bubbles.Play(); m_Steam.Play(); meshVertices = m_Mesh.vertices; } public void GetReferences() { m_Renderer = GetComponent<MeshRenderer>(); m_Filter = GetComponent<MeshFilter>(); m_BoxCollider = GetComponent<BoxCollider2D>(); m_Damager = GetComponent<Damager>(); m_Bubbles = transform.Find("Bubbles").GetComponent<ParticleSystem>(); m_Steam = transform.Find("Steam").GetComponent<ParticleSystem>(); m_BuoyancyEffector = GetComponent<BuoyancyEffector2D>(); } // Update is called once per frame void Update() { for (int i = 0; i < m_Columns.Length; ++i) { //float ratio = ((float)i) / m_columns.Length; float leftDelta = 0; if (i > 0) leftDelta = neighbourTransfer * (m_Columns[i - 1].currentHeight - m_Columns[i].currentHeight); float rightDelta = 0; if (i < m_Columns.Length - 1) rightDelta = neighbourTransfer * (m_Columns[i + 1].currentHeight - m_Columns[i].currentHeight); float force = leftDelta; force += rightDelta; force += tension * (m_Columns[i].baseHeight - m_Columns[i].currentHeight); m_Columns[i].velocity = dampening * m_Columns[i].velocity + force; m_Columns[i].currentHeight += m_Columns[i].velocity; } for (int i = 0; i < m_Columns.Length; ++i) { meshVertices[m_Columns[i].vertexIndex].y = m_Columns[i].currentHeight; } m_Mesh.vertices = meshVertices; m_Mesh.UploadMeshData(false); } public void AdjustComponentSizes() { ParticleSystem.ShapeModule steamShape = m_Steam.shape; steamShape.radius = size.x * 0.5f; Vector3 steamLocalPosition = m_Steam.transform.localPosition; steamLocalPosition = offset + Vector2.up * size.y * 0.5f; m_Steam.transform.localPosition = steamLocalPosition; ParticleSystem.ShapeModule bubblesShape = m_Bubbles.shape; bubblesShape.radius = size.x * 0.5f; Vector3 bubblesLocalPosition = m_Bubbles.transform.localPosition; bubblesLocalPosition = offset + Vector2.down * size.y * 0.5f; m_Bubbles.transform.localPosition = bubblesLocalPosition; m_Steam.Simulate(0.1f); m_Bubbles.Simulate(0.1f); m_Damager.size = size; m_Damager.offset = offset; m_BoxCollider.size = size; m_BoxCollider.offset = offset; m_BuoyancyEffector.surfaceLevel = size.y * 0.5f - 0.84f; } public void RecomputeMesh() { //we recreate the mesh as we the previous one could come from prefab (and so every object would the same when they each need there...) //ref countign should take care of leaking, (and if it's a prefabed mesh, the prefab keep its mesh) m_Mesh = new Mesh(); m_Mesh.name = "WaterMesh"; m_Filter.sharedMesh = m_Mesh; m_LowerCorner = -(size * 0.5f - offset); m_Width = size.x; int count = Mathf.CeilToInt(size.x * (pointPerUnits - 1)) + 1; m_Columns = new WaterColumn[count + 1]; float step = size.x / count; Vector3[] pts = new Vector3[(count + 1) * 2]; Vector3[] normal = new Vector3[(count + 1) * 2]; Vector2[] uvs = new Vector2[(count + 1) * 2]; Vector2[] uvs2 = new Vector2[(count + 1) * 2]; int[] indices = new int[6 * count]; for (int i = 0; i <= count; ++i) { pts[i * 2 + 0].Set(m_LowerCorner.x + step * i, m_LowerCorner.y, 0); pts[i * 2 + 1].Set(m_LowerCorner.x + step * i, m_LowerCorner.y + size.y, 0); normal[i * 2 + 0].Set(0, 0, 1); normal[i * 2 + 1].Set(0, 0, 1); uvs[i * 2 + 0].Set(((float) i) / count, 0); uvs[i * 2 + 1].Set(((float) i) / count, 1); //Set the 2nd uv set to local position, allow for coherent tiling of normal map uvs2[i * 2 + 0].Set(pts[i * 2 + 0].x, pts[i * 2 + 0].y); uvs2[i * 2 + 1].Set(pts[i * 2 + 1].x, pts[i * 2 + 1].y); if (i > 0) { int arrayIdx = (i - 1) * 6; int startingIdx = (i - 1) * 2; indices[arrayIdx + 0] = startingIdx; indices[arrayIdx + 1] = startingIdx + 1; indices[arrayIdx + 2] = startingIdx + 3; indices[arrayIdx + 3] = startingIdx; indices[arrayIdx + 4] = startingIdx + 3; indices[arrayIdx + 5] = startingIdx + 2; } m_Columns[i] = new WaterColumn(); m_Columns[i].xPosition = pts[i * 2].x; m_Columns[i].baseHeight = pts[i * 2 + 1].y; m_Columns[i].velocity = 0; m_Columns[i].vertexIndex = i * 2 + 1; m_Columns[i].currentHeight = m_Columns[i].baseHeight; } m_Mesh.Clear(); m_Mesh.vertices = pts; m_Mesh.normals = normal; m_Mesh.uv = uvs; m_Mesh.uv2 = uvs2; m_Mesh.triangles = indices; meshVertices = m_Mesh.vertices; m_Mesh.UploadMeshData(false); } public void SetSortingLayer() { m_Renderer.sortingLayerID = sortingLayerID; m_Renderer.sortingOrder = sortingLayerOrder; } private void PlaySplash(Vector3 position) { #if UNITY_EDITOR if (!Application.isPlaying) return; #endif if (splashPlayerPrefab == null) return; //the splash prefab wasn't set, we don't have any instance of it to play sound int use = m_CurrentSplashPlayer; m_CurrentSplashPlayer = (m_CurrentSplashPlayer + 1) % m_SplashPlayerPoolSize; m_SplashSourcePool[use].transform.position = position; //disable/enable to force the effect to m_SplashSourcePool[use].gameObject.SetActive(false); m_SplashSourcePool[use].gameObject.SetActive(true); m_SplashSourcePool[use].PlayRandomSound(); } private void OnTriggerEnter2D(Collider2D collision) { Rigidbody2D rb = collision.GetComponent<Rigidbody2D>(); if (rb == null || rb.bodyType == RigidbodyType2D.Static) return; //we don't care about static rigidbody, they can't "fall" in water Bounds bounds = collision.bounds; List<int> touchedColumnIndices = new List<int>(); float divisionWith = m_Width / m_Columns.Length; Vector3 localMin = transform.InverseTransformPoint(bounds.min); Vector3 localMax = transform.InverseTransformPoint(bounds.max); // find all our springs within the bounds var xMin = localMin.x; var xMax = localMax.x; PlaySplash(new Vector3(bounds.min.x + bounds.extents.x, bounds.min.y, bounds.min.z)); for (var i = 0; i < m_Columns.Length; i++) { if (m_Columns[i].xPosition > xMin && m_Columns[i].xPosition < xMax) touchedColumnIndices.Add(i); } // if we have no hits we should loop back through and find the 2 closest verts and use them if (touchedColumnIndices.Count == 0) { for (var i = 0; i < m_Columns.Length; i++) { // widen our search to included divisitionWidth padding on each side so we definitely get a couple hits if (m_Columns[i].xPosition + divisionWith > xMin && m_Columns[i].xPosition - divisionWith < xMax) touchedColumnIndices.Add(i); } } float testForce = 0.2f; for (int i = 0; i < touchedColumnIndices.Count; ++i) { int idx = touchedColumnIndices[i]; m_Columns[idx].velocity -= testForce; } } } #if UNITY_EDITOR [CustomEditor(typeof(WaterArea))] public class WaterAreaEditor : Editor { protected WaterArea m_WaterArea; protected Vector2 m_PrevSize; protected Vector2 m_PrevOffset; protected SerializedProperty m_OffsetProp; protected SerializedProperty m_SizeProp; protected SerializedProperty m_SortingLayerProp; protected SerializedProperty m_SortingLayerOrderProp; protected SerializedProperty m_SplashPlayerPrefabProp; protected string[] m_SortingLayers; protected int m_CurrentLayer; private void OnEnable() { m_WaterArea = target as WaterArea; m_WaterArea.GetReferences(); //needed for when you edit prefab directly, onEnable won't be called on it m_PrevSize = m_WaterArea.boxCollider2D.size; m_PrevOffset = m_WaterArea.boxCollider2D.offset; m_CurrentLayer = -1; int defaultLayer = 0; SortingLayer[] layers = SortingLayer.layers; m_SortingLayers = new string[layers.Length]; for (int i = 0; i < layers.Length; ++i) { m_SortingLayers[i] = layers[i].name; if (layers[i].id == m_WaterArea.sortingLayerID) m_CurrentLayer = i; if (layers[i].name == "Default") defaultLayer = i; } if (m_CurrentLayer == -1) { m_WaterArea.sortingLayerID = SortingLayer.NameToID("Default"); m_CurrentLayer = defaultLayer; } m_OffsetProp = serializedObject.FindProperty("offset"); m_SizeProp = serializedObject.FindProperty("size"); m_SortingLayerProp = serializedObject.FindProperty("sortingLayer"); m_SortingLayerOrderProp = serializedObject.FindProperty("sortingLayerOrder"); m_SplashPlayerPrefabProp = serializedObject.FindProperty("splashPlayerPrefab"); } public override void OnInspectorGUI() { serializedObject.Update(); EditorGUI.BeginChangeCheck(); m_WaterArea.pointPerUnits = EditorGUILayout.DelayedIntField("Point per unit", m_WaterArea.pointPerUnits); EditorGUI.BeginChangeCheck(); Vector2 newOffsetValue = EditorGUILayout.Vector2Field("Offset", m_OffsetProp.vector2Value); if (newOffsetValue.x > 0f && newOffsetValue.y > 0f) m_OffsetProp.vector2Value = newOffsetValue; Vector2 newSizeValue = EditorGUILayout.Vector2Field("Size", m_SizeProp.vector2Value); if (newSizeValue.x > 0f && newSizeValue.y > 0f) m_SizeProp.vector2Value = newSizeValue; if (EditorGUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); m_WaterArea.AdjustComponentSizes(); m_WaterArea.RecomputeMesh(); EditorUtility.SetDirty(target); } m_WaterArea.dampening = EditorGUILayout.FloatField("Dampening", m_WaterArea.dampening); m_WaterArea.tension = EditorGUILayout.FloatField("Tension", m_WaterArea.tension); m_WaterArea.neighbourTransfer = EditorGUILayout.FloatField("Neighbour Transfer", m_WaterArea.neighbourTransfer); if (EditorGUI.EndChangeCheck() || (m_WaterArea.boxCollider2D != null && (m_PrevSize != m_WaterArea.boxCollider2D.size || m_PrevOffset != m_WaterArea.boxCollider2D.offset))) { m_WaterArea.RecomputeMesh(); EditorUtility.SetDirty(target); } EditorGUI.BeginChangeCheck(); int sortLayer = EditorGUILayout.Popup("Sorting Layer", m_CurrentLayer, m_SortingLayers); if (sortLayer != m_CurrentLayer) { m_WaterArea.sortingLayerID = SortingLayer.NameToID(m_SortingLayers[sortLayer]); m_CurrentLayer = sortLayer; } EditorGUILayout.PropertyField(m_SortingLayerOrderProp); if (EditorGUI.EndChangeCheck()) { m_WaterArea.SetSortingLayer(); EditorUtility.SetDirty(target); } EditorGUILayout.PropertyField(m_SplashPlayerPrefabProp); serializedObject.ApplyModifiedProperties(); m_PrevSize = m_WaterArea.boxCollider2D.size; m_PrevOffset = m_WaterArea.boxCollider2D.offset; } } #endif }
37.308219
147
0.554189
[ "Apache-2.0" ]
an-garcia/GameKit2D
Assets/2DGamekit/Scripts/Effect/WaterArea.cs
16,343
C#
/* * tweak-api * * Tweak API to integrate with all the Tweak services. You can find out more about Tweak at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak. * * OpenAPI spec version: 1.0.8-beta.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Linq; using System.IO; using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace TweakApi.Model { /// <summary> /// Axes /// </summary> [DataContract] public partial class Axes : IEquatable<Axes> { /// <summary> /// Initializes a new instance of the <see cref="Axes" /> class. /// </summary> [JsonConstructorAttribute] protected Axes() { } /// <summary> /// Initializes a new instance of the <see cref="Axes" /> class. /// </summary> /// <param name="X">X (required) (default to 0.0).</param> /// <param name="Y">Y (required) (default to 0.0).</param> /// <param name="Id">Id.</param> public Axes(double? X = null, double? Y = null, string Id = null) { // to ensure "X" is required (not null) if (X == null) { throw new InvalidDataException("X is a required property for Axes and cannot be null"); } else { this.X = X; } // to ensure "Y" is required (not null) if (Y == null) { throw new InvalidDataException("Y is a required property for Axes and cannot be null"); } else { this.Y = Y; } this.Id = Id; } /// <summary> /// Gets or Sets X /// </summary> [DataMember(Name="x", EmitDefaultValue=false)] public double? X { get; set; } /// <summary> /// Gets or Sets Y /// </summary> [DataMember(Name="y", EmitDefaultValue=false)] public double? Y { get; set; } /// <summary> /// Gets or Sets Id /// </summary> [DataMember(Name="id", EmitDefaultValue=false)] public string Id { get; set; } /// <summary> /// Returns the string presentation of the object /// </summary> /// <returns>String presentation of the object</returns> public override string ToString() { var sb = new StringBuilder(); sb.Append("class Axes {\n"); sb.Append(" X: ").Append(X).Append("\n"); sb.Append(" Y: ").Append(Y).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// <summary> /// Returns the JSON string presentation of the object /// </summary> /// <returns>JSON string presentation of the object</returns> public string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } /// <summary> /// Returns true if objects are equal /// </summary> /// <param name="obj">Object to be compared</param> /// <returns>Boolean</returns> public override bool Equals(object obj) { // credit: http://stackoverflow.com/a/10454552/677735 return this.Equals(obj as Axes); } /// <summary> /// Returns true if Axes instances are equal /// </summary> /// <param name="other">Instance of Axes to be compared</param> /// <returns>Boolean</returns> public bool Equals(Axes other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) return false; return ( this.X == other.X || this.X != null && this.X.Equals(other.X) ) && ( this.Y == other.Y || this.Y != null && this.Y.Equals(other.Y) ) && ( this.Id == other.Id || this.Id != null && this.Id.Equals(other.Id) ); } /// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = 41; // Suitable nullity checks etc, of course :) if (this.X != null) hash = hash * 59 + this.X.GetHashCode(); if (this.Y != null) hash = hash * 59 + this.Y.GetHashCode(); if (this.Id != null) hash = hash * 59 + this.Id.GetHashCode(); return hash; } } } }
32.702247
164
0.507129
[ "Apache-2.0" ]
tweak-com-public/tweak-api-client-csharp
src/TweakApi/Model/Axes.cs
5,821
C#
using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using System.Runtime.Serialization.Json; using System.Text; using NsqSharp.Utils; namespace NsqSharp.Core { // https://github.com/nsqio/go-nsq/blob/master/command.go /// <summary> /// Command represents a command from a client to an NSQ daemon /// </summary> public class Command { private static readonly BigEndian _bigEndian = Binary.BigEndian; private static readonly byte[] IDENTIFY_BYTES = Encoding.UTF8.GetBytes("IDENTIFY"); private static readonly byte[] AUTH_BYTES = Encoding.UTF8.GetBytes("AUTH"); private static readonly byte[] REGISTER_BYTES = Encoding.UTF8.GetBytes("REGISTER"); private static readonly byte[] UNREGISTER_BYTES = Encoding.UTF8.GetBytes("UNREGISTER"); private static readonly byte[] PING_BYTES = Encoding.UTF8.GetBytes("PING"); private static readonly byte[] PUB_BYTES = Encoding.UTF8.GetBytes("PUB"); //private static readonly byte[] DPUB_BYTES = Encoding.UTF8.GetBytes("DPUB"); // TODO private static readonly byte[] MPUB_BYTES = Encoding.UTF8.GetBytes("MPUB"); private static readonly byte[] SUB_BYTES = Encoding.UTF8.GetBytes("SUB"); private static readonly byte[] RDY_BYTES = Encoding.UTF8.GetBytes("RDY"); private static readonly byte[] FIN_BYTES = Encoding.UTF8.GetBytes("FIN"); private static readonly byte[] REQ_BYTES = Encoding.UTF8.GetBytes("REQ"); private static readonly byte[] TOUCH_BYTES = Encoding.UTF8.GetBytes("TOUCH"); private static readonly byte[] CLS_BYTES = Encoding.UTF8.GetBytes("CLS"); private static readonly byte[] NOP_BYTES = Encoding.UTF8.GetBytes("NOP"); private const byte byteSpace = (byte)' '; private const byte byteNewLine = (byte)'\n'; /// <summary>Name</summary> public byte[] Name { get; set; } /// <summary>Params</summary> public ICollection<byte[]> Params { get; set; } /// <summary>Body</summary> public byte[] Body { get; set; } /// <summary> /// Initializes a new instance of the <see cref="Command" /> class. /// </summary> public Command(byte[] name, string body, params string[] parameters) : this(name, body == null ? null : Encoding.UTF8.GetBytes(body), parameters) { } /// <summary> /// Initializes a new instance of the <see cref="Command" /> class. /// </summary> public Command(byte[] name, byte[] body, params string[] parameters) { Name = name; Body = body; if (parameters != null) { Params = new List<byte[]>(parameters.Length); foreach (var param in parameters) { Params.Add(Encoding.UTF8.GetBytes(param)); } } } /// <summary> /// Initializes a new instance of the <see cref="Command" /> class. /// </summary> public Command(byte[] name, byte[] body, ICollection<byte[]> parameters) { Name = name; Body = body; Params = parameters; } /// <summary>String returns the name and parameters of the Command</summary> public override string ToString() { string name = Encoding.UTF8.GetString(Name); if (Params != null && Params.Count > 0) { var paramsStrings = Params.Select(p => Encoding.UTF8.GetString(p)).ToArray(); return string.Format("{0} {1}", name, string.Join(" ", paramsStrings)); } return name; } internal int GetByteCount() { int size = Name.Length + 1 + (Body == null ? 0 : Body.Length + 4); if (Params != null) { foreach (var param in Params) { size += param.Length + 1; } } return size; } /// <summary> /// WriteTo implements the WriterTo interface and /// serializes the Command to the supplied Writer. /// /// It is suggested that the target Writer is buffered /// to avoid performing many system calls. /// </summary> public long WriteTo(IWriter w) { var buf = new byte[GetByteCount()]; return WriteTo(w, buf); } /// <summary> /// WriteTo implements the WriterTo interface and /// serializes the Command to the supplied Writer. /// /// It is suggested that the target Writer is buffered /// to avoid performing many system calls. /// </summary> internal long WriteTo(IWriter w, byte[] buf) { int j = 0; int count = Name.Length; Buffer.BlockCopy(Name, 0, buf, j, count); j += count; if (Params != null) { foreach (var param in Params) { buf[j++] = byteSpace; count = param.Length; Buffer.BlockCopy(param, 0, buf, j, count); j += count; } } buf[j++] = byteNewLine; if (Body != null) { _bigEndian.PutUint32(buf, Body.Length, j); j += 4; count = Body.Length; Buffer.BlockCopy(Body, 0, buf, j, count); j += count; } return w.Write(buf, 0, j); } /// <summary> /// Identify creates a new Command to provide information about the client. After connecting, /// it is generally the first message sent. /// /// The supplied map is marshaled into JSON to provide some flexibility /// for this command to evolve over time. /// /// See http://nsq.io/clients/tcp_protocol_spec.html#identify for information /// on the supported options /// </summary> public static Command Identify(IdentifyRequest request) { byte[] body; var serializer = new DataContractJsonSerializer(typeof(IdentifyRequest)); using (var memoryStream = new MemoryStream()) { serializer.WriteObject(memoryStream, request); body = memoryStream.ToArray(); } return new Command(IDENTIFY_BYTES, body); } /// <summary> /// Auth sends credentials for authentication /// /// After `Identify`, this is usually the first message sent, if auth is used. /// </summary> public static Command Auth(string secret) { return new Command(AUTH_BYTES, secret); } /// <summary> /// Register creates a new Command to add a topic/channel for the connected nsqd /// </summary> public static Command Register(string topic, string channel) { return new Command(REGISTER_BYTES, (byte[])null, topic, channel); } /// <summary> /// UnRegister creates a new Command to remove a topic/channel for the connected nsqd /// </summary> public static Command UnRegister(string topic, string channel) { return new Command(UNREGISTER_BYTES, (byte[])null, topic, channel); } /// <summary> /// Ping creates a new Command to keep-alive the state of all the /// announced topic/channels for a given client /// </summary> public static Command Ping() { return new Command(PING_BYTES, (byte[])null); } /// <summary> /// Publish creates a new Command to write a message to a given topic /// </summary> public static Command Publish(string topic, byte[] body) { return new Command(PUB_BYTES, body, topic); } /// <summary> /// MultiPublish creates a new Command to write more than one message to a given topic. /// This is useful for high-throughput situations to avoid roundtrips and saturate the pipe. /// </summary> [SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")] public static Command MultiPublish(string topic, IEnumerable<byte[]> bodies) { if (bodies == null) throw new ArgumentNullException("bodies"); var bodiesCollection = bodies as ICollection<byte[]> ?? bodies.ToList(); int num = bodiesCollection.Count; byte[] body; using (var memoryStream = new MemoryStream()) { using (var binaryWriter = new BinaryWriter(memoryStream)) { Binary.BigEndian.PutUint32(binaryWriter, num); foreach (var b in bodiesCollection) { Binary.BigEndian.PutUint32(binaryWriter, b.Length); binaryWriter.Write(b); } } body = memoryStream.ToArray(); } return new Command(MPUB_BYTES, body, topic); } /// <summary> /// Subscribe creates a new Command to subscribe to the given topic/channel /// </summary> public static Command Subscribe(string topic, string channel) { return new Command(SUB_BYTES, (byte[])null, topic, channel); } /// <summary> /// Ready creates a new Command to specify /// the number of messages a client is willing to receive /// </summary> public static Command Ready(long count) { return new Command(RDY_BYTES, (byte[])null, count.ToString(CultureInfo.InvariantCulture)); } /// <summary> /// Finish creates a new Command to indiciate that /// a given message (by id) has been processed successfully /// </summary> public static Command Finish(byte[] id) { if (id == null) throw new ArgumentNullException("id"); if (id.Length != Message.MsgIdLength) throw new ArgumentOutOfRangeException("id", id.Length, string.Format("id length must be {0} bytes", Message.MsgIdLength)); return new Command(FIN_BYTES, null, new List<byte[]> { id }); } /// <summary> /// Requeue creates a new Command to indicate that /// a given message (by id) should be requeued after the given delay /// NOTE: a delay of 0 indicates immediate requeue /// </summary> public static Command Requeue(byte[] id, TimeSpan delay) { if (id == null) throw new ArgumentNullException("id"); if (id.Length != Message.MsgIdLength) throw new ArgumentOutOfRangeException("id", id.Length, string.Format("id length must be {0} bytes", Message.MsgIdLength)); int delayMilliseconds = (int)delay.TotalMilliseconds; var parameters = new List<byte[]>(); parameters.Add(id); parameters.Add(Encoding.UTF8.GetBytes(delayMilliseconds.ToString(CultureInfo.InvariantCulture))); return new Command(REQ_BYTES, null, parameters); } /// <summary> /// Touch creates a new Command to reset the timeout for /// a given message (by id) /// </summary> public static Command Touch(byte[] id) { if (id == null) throw new ArgumentNullException("id"); if (id.Length != Message.MsgIdLength) throw new ArgumentOutOfRangeException("id", id.Length, string.Format("id length must be {0} bytes", Message.MsgIdLength)); return new Command(TOUCH_BYTES, null, new List<byte[]> { id }); } /// <summary> /// StartClose creates a new Command to indicate that the /// client would like to start a close cycle. nsqd will no longer /// send messages to a client in this state and the client is expected /// finish pending messages and close the connection /// </summary> public static Command StartClose() { return new Command(CLS_BYTES, (byte[])null); } /// <summary> /// Nop creates a new Command that has no effect server side. /// Commonly used to respond to heartbeats /// </summary> public static Command Nop() { return new Command(NOP_BYTES, (byte[])null); } } }
36.35493
138
0.558113
[ "MIT" ]
Misiu/NsqSharp
NsqSharp/Core/Command.cs
12,908
C#
/* * tilia Phoenix API * * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: 7.0.6 * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ using NUnit.Framework; using System; using System.Linq; using System.IO; using System.Collections.Generic; using TiliaLabs.Phoenix.Api; using TiliaLabs.Phoenix.Model; using TiliaLabs.Phoenix.Client; using System.Reflection; using Newtonsoft.Json; namespace TiliaLabs.Phoenix.Test { /// <summary> /// Class for testing WfopCosting /// </summary> /// <remarks> /// This file is automatically generated by Swagger Codegen. /// Please update the test case below to test the model. /// </remarks> [TestFixture] public class WfopCostingTests { // TODO uncomment below to declare an instance variable for WfopCosting //private WfopCosting instance; /// <summary> /// Setup before each test /// </summary> [SetUp] public void Init() { // TODO uncomment below to create an instance of WfopCosting //instance = new WfopCosting(); } /// <summary> /// Clean up after each test /// </summary> [TearDown] public void Cleanup() { } /// <summary> /// Test an instance of WfopCosting /// </summary> [Test] public void WfopCostingInstanceTest() { // TODO uncomment below to test "IsInstanceOfType" WfopCosting //Assert.IsInstanceOfType<WfopCosting> (instance, "variable 'instance' is a WfopCosting"); } /// <summary> /// Test the property 'Currency' /// </summary> [Test] public void CurrencyTest() { // TODO unit test for the property 'Currency' } /// <summary> /// Test the property 'Rate' /// </summary> [Test] public void RateTest() { // TODO unit test for the property 'Rate' } /// <summary> /// Test the property 'Setup' /// </summary> [Test] public void SetupTest() { // TODO unit test for the property 'Setup' } /// <summary> /// Test the property 'RunningWaste' /// </summary> [Test] public void RunningWasteTest() { // TODO unit test for the property 'RunningWaste' } /// <summary> /// Test the property 'MinimumCostPerLayout' /// </summary> [Test] public void MinimumCostPerLayoutTest() { // TODO unit test for the property 'MinimumCostPerLayout' } /// <summary> /// Test the property 'SetupPerColor' /// </summary> [Test] public void SetupPerColorTest() { // TODO unit test for the property 'SetupPerColor' } /// <summary> /// Test the property 'RunLengthRange' /// </summary> [Test] public void RunLengthRangeTest() { // TODO unit test for the property 'RunLengthRange' } /// <summary> /// Test the property 'Type' /// </summary> [Test] public void TypeTest() { // TODO unit test for the property 'Type' } } }
25.588235
104
0.539655
[ "Apache-2.0" ]
matthewkayy/tilia-phoenix-client-csharp
src/TiliaLabs.Phoenix.Test/Model/WfopCostingTests.cs
3,480
C#
using VA = VisioAutomation; using System.Collections.Generic; using System.Linq; using IVisio = Microsoft.Office.Interop.Visio; namespace VisioAutomation.ShapeSheet.Query { public partial class CellQuery { public class SectionQueryInfo { public SectionQuery SectionQuery { get; private set; } public short ShapeID { get; private set; } public int RowCount { get; private set; } internal SectionQueryInfo(SectionQuery sq, short shapeid, int numrows) { this.SectionQuery = sq; this.ShapeID = shapeid; this.RowCount = numrows; } public IEnumerable<int> RowIndexes { get { return Enumerable.Range(0, this.RowCount); } } } } }
28.172414
81
0.591187
[ "MIT" ]
saveenr/VisioAutomation2007
VisioAutomation_2007/VisioAutomation/ShapeSheet/Query/CellQuery_SectionQueryInfo.cs
819
C#
using System.Collections.Generic; using System.Reflection; using System; namespace SemanticComparison.Fluent.Members { internal class MemberEqualityComparer<T> : IMemberComparer { readonly PropertyInfo propertyInfo; readonly IEqualityComparer<T> equality; public MemberEqualityComparer(PropertyInfo propertyInfo, IEqualityComparer<T> equality) { this.propertyInfo = propertyInfo; this.equality = equality; } #region IMemberComparer public new bool Equals(object x, object y) { if (x is T tx && y is T ty) { return this.equality.Equals(tx, ty); } return false; } public int GetHashCode(object obj) { if (obj is T t) { return this.equality.GetHashCode(t); } return 0; } public bool IsSatisfiedBy(PropertyInfo request) { return BaseComparer.IsSatisfiedBy(expected: this.propertyInfo, actual: request); } public bool IsSatisfiedBy(FieldInfo request) { return false; } #endregion } }
18.711538
89
0.714286
[ "Apache-2.0" ]
lucadecamillis/semantic-comparison-fluent
src/SemanticComparison.Fluent/Members/MemberEqualityComparer.cs
973
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; using System.Threading; using System.ComponentModel.Design; using System.Drawing.Drawing2D; /* Copyright (c) 2008,2009 DI Zimmermann Stephan (stefan.zimmermann@tele2.at) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ namespace RepetierHost.GraphLib { public partial class PlotterDisplayEx : UserControl { #region MEMBERS delegate void InvokeVoidFuncDelegate(); PlotterGraphSelectCurvesForm GraphPropertiesForm = null; PrintPreviewForm printPreviewForm = null; private PrecisionTimer.Timer mTimer = null; private float play_speed = 0.5f; private float play_speed_max = 10f; private float play_speed_min = 0.5f; private bool paused = false; private bool isRunning = false; #endregion #region CONSTRUCTOR public PlotterDisplayEx() { InitializeComponent(); mTimer = new PrecisionTimer.Timer(); mTimer.Period = 50; // 20 fps mTimer.Tick += new EventHandler(OnTimerTick); play_speed = 0.5f; // 20x10 = 200 values per second == sample frequency mTimer.Start(); isRunning = false; } void contextMenuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { String text = e.ClickedItem.Text; foreach (DataSource s in gPane.Sources) { if (s.Name == text) { s.Active ^= true; gPane.Invalidate(); break; } } } #endregion #region PROPERTIES [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [Editor(typeof(System.ComponentModel.Design.CollectionEditor), typeof(System.Drawing.Design.UITypeEditor))] public List<DataSource> DataSources { get { return gPane.Sources; } } [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [Editor(typeof(System.ComponentModel.Design.CollectionEditor), typeof(System.Drawing.Design.UITypeEditor))] public PlotterGraphPaneEx.LayoutMode PanelLayout { get { return gPane.layout; } set { gPane.layout = value; } } [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [Editor(typeof(System.ComponentModel.Design.CollectionEditor), typeof(System.Drawing.Design.UITypeEditor))] public SmoothingMode Smoothing { get { return gPane.smoothing; } set { gPane.smoothing = value; } } [Category("Playback")] [DefaultValue(typeof(float), "2")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public float PlaySpeed { get { return play_speed; } set { play_speed = value; } } [Category("Playback")] [DefaultValue(typeof(bool), "true")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public bool ShowMovingGrid { get { return gPane.hasMovingGrid; } set { gPane.hasMovingGrid = value; } } [Category("Properties")] [DefaultValue(typeof(Color), "")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public Color BackgroundColorTop { get { return gPane.BgndColorTop; } set { gPane.BgndColorTop = value; } } [Category("Properties")] [DefaultValue(typeof(Color), "")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public Color BackgroundColorBot { get { return gPane.BgndColorBot; } set { gPane.BgndColorBot = value; } } [Category("Properties")] [DefaultValue(typeof(Color), "")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public Color DashedGridColor { get { return gPane.MinorGridColor; } set { gPane.MinorGridColor = value; } } [Category("Properties")] [DefaultValue(typeof(Color), "")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public Color SolidGridColor { get { return gPane.MajorGridColor; } set { gPane.MajorGridColor = value; } } public bool DoubleBuffering { get { return gPane.useDoubleBuffer; } set { gPane.useDoubleBuffer = value; } } #endregion #region PUBLIC METHODS public void SetDisplayRangeX(float x_start, float x_end ) { gPane.XD0 = x_start; gPane.XD1 = x_end; gPane.CurXD0 = gPane.XD0; gPane.CurXD1 = gPane.XD1; } public void SetGridDistanceX(float grid_dist_x_samples) { gPane.grid_distance_x = grid_dist_x_samples; } public void SetGridOriginX(float off_x) { gPane.grid_off_x = off_x; } #endregion #region PRIVATE METHODS protected override void Dispose(bool disposing) { paused = true; if (mTimer.IsRunning) { mTimer.Stop(); mTimer.Dispose(); } base.Dispose(disposing); } public void Start() { if (isRunning == false && paused == false) { gPane.starting_idx = 0; paused = false; isRunning = true; // mTimer.Start(); tb1.Buttons[0].ImageIndex = 2; } else { if (paused == false) { //mTimer.Stop(); paused = true; } else { // mTimer.Start(); paused = false; } if (paused) { tb1.Buttons[0].ImageIndex = 0; } else { tb1.Buttons[0].ImageIndex = 2; } } } public void Stop() { if (isRunning) { // mTimer.Stop(); isRunning = false; paused = false; hScrollBar1.Value = 0; tb1.Buttons[0].ImageIndex = 0; } } private void tb1_ButtonClick(object sender, ToolBarButtonClickEventArgs e) { bool pushed = e.Button.Pushed; switch (e.Button.Tag.ToString().ToLower()) { case "play": Start(); break; case "stop": Stop(); break; case "print": // // todo implement print preview ShowPrintPreview(); break; } } private void SetPlayPanelVisible() { panel1.Visible = true; tb1.Buttons[0].Visible = true; tb1.Buttons[1].Visible = true; } private void SetPlayPanelInvisible() { panel1.Visible = false; tb1.Buttons[0].Visible = false; tb1.Buttons[1].Visible = false; } private void UpdateControl() { try { bool AllAutoscaled = true; foreach (DataSource s in gPane.Sources) { AllAutoscaled &= s.AutoScaleX; } if (AllAutoscaled == true) { if (panel1.Visible == true) { this.Invoke(new MethodInvoker(SetPlayPanelInvisible)); } } else { if (panel1.Visible == false) { this.Invoke(new MethodInvoker(SetPlayPanelVisible)); } } } catch { } } private void UpdatePlayback() { if (!paused && isRunning == true) { try { gPane.starting_idx += play_speed; UpdateScrollBar(); gPane.Invalidate(); } catch { } } } private void OnTimerTick(object sender, EventArgs e) { UpdateControl(); UpdatePlayback(); } private void UpdateScrollBar() { if (InvokeRequired) { Invoke(new MethodInvoker(UpdateScrollBar)); } else { if (gPane.Sources.Count > 0) { if (gPane.starting_idx > gPane.Sources[0].Length) { hScrollBar1.Value = 10000; } else if (gPane.starting_idx >= 0) { hScrollBar1.Value = 10000 * (int)gPane.starting_idx / gPane.Sources[0].Length; } else { hScrollBar1.Value = 0; } } else { hScrollBar1.Value = 0; } } } private void OnScrollbarScroll(object sender, ScrollEventArgs e) { if (gPane.Sources.Count > 0) { int val = hScrollBar1.Value; gPane.starting_idx = (int)(gPane.Sources[0].Length * (float)val / 10000.0f); gPane.Invalidate(); } } private void OnScrollBarSpeedScroll(object sender, ScrollEventArgs e) { float Percentage = hScrollBar2.Value / 10000.0f; float delta = play_speed_max - play_speed_min; play_speed = play_speed_min + Percentage * delta; } #endregion private void ShowPrintPreview() { if (printPreviewForm == null) { printPreviewForm = new PrintPreviewForm(); } printPreviewForm.GraphPanel = this.gPane; printPreviewForm.Show(); printPreviewForm.TopMost = true; printPreviewForm.Invalidate(); } private void selectGraphsToolStripMenuItem_Click(object sender, EventArgs e) { if (GraphPropertiesForm == null) { GraphPropertiesForm = new PlotterGraphSelectCurvesForm(); } GraphPropertiesForm.GraphPanel = this.gPane; GraphPropertiesForm.Show(); // GraphPropertiesForm.BringToFront(); } } }
29.43508
102
0.499536
[ "ECL-2.0", "Apache-2.0" ]
InlineTwin/Repetier-Host
src/RepetierHost/GraphLib/PlotterGraphEx.cs
12,922
C#
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member using System.Threading; using UnityEngine; using Cysharp.Threading.Tasks.Triggers; namespace Cysharp.Threading.Tasks { public static class UniTaskCancellationExtensions { /// <summary>This CancellationToken is canceled when the MonoBehaviour will be destroyed.</summary> public static CancellationToken GetCancellationTokenOnDestroy(this GameObject gameObject) { return gameObject.GetAsyncDestroyTrigger().CancellationToken; } /// <summary>This CancellationToken is canceled when the MonoBehaviour will be destroyed.</summary> public static CancellationToken GetCancellationTokenOnDestroy(this Component component) { return component.GetAsyncDestroyTrigger().CancellationToken; } } } namespace Cysharp.Threading.Tasks.Triggers { public static partial class AsyncTriggerExtensions { // Util. static T GetOrAddComponent<T>(GameObject gameObject) where T : Component { #if UNITY_2019_2_OR_NEWER if (!gameObject.TryGetComponent<T>(out var component)) { component = gameObject.AddComponent<T>(); } #else var component = gameObject.GetComponent<T>(); if (component == null) { component = gameObject.AddComponent<T>(); } #endif return component; } // Special for single operation. /// <summary>This function is called when the MonoBehaviour will be destroyed.</summary> public static UniTask OnDestroyAsync(this GameObject gameObject) { return gameObject.GetAsyncDestroyTrigger().OnDestroyAsync(); } /// <summary>This function is called when the MonoBehaviour will be destroyed.</summary> public static UniTask OnDestroyAsync(this Component component) { return component.GetAsyncDestroyTrigger().OnDestroyAsync(); } public static UniTask StartAsync(this GameObject gameObject) { return gameObject.GetAsyncStartTrigger().StartAsync(); } public static UniTask StartAsync(this Component component) { return component.GetAsyncStartTrigger().StartAsync(); } public static UniTask AwakeAsync(this GameObject gameObject) { return gameObject.GetAsyncAwakeTrigger().AwakeAsync(); } public static UniTask AwakeAsync(this Component component) { return component.GetAsyncAwakeTrigger().AwakeAsync(); } } }
31.581395
107
0.651694
[ "MIT" ]
0x070696E65/Symnity
Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerExtensions.cs
2,718
C#
/* Copyright (c) 2011-2012, HL7, Inc All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of HL7 nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; using System.Collections.Generic; using System.Linq; using Hl7.Fhir.Utility; namespace Hl7.Fhir.Model.DSTU2 { public partial class ModelInfo { #if false // [WMR 20160421] Slow, based on reflection... public static string FhirTypeToFhirTypeName(FHIRDefinedType type) { return type.GetLiteral(); } // [WMR 20160421] Wrong! // FhirTypeToFhirTypeName parses the typename from EnumLiteral attribute on individual FHIRDefinedType member // FhirTypeNameToFhirType converts enum member name to FHIRDefinedType enum value // Currently, the EnumLiteral attribute value is always equal to the Enum member name and the C# type name // However, this is not guaranteed! e.g. a FHIR type name could be a reserved word in C# public static FHIRDefinedType? FhirTypeNameToFhirType(string name) { FHIRDefinedType result; // = FHIRDefinedType.Patient; if (Enum.TryParse<FHIRDefinedType>(name, ignoreCase: true, result: out result)) return result; else return null; } #elif false // [WMR 20160421] NEW - Improved & optimized // 1. Convert from/to FHIR type names as defined by EnumLiteral attributes on FHIRDefinedType enum members // 2. Cache lookup tables, to optimize runtime reflection /// <summary>Returns the <see cref="FHIRDefinedType"/> enum value that represents the specified FHIR type name, or <c>null</c>.</summary> public static string FhirTypeToFhirTypeName(FHIRDefinedType type) { string result; _fhirTypeToFhirTypeName.Value.TryGetValue(type, out result); return result; } private static Lazy<IDictionary<FHIRDefinedType, string>> _fhirTypeToFhirTypeName = new Lazy<IDictionary<FHIRDefinedType, string>>(InitFhirTypeToFhirTypeName); private static IDictionary<FHIRDefinedType, string> InitFhirTypeToFhirTypeName() { // Build reverse lookup table return _fhirTypeNameToFhirType.Value.ToDictionary(kvp => kvp.Value, kvp => kvp.Key); } /// <summary>Returns the FHIR type name represented by the specified <see cref="FHIRDefinedType"/> enum value, or <c>null</c>.</summary> public static FHIRDefinedType? FhirTypeNameToFhirType(string typeName) { FHIRDefinedType result; if (_fhirTypeNameToFhirType.Value.TryGetValue(typeName, out result)) { return result; } return null; } private static Lazy<IDictionary<string, FHIRDefinedType>> _fhirTypeNameToFhirType = new Lazy<IDictionary<string, FHIRDefinedType>>(InitFhirTypeNameToFhirType); private static IDictionary<string, FHIRDefinedType> InitFhirTypeNameToFhirType() { var values = Enum.GetValues(typeof(FHIRDefinedType)).OfType<FHIRDefinedType>(); return values.ToDictionary(type => type.GetLiteral()); } #else // [WMR 2017-10-25] Remove Lazy initialization // These methods are used frequently throughout the API (and by clients) and initialization cost is low private static readonly Dictionary<string, FHIRDefinedType> _fhirTypeNameToFhirType = Enum.GetValues(typeof(FHIRDefinedType)).OfType<FHIRDefinedType>().ToDictionary(type => type.GetLiteral()); private static readonly Dictionary<FHIRDefinedType, string> _fhirTypeToFhirTypeName = _fhirTypeNameToFhirType.ToDictionary(kvp => kvp.Value, kvp => kvp.Key); /// <summary>Returns the FHIR type name represented by the specified <see cref="FHIRDefinedType"/> enum value, or <c>null</c>.</summary> public static FHIRDefinedType? FhirTypeNameToFhirType(string typeName) => _fhirTypeNameToFhirType.TryGetValue(typeName, out var result) ? (FHIRDefinedType?)result : null; /// <summary>Returns the <see cref="FHIRDefinedType"/> enum value that represents the specified FHIR type name, or <c>null</c>.</summary> public static string FhirTypeToFhirTypeName(FHIRDefinedType type) => _fhirTypeToFhirTypeName.TryGetValue(type, out var result) ? result : null; #endif // [WMR 20171025] NEW: Conversion methods for ResourceType private static readonly Dictionary<string, ResourceType> _fhirTypeNameToResourceType = Enum.GetValues(typeof(ResourceType)).OfType<ResourceType>().ToDictionary(type => type.GetLiteral()); private static readonly Dictionary<ResourceType, string> _resourceTypeToFhirTypeName = _fhirTypeNameToResourceType.ToDictionary(kvp => kvp.Value, kvp => kvp.Key); /// <summary>Returns the FHIR type name represented by the specified <see cref="ResourceType"/> enum value, or <c>null</c>.</summary> public static ResourceType? FhirTypeNameToResourceType(string typeName) => _fhirTypeNameToResourceType.TryGetValue(typeName, out var result) ? (ResourceType?)result : null; /// <summary>Returns the <see cref="ResourceType"/> enum value that represents the specified FHIR type name, or <c>null</c>.</summary> public static string ResourceTypeToFhirTypeName(ResourceType type) => _resourceTypeToFhirTypeName.TryGetValue(type, out var result) ? result : null; /// <summary>Returns the C# <see cref="Type"/> that represents the FHIR type with the specified name, or <c>null</c>.</summary> public static Type GetTypeForFhirType(string name) { // [WMR 20160421] Optimization //if (!FhirTypeToCsType.ContainsKey(name)) // return null; //else // return FhirTypeToCsType[name]; Type result; FhirTypeToCsType.TryGetValue(name, out result); return result; } /// <summary>Returns the FHIR type name represented by the specified C# <see cref="Type"/>, or <c>null</c>.</summary> public static string GetFhirTypeNameForType(Type type) { // [WMR 20160421] Optimization //if (!FhirCsTypeToString.ContainsKey(type)) // return null; //else // return FhirCsTypeToString[type]; string result; FhirCsTypeToString.TryGetValue(type, out result); return result; } [Obsolete("Use GetFhirTypeNameForType() instead")] public static string GetFhirTypeForType(Type type) { return GetFhirTypeNameForType(type); } /// <summary>Determines if the specified value represents the name of a known FHIR resource.</summary> public static bool IsKnownResource(string name) { return SupportedResources.Contains(name); } /// <summary>Determines if the specified <see cref="Type"/> instance represents a known FHIR resource.</summary> public static bool IsKnownResource(Type type) { var name = GetFhirTypeNameForType(type); return name != null && IsKnownResource(name); } /// <summary>Determines if the specified <see cref="FHIRDefinedType"/> value represents a known FHIR resource.</summary> public static bool IsKnownResource(FHIRDefinedType type) { var name = FhirTypeToFhirTypeName(type); return name != null && IsKnownResource(name); } [Obsolete("Use GetTypeForFhirType() which covers all types, not just resources")] public static Type GetTypeForResourceName(string name) { if (!IsKnownResource(name)) return null; return GetTypeForFhirType(name); } [Obsolete("Use GetFhirTypeNameForType() which covers all types, not just resources")] public static string GetResourceNameForType(Type type) { var name = GetFhirTypeForType(type); if (name != null && IsKnownResource(name)) return name; else return null; } /// <summary>Determines if the specified value represents the name of a FHIR primitive data type.</summary> public static bool IsPrimitive(string name) { if (String.IsNullOrEmpty(name)) return false; return FhirTypeToCsType.ContainsKey(name) && Char.IsLower(name[0]); } /// <summary>Determines if the specified <see cref="Type"/> instance represents a FHIR primitive data type.</summary> public static bool IsPrimitive(Type type) { var name = GetFhirTypeNameForType(type); return name != null && Char.IsLower(name[0]); } /// <summary>Determines if the specified <see cref="FHIRDefinedType"/> value represents a FHIR primitive data type.</summary> public static bool IsPrimitive(FHIRDefinedType type) { return IsPrimitive(FhirTypeToFhirTypeName(type)); } /// <summary>Determines if the specified value represents the name of a FHIR complex data type (NOT including resources and primitives).</summary> public static bool IsDataType(string name) { if (String.IsNullOrEmpty(name)) return false; return FhirTypeToCsType.ContainsKey(name) && !IsKnownResource(name) && !IsPrimitive(name); } /// <summary>Determines if the specified <see cref="Type"/> instance represents a FHIR complex data type (NOT including resources and primitives).</summary> public static bool IsDataType(Type type) { var name = GetFhirTypeNameForType(type); return name != null && !IsKnownResource(name) && !IsPrimitive(name); } /// <summary>Determines if the specified <see cref="FHIRDefinedType"/> value represents a FHIR complex data type (NOT including resources and primitives).</summary> public static bool IsDataType(FHIRDefinedType type) { return IsDataType(FhirTypeToFhirTypeName(type)); } // [WMR 20160421] Dynamically resolve FHIR type name 'Reference' private static readonly string _referenceTypeName = FHIRDefinedType.Reference.GetLiteral(); /// <summary>Determines if the specified value represents the type name of a FHIR Reference, i.e. equals "Reference".</summary> public static bool IsReference(string name) { return name == _referenceTypeName; // "Reference"; } /// <summary>Determines if the specified <see cref="Type"/> instance represents a FHIR Reference type.</summary> public static bool IsReference(Type type) { return IsReference(type.Name); } /// <summary>Determines if the specified <see cref="FHIRDefinedType"/> value represents a FHIR Reference type.</summary> public static bool IsReference(FHIRDefinedType type) { return type == FHIRDefinedType.Reference; } /// <summary> /// Determines if the specified <see cref="Type"/> instance represents a FHIR conformance resource type, /// i.e. if it equals one of the following types: /// <list type="bullet"> /// <item>Conformance</item> /// <item>StructureDefinition</item> /// <item>ValueSet</item> /// <item>ConceptMap</item> /// <item>DataElement</item> /// <item>OperationDefinition</item> /// <item>SearchParameter</item> /// <item>NamingSystem</item> /// <item>ImplementationGuide</item> /// <item>TestScript</item> /// </list> /// </summary> public static bool IsConformanceResource(Type type) { return IsConformanceResource(type.Name); } /// <summary> /// Determines if the specified value represents a the type name of a FHIR conformance resource, /// i.e. if the value equals one of the following strings: /// <list type="bullet"> /// <item>Conformance</item> /// <item>StructureDefinition</item> /// <item>ValueSet</item> /// <item>ConceptMap</item> /// <item>DataElement</item> /// <item>OperationDefinition</item> /// <item>SearchParameter</item> /// <item>NamingSystem</item> /// <item>ImplementationGuide</item> /// <item>TestScript</item> /// </list> /// </summary> public static bool IsConformanceResource(string name) { if (string.IsNullOrEmpty(name)) return false; var t = FhirTypeNameToFhirType(name); if (t != null) return IsConformanceResource(t.Value); else return false; } /// <summary>Subset of <see cref="FHIRDefinedType"/> enumeration values for conformance resources.</summary> public static readonly FHIRDefinedType[] ConformanceResources = { FHIRDefinedType.Conformance, FHIRDefinedType.StructureDefinition, FHIRDefinedType.ValueSet, FHIRDefinedType.ConceptMap, FHIRDefinedType.DataElement, FHIRDefinedType.OperationDefinition, FHIRDefinedType.SearchParameter, FHIRDefinedType.NamingSystem, FHIRDefinedType.ImplementationGuide, FHIRDefinedType.TestScript }; /// <summary>Determines if the specified <see cref="FHIRDefinedType"/> value represents a FHIR conformance resource.</summary> public static bool IsConformanceResource(FHIRDefinedType type) => ConformanceResources.Contains(type); /// <summary>Determines if the specified <see cref="FHIRDefinedType"/> value represents a FHIR conformance resource.</summary> public static bool IsConformanceResource(FHIRDefinedType? type) => type.HasValue && ConformanceResources.Contains(type.Value); /// <summary>Subset of <see cref="ResourceType"/> enumeration values for conformance resources.</summary> public static readonly ResourceType[] ConformanceResourceTypes = { ResourceType.Conformance, ResourceType.StructureDefinition, ResourceType.ValueSet, ResourceType.ConceptMap, ResourceType.DataElement, ResourceType.OperationDefinition, ResourceType.SearchParameter, ResourceType.NamingSystem, ResourceType.ImplementationGuide, ResourceType.TestScript }; /// <summary>Determines if the specified <see cref="ResourceType"/> value represents a FHIR conformance resource.</summary> public static bool IsConformanceResource(ResourceType type) => ConformanceResourceTypes.Contains(type); /// <summary>Determines if the specified <see cref="ResourceType"/> value represents a FHIR conformance resource.</summary> public static bool IsConformanceResource(ResourceType? type) => type.HasValue && ConformanceResourceTypes.Contains(type.Value); /// <summary>Determines if the specified value represents the name of a core Resource, Datatype or primitive.</summary> public static bool IsCoreModelType(string name) => FhirTypeToCsType.ContainsKey(name); // => IsKnownResource(name) || IsDataType(name) || IsPrimitive(name); static readonly Uri FhirCoreProfileBaseUri = new Uri(@"http://hl7.org/fhir/StructureDefinition/"); /// <summary>Determines if the specified value represents the canonical uri of a core Resource, Datatype or primitive.</summary> public static bool IsCoreModelTypeUri(Uri uri) { return uri != null // [WMR 20181025] Issue #746 // Note: FhirCoreProfileBaseUri.IsBaseOf(new Uri("Dummy", UriKind.RelativeOrAbsolute)) = true...?! && uri.IsAbsoluteUri && FhirCoreProfileBaseUri.IsBaseOf(uri) && IsCoreModelType(FhirCoreProfileBaseUri.MakeRelativeUri(uri).ToString()); } /// <summary> /// Returns whether the type has subclasses in the core spec /// </summary> /// <param name="type"></param> /// <returns></returns> /// <remarks>Quantity is not listed here, since its subclasses are /// actually profiles on Quantity. Likewise, there is no real inheritance /// in the primitives, so string is not a superclass for markdown</remarks> public static bool IsCoreSuperType(FHIRDefinedType type) { return type == FHIRDefinedType.Resource || type == FHIRDefinedType.DomainResource || type == FHIRDefinedType.Element || type == FHIRDefinedType.BackboneElement; } public static bool IsCoreSuperType(string type) { var fat = FhirTypeNameToFhirType(type); if (fat == null) return false; return IsCoreSuperType(fat.Value); } public static bool IsProfiledQuantity(FHIRDefinedType type) { return type == FHIRDefinedType.Age || type == FHIRDefinedType.Distance || type == FHIRDefinedType.SimpleQuantity || type == FHIRDefinedType.Duration || type == FHIRDefinedType.Count || type == FHIRDefinedType.Money; } public static bool IsProfiledQuantity(string type) { var definedType = FhirTypeNameToFhirType(type); if (definedType == null) return false; return IsProfiledQuantity(definedType.Value); } public static bool IsInstanceTypeFor(FHIRDefinedType superType, FHIRDefinedType instanceType) { if (superType == instanceType) return true; if (IsKnownResource(instanceType)) { if (superType == FHIRDefinedType.Resource) return true; else if (superType == FHIRDefinedType.DomainResource) return instanceType != FHIRDefinedType.Parameters && instanceType != FHIRDefinedType.Bundle && instanceType != FHIRDefinedType.Binary; else return false; } else return superType == FHIRDefinedType.Element; } public static string CanonicalUriForFhirCoreType(string typename) { return "http://hl7.org/fhir/StructureDefinition/" + typename; } public static string CanonicalUriForFhirCoreType(FHIRDefinedType type) { return CanonicalUriForFhirCoreType(type.GetLiteral()); } } }
44.413043
172
0.646941
[ "BSD-3-Clause" ]
CareEvolution/fhir-net-api
src/Hl7.Fhir.Core/Model/Version-DSTU2/ModelInfo.cs
20,432
C#
namespace Ludiq.PeekCore { public enum MouseButton { Left = 0, Right = 1, Middle = 2 } }
10.777778
24
0.628866
[ "MIT" ]
3-Delta/Unity-UGUI-UI
Assets/3rd/Ludiq/Ludiq.PeekCore/Runtime/Input/MouseButton.cs
97
C#
using System; using System.Drawing; using System.Windows.Forms; using PasswordVault.Services; using PasswordVault.Models; /*================================================================================================= DESCRIPTION *================================================================================================*/ /* ------------------------------------------------------------------------------------------------*/ namespace PasswordVault.Desktop.Winforms { /*================================================================================================= ENUMERATIONS *================================================================================================*/ /*================================================================================================= STRUCTS *================================================================================================*/ /*================================================================================================= CLASSES *================================================================================================*/ public partial class EditUserView : Form, IEditUserView { /*================================================================================================= CONSTANTS *================================================================================================*/ /*PUBLIC******************************************************************************************/ /*PRIVATE*****************************************************************************************/ /*================================================================================================= FIELDS *================================================================================================*/ /*PUBLIC******************************************************************************************/ public event Action<string, string, string, string> ModifyAccountEvent; public event Action RequestUserEvent; /*PRIVATE*****************************************************************************************/ private bool _draggingWindow = false; // Variable to track whether the form is being moved private Point _start_point = new Point(0, 0); // Varaible to track where the form should be moved to /*================================================================================================= PROPERTIES *================================================================================================*/ /*PUBLIC******************************************************************************************/ /*PRIVATE*****************************************************************************************/ /*================================================================================================= CONSTRUCTORS *================================================================================================*/ public EditUserView() { InitializeComponent(); // Configure form UI BackColor = UIHelper.GetColorFromCode(UIColors.SecondaryFromBackgroundColor); FormBorderStyle = FormBorderStyle.None; // Configure labels statusLabel.Font = UIHelper.GetFont(UIFontSizes.DefaultFontSize); statusLabel.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); statusLabel.Text = ""; label2.Font = UIHelper.GetFont(UIFontSizes.DefaultFontSize); label2.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); label3.Font = UIHelper.GetFont(UIFontSizes.DefaultFontSize); label3.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); label4.Font = UIHelper.GetFont(UIFontSizes.DefaultFontSize); label4.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); label5.Font = UIHelper.GetFont(UIFontSizes.DefaultFontSize); label5.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); // Configure buttons modifyButton.BackColor = UIHelper.GetColorFromCode(UIColors.ControlBackgroundColor); modifyButton.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); modifyButton.FlatStyle = FlatStyle.Flat; modifyButton.Font = UIHelper.GetFont(UIFontSizes.ButtonFontSize); modifyButton.FlatAppearance.BorderColor = UIHelper.GetColorFromCode(UIColors.DefaultBackgroundColor); modifyButton.FlatAppearance.BorderSize = 1; modifyButton.Enabled = false; closeButton.BackColor = UIHelper.GetColorFromCode(UIColors.ControlBackgroundColor); closeButton.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); closeButton.Font = UIHelper.GetFont(UIFontSizes.CloseButtonFontSize); // Configure textbox firstNameTextbox.BackColor = UIHelper.GetColorFromCode(UIColors.ControlBackgroundColor); firstNameTextbox.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); firstNameTextbox.BorderStyle = BorderStyle.FixedSingle; firstNameTextbox.Font = UIHelper.GetFont(UIFontSizes.TextBoxFontSize); lastNameTextbox.BackColor = UIHelper.GetColorFromCode(UIColors.ControlBackgroundColor); lastNameTextbox.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); lastNameTextbox.BorderStyle = BorderStyle.FixedSingle; lastNameTextbox.Font = UIHelper.GetFont(UIFontSizes.TextBoxFontSize); emailTextBox.BackColor = UIHelper.GetColorFromCode(UIColors.ControlBackgroundColor); emailTextBox.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); emailTextBox.BorderStyle = BorderStyle.FixedSingle; emailTextBox.Font = UIHelper.GetFont(UIFontSizes.TextBoxFontSize); emailTextBox.Enabled = false; phoneNumberTextbox.BackColor = UIHelper.GetColorFromCode(UIColors.ControlBackgroundColor); phoneNumberTextbox.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); phoneNumberTextbox.BorderStyle = BorderStyle.FixedSingle; phoneNumberTextbox.Font = UIHelper.GetFont(UIFontSizes.TextBoxFontSize); phoneNumberTextbox.Enabled = false; } /*================================================================================================= PUBLIC METHODS *================================================================================================*/ /*************************************************************************************************/ public void ShowEditUserMenu() { this.StartPosition = FormStartPosition.CenterParent; this.ShowDialog(); firstNameTextbox.Select(); RaiseRequestUserEvent(); } /*************************************************************************************************/ public void DisplayModifyResult(UserInformationResult result) { switch(result) { case UserInformationResult.Failed: UIHelper.UpdateStatusLabel("Failed to modify information!", statusLabel, ErrorLevel.Error); break; case UserInformationResult.InvalidEmail: UIHelper.UpdateStatusLabel("Invalid email!", statusLabel, ErrorLevel.Error); break; case UserInformationResult.InvalidFirstName: UIHelper.UpdateStatusLabel("Invalid first name!", statusLabel, ErrorLevel.Error); break; case UserInformationResult.InvalidLastName: UIHelper.UpdateStatusLabel("Invalid last name!", statusLabel, ErrorLevel.Error); break; case UserInformationResult.InvalidPhoneNumber: UIHelper.UpdateStatusLabel("Invalid phone number!", statusLabel, ErrorLevel.Error); break; case UserInformationResult.Success: UIHelper.UpdateStatusLabel("Success", statusLabel, ErrorLevel.Ok); ClearChangePasswordView(); this.Close(); break; } } /*************************************************************************************************/ public void DisplayUser(User user) { if (user == null) { throw new ArgumentNullException(nameof(user)); } firstNameTextbox.Text = user.FirstName; lastNameTextbox.Text = user.LastName; emailTextBox.Text = user.Email; phoneNumberTextbox.Text = user.PhoneNumber; } /*************************************************************************************************/ public void CloseView() { this.Hide(); } /*================================================================================================= PRIVATE METHODS *================================================================================================*/ /*************************************************************************************************/ private void ClearChangePasswordView() { modifyButton.Enabled = false; firstNameTextbox.Text = ""; lastNameTextbox.Text = ""; emailTextBox.Text = ""; phoneNumberTextbox.Text = ""; statusLabel.Text = ""; } /*************************************************************************************************/ private void EditUserView_FormClosing(object sender, FormClosingEventArgs e) { this.Hide(); e.Cancel = true; // this cancels the close event. } /*************************************************************************************************/ private void moveWindowPanel_MouseDown(object sender, MouseEventArgs e) { _draggingWindow = true; _start_point = new Point(e.X, e.Y); } /*************************************************************************************************/ private void moveWindowPanel_MouseMove(object sender, MouseEventArgs e) { if (_draggingWindow) { Point p = PointToScreen(e.Location); Location = new Point(p.X - this._start_point.X, p.Y - this._start_point.Y); } } /*************************************************************************************************/ private void moveWindowPanel_MouseUp(object sender, MouseEventArgs e) { _draggingWindow = false; } /*************************************************************************************************/ private void closeButton_Click(object sender, EventArgs e) { this.Close(); DialogResult = DialogResult.Cancel; } /*************************************************************************************************/ private void closeButton_MouseEnter(object sender, EventArgs e) { closeButton.BackColor = UIHelper.GetColorFromCode(UIColors.CloseButtonColor); closeButton.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); } /*************************************************************************************************/ private void closeButton_MouseLeave(object sender, EventArgs e) { closeButton.BackColor = UIHelper.GetColorFromCode(UIColors.ControlBackgroundColor); closeButton.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); } /*************************************************************************************************/ private void textBox_TextChanged(object sender, EventArgs e) { modifyButton.Enabled = true; if (((TextBox)sender).Name == phoneNumberTextbox.Name) { phoneNumberTextbox.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); } else if (((TextBox)sender).Name == emailTextBox.Name) { emailTextBox.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); } } /*************************************************************************************************/ private void modifyButton_Click(object sender, EventArgs e) { RaiseModifyAccountEvent(firstNameTextbox.Text, lastNameTextbox.Text, emailTextBox.Text, phoneNumberTextbox.Text); } /*************************************************************************************************/ private void RaiseModifyAccountEvent(string firstName, string lastName, string email, string phoneNumber) { ModifyAccountEvent?.Invoke(firstName, lastName, email, phoneNumber); } /*************************************************************************************************/ private void RaiseRequestUserEvent() { RequestUserEvent?.Invoke(); } /*************************************************************************************************/ private void phoneNumberTextbox_Leave(object sender, EventArgs e) { if (string.IsNullOrEmpty(phoneNumberTextbox.Text)) { phoneNumberTextbox.Text = "xxx-xxx-xxxx"; phoneNumberTextbox.ForeColor = Color.FromArgb(0x6B, 0x6B, 0x6B); } } /*************************************************************************************************/ private void emailTextBox_Leave(object sender, EventArgs e) { if (string.IsNullOrEmpty(emailTextBox.Text)) { emailTextBox.Text = "example@provider.com"; emailTextBox.ForeColor = Color.FromArgb(0x6B, 0x6B, 0x6B); } } /*************************************************************************************************/ private void phoneNumberTextbox_Enter(object sender, EventArgs e) { if (phoneNumberTextbox.Text == "xxx-xxx-xxxx") { phoneNumberTextbox.Text = ""; phoneNumberTextbox.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); } } /*************************************************************************************************/ private void emailTextBox_Enter(object sender, EventArgs e) { if (emailTextBox.Text == "example@provider.com") { emailTextBox.Text = ""; emailTextBox.ForeColor = UIHelper.GetColorFromCode(UIColors.DefaultFontColor); } } /*================================================================================================= STATIC METHODS *================================================================================================*/ /*************************************************************************************************/ } // EditUserView CLASS } // PasswordVault NAMESPACE
48.106383
125
0.420421
[ "Apache-2.0" ]
willem445/PasswordVault
PasswordVault.Desktop.Winforms/Views/EditUserView.cs
15,829
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the ecs-2014-11-13.normal.json service model. */ using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; using System.Text; using System.Xml.Serialization; using Amazon.ECS.Model; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Transform; using Amazon.Runtime.Internal.Util; using ThirdParty.Json.LitJson; namespace Amazon.ECS.Model.Internal.MarshallTransformations { /// <summary> /// Response Unmarshaller for CreateTaskSet operation /// </summary> public class CreateTaskSetResponseUnmarshaller : JsonResponseUnmarshaller { /// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { CreateTaskSetResponse response = new CreateTaskSetResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("taskSet", targetDepth)) { var unmarshaller = TaskSetUnmarshaller.Instance; response.TaskSet = unmarshaller.Unmarshall(context); continue; } } return response; } /// <summary> /// Unmarshaller error response to exception. /// </summary> /// <param name="context"></param> /// <param name="innerException"></param> /// <param name="statusCode"></param> /// <returns></returns> public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) { var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context); errorResponse.InnerException = innerException; errorResponse.StatusCode = statusCode; var responseBodyBytes = context.GetResponseBodyBytes(); using (var streamCopy = new MemoryStream(responseBodyBytes)) using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null)) { if (errorResponse.Code != null && errorResponse.Code.Equals("AccessDeniedException")) { return AccessDeniedExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ClientException")) { return ClientExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ClusterNotFoundException")) { return ClusterNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidParameterException")) { return InvalidParameterExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("PlatformTaskDefinitionIncompatibilityException")) { return PlatformTaskDefinitionIncompatibilityExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("PlatformUnknownException")) { return PlatformUnknownExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServerException")) { return ServerExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceNotActiveException")) { return ServiceNotActiveExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("ServiceNotFoundException")) { return ServiceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } if (errorResponse.Code != null && errorResponse.Code.Equals("UnsupportedFeatureException")) { return UnsupportedFeatureExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse); } } return new AmazonECSException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode); } private static CreateTaskSetResponseUnmarshaller _instance = new CreateTaskSetResponseUnmarshaller(); internal static CreateTaskSetResponseUnmarshaller GetInstance() { return _instance; } /// <summary> /// Gets the singleton. /// </summary> public static CreateTaskSetResponseUnmarshaller Instance { get { return _instance; } } } }
44.020548
187
0.61864
[ "Apache-2.0" ]
philasmar/aws-sdk-net
sdk/src/Services/ECS/Generated/Model/Internal/MarshallTransformations/CreateTaskSetResponseUnmarshaller.cs
6,427
C#
using TaleWorlds.CampaignSystem; namespace CommunityPatch.Patches { public interface IPartySpeed { void ModifyFinalSpeed(MobileParty mobileParty, float baseSpeed, ref ExplainedNumber finalSpeed); } }
23.777778
100
0.78972
[ "MIT" ]
JoeFwd/MnB2-Bannerlord-CommunityPatch
src/CommunityPatch/Patches/IPartySpeed.cs
214
C#
using System; using System.Collections.Generic; using System.Linq; using BWMS.WorkshopManagementAPI.Domain.Exceptions; using WorkshopManagementAPI.Domain.Core; namespace BWMS.WorkshopManagementAPI.Domain.ValueObjects { public class Timeslot : ValueObject { public DateTime StartTime { get; private set; } public DateTime EndTime { get; private set; } public static Timeslot Create(DateTime startTime, DateTime endTime) { ValidateInput(startTime, endTime); return new Timeslot { StartTime = startTime, EndTime = endTime }; } public Timeslot SetStartTime(DateTime startTime) { ValidateInput(startTime, EndTime); return Timeslot.Create(startTime, EndTime); } public Timeslot SetEndTime(DateTime endTime) { ValidateInput(StartTime, endTime); return Timeslot.Create(StartTime, endTime); } public bool IsWithinOneDay() { return (StartTime.Date == EndTime.Date); } public bool OverlapsWith(DateTime startTime, DateTime endTime) { return this.OverlapsWith(Timeslot.Create(startTime, endTime)); } public bool OverlapsWith(Timeslot other) { return (StartTime > other.StartTime && StartTime <= other.EndTime || EndTime >= other.StartTime && EndTime <= other.EndTime); } private static void ValidateInput(DateTime startTime, DateTime endTime) { if (startTime >= endTime) { throw new InvalidValueException($"The specified start-time may not be after the specified end-time."); } } protected override IEnumerable<object> GetAtomicValues() { yield return StartTime; yield return EndTime; } } }
29.373134
118
0.59502
[ "Apache-2.0" ]
TropinAlexey/lifecycle
src/WorkshopManagementAPI/Domain/ValueObjects/Timeslot.cs
1,968
C#
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Microsoft.ReverseProxy.RuntimeModel; using Microsoft.ReverseProxy.Service.SessionAffinity; namespace Microsoft.ReverseProxy.Middleware { /// <summary> /// Affinitizes request to a chosen <see cref="DestinationInfo"/>. /// </summary> internal class AffinitizeRequestMiddleware { private readonly Random _random = new Random(); private readonly RequestDelegate _next; private readonly IDictionary<string, ISessionAffinityProvider> _sessionAffinityProviders; private readonly ILogger _logger; public AffinitizeRequestMiddleware( RequestDelegate next, IEnumerable<ISessionAffinityProvider> sessionAffinityProviders, ILogger<AffinitizeRequestMiddleware> logger) { _next = next ?? throw new ArgumentNullException(nameof(next)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _sessionAffinityProviders = sessionAffinityProviders.ToProviderDictionary(); } public Task Invoke(HttpContext context) { var proxyFeature = context.GetRequiredProxyFeature(); var options = proxyFeature.ClusterConfig.SessionAffinityOptions; if (options.Enabled) { var candidateDestinations = proxyFeature.AvailableDestinations; if (candidateDestinations.Count == 0) { var cluster = context.GetRequiredCluster(); // Only log the warning about missing destinations here, but allow the request to proceed further. // The final check for selected destination is to be done at the pipeline end. Log.NoDestinationOnClusterToEstablishRequestAffinity(_logger, cluster.ClusterId); } else { var chosenDestination = candidateDestinations[0]; if (candidateDestinations.Count > 1) { var cluster = context.GetRequiredCluster(); Log.MultipleDestinationsOnClusterToEstablishRequestAffinity(_logger, cluster.ClusterId); // It's assumed that all of them match to the request's affinity key. chosenDestination = candidateDestinations[_random.Next(candidateDestinations.Count)]; proxyFeature.AvailableDestinations = chosenDestination; } AffinitizeRequest(context, options, chosenDestination); } } return _next(context); } private void AffinitizeRequest(HttpContext context, ClusterConfig.ClusterSessionAffinityOptions options, DestinationInfo destination) { var currentProvider = _sessionAffinityProviders.GetRequiredServiceById(options.Mode); currentProvider.AffinitizeRequest(context, options, destination); } private static class Log { private static readonly Action<ILogger, string, Exception> _multipleDestinationsOnClusterToEstablishRequestAffinity = LoggerMessage.Define<string>( LogLevel.Warning, EventIds.MultipleDestinationsOnClusterToEstablishRequestAffinity, "The request still has multiple destinations on the cluster `{clusterId}` to choose from when establishing affinity, load balancing may not be properly configured. A random destination will be used."); private static readonly Action<ILogger, string, Exception> _noDestinationOnClusterToEstablishRequestAffinity = LoggerMessage.Define<string>( LogLevel.Warning, EventIds.NoDestinationOnClusterToEstablishRequestAffinity, "The request doesn't have any destinations on the cluster `{clusterId}` to choose from when establishing affinity, load balancing may not be properly configured."); public static void MultipleDestinationsOnClusterToEstablishRequestAffinity(ILogger logger, string clusterId) { _multipleDestinationsOnClusterToEstablishRequestAffinity(logger, clusterId, null); } public static void NoDestinationOnClusterToEstablishRequestAffinity(ILogger logger, string clusterId) { _noDestinationOnClusterToEstablishRequestAffinity(logger, clusterId, null); } } } }
47.545455
217
0.666667
[ "MIT" ]
MeladKamari/reverse-proxy
src/ReverseProxy/Middleware/AffinitizeRequestMiddleware.cs
4,707
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Reflection; using System.Diagnostics; using System.Collections.Generic; using System.Reflection.Runtime.TypeInfos; using System.Reflection.Runtime.ParameterInfos; using Internal.Reflection.Core.Execution; namespace System.Reflection.Runtime.MethodInfos { internal sealed class OpenMethodInvoker : MethodInvoker { protected sealed override object? Invoke(object? thisObject, object?[] arguments, BinderBundle binderBundle, bool wrapInTargetInvocationException) { throw new InvalidOperationException(SR.Arg_UnboundGenParam); } public sealed override Delegate CreateDelegate(RuntimeTypeHandle delegateType, object target, bool isStatic, bool isVirtual, bool isOpen) { throw new InvalidOperationException(SR.Arg_UnboundGenParam); } public sealed override IntPtr LdFtnResult { get { throw new InvalidOperationException(SR.Arg_UnboundGenParam); } } } }
32.666667
154
0.714286
[ "MIT" ]
LoopedBard3/runtime
src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/MethodInfos/OpenMethodInvoker.cs
1,176
C#
using System; using BinBridge.Ssh.Security.Cryptography; namespace BinBridge.Ssh.Abstractions { internal static class CryptoAbstraction { #if FEATURE_RNG_CREATE || FEATURE_RNG_CSP private static readonly System.Security.Cryptography.RandomNumberGenerator Randomizer = CreateRandomNumberGenerator(); #endif /// <summary> /// Fills an array of bytes with a cryptographically strong random sequence of values. /// </summary> /// <param name="data">The array to fill with cryptographically strong random bytes.</param> /// <exception cref="ArgumentNullException"><paramref name="data"/> is <c>null</c>.</exception> /// <remarks> /// The length of the byte array determines how many random bytes are produced. /// </remarks> public static void GenerateRandom(byte[] data) { #if FEATURE_RNG_CREATE || FEATURE_RNG_CSP Randomizer.GetBytes(data); #else if(data == null) throw new ArgumentNullException("data"); var buffer = Windows.Security.Cryptography.CryptographicBuffer.GenerateRandom((uint) data.Length); System.Runtime.InteropServices.WindowsRuntime.WindowsRuntimeBufferExtensions.CopyTo(buffer, data); #endif } #if FEATURE_RNG_CREATE || FEATURE_RNG_CSP public static System.Security.Cryptography.RandomNumberGenerator CreateRandomNumberGenerator() { #if FEATURE_RNG_CREATE return System.Security.Cryptography.RandomNumberGenerator.Create(); #elif FEATURE_RNG_CSP return new System.Security.Cryptography.RNGCryptoServiceProvider(); #else #error Creation of RandomNumberGenerator is not implemented. #endif } #endif // FEATURE_RNG_CREATE || FEATURE_RNG_CSP #if FEATURE_HASH_MD5 public static System.Security.Cryptography.MD5 CreateMD5() { return System.Security.Cryptography.MD5.Create(); } #else public static global::BinBridge.Cryptography.MD5 CreateMD5() { return new global::BinBridge.Cryptography.MD5(); } #endif // FEATURE_HASH_MD5 #if FEATURE_HASH_SHA1_CREATE || FEATURE_HASH_SHA1_MANAGED public static System.Security.Cryptography.SHA1 CreateSHA1() { #if FEATURE_HASH_SHA1_CREATE return System.Security.Cryptography.SHA1.Create(); #elif FEATURE_HASH_SHA1_MANAGED return new System.Security.Cryptography.SHA1Managed(); #endif } #else public static global::BinBridge.Cryptography.SHA1 CreateSHA1() { return new global::BinBridge.Cryptography.SHA1(); } #endif #if FEATURE_HASH_SHA256_CREATE || FEATURE_HASH_SHA256_MANAGED public static System.Security.Cryptography.SHA256 CreateSHA256() { #if FEATURE_HASH_SHA256_CREATE return System.Security.Cryptography.SHA256.Create(); #elif FEATURE_HASH_SHA256_MANAGED return new System.Security.Cryptography.SHA256Managed(); #endif } #else public static global::BinBridge.Cryptography.SHA256 CreateSHA256() { return new global::BinBridge.Cryptography.SHA256(); } #endif #if FEATURE_HASH_SHA384_CREATE || FEATURE_HASH_SHA384_MANAGED public static System.Security.Cryptography.SHA384 CreateSHA384() { #if FEATURE_HASH_SHA384_CREATE return System.Security.Cryptography.SHA384.Create(); #elif FEATURE_HASH_SHA384_MANAGED return new System.Security.Cryptography.SHA384Managed(); #endif } #else public static global::BinBridge.Cryptography.SHA384 CreateSHA384() { return new global::BinBridge.Cryptography.SHA384(); } #endif #if FEATURE_HASH_SHA512_CREATE || FEATURE_HASH_SHA512_MANAGED public static System.Security.Cryptography.SHA512 CreateSHA512() { #if FEATURE_HASH_SHA512_CREATE return System.Security.Cryptography.SHA512.Create(); #elif FEATURE_HASH_SHA512_MANAGED return new System.Security.Cryptography.SHA512Managed(); #endif } #else public static global::BinBridge.Cryptography.SHA512 CreateSHA512() { return new global::BinBridge.Cryptography.SHA512(); } #endif #if FEATURE_HASH_RIPEMD160_CREATE || FEATURE_HASH_RIPEMD160_MANAGED public static System.Security.Cryptography.RIPEMD160 CreateRIPEMD160() { #if FEATURE_HASH_RIPEMD160_CREATE return System.Security.Cryptography.RIPEMD160.Create(); #else return new System.Security.Cryptography.RIPEMD160Managed(); #endif } #else public static global::BinBridge.Cryptography.RIPEMD160 CreateRIPEMD160() { return new global::BinBridge.Cryptography.RIPEMD160(); } #endif // FEATURE_HASH_RIPEMD160 #if FEATURE_HMAC_MD5 public static System.Security.Cryptography.HMACMD5 CreateHMACMD5(byte[] key) { return new System.Security.Cryptography.HMACMD5(key); } public static HMACMD5 CreateHMACMD5(byte[] key, int hashSize) { return new HMACMD5(key, hashSize); } #else public static global::BinBridge.Cryptography.HMACMD5 CreateHMACMD5(byte[] key) { return new global::BinBridge.Cryptography.HMACMD5(key); } public static global::BinBridge.Cryptography.HMACMD5 CreateHMACMD5(byte[] key, int hashSize) { return new global::BinBridge.Cryptography.HMACMD5(key, hashSize); } #endif // FEATURE_HMAC_MD5 #if FEATURE_HMAC_SHA1 public static System.Security.Cryptography.HMACSHA1 CreateHMACSHA1(byte[] key) { return new System.Security.Cryptography.HMACSHA1(key); } public static HMACSHA1 CreateHMACSHA1(byte[] key, int hashSize) { return new HMACSHA1(key, hashSize); } #else public static global::BinBridge.Cryptography.HMACSHA1 CreateHMACSHA1(byte[] key) { return new global::BinBridge.Cryptography.HMACSHA1(key); } public static global::BinBridge.Cryptography.HMACSHA1 CreateHMACSHA1(byte[] key, int hashSize) { return new global::BinBridge.Cryptography.HMACSHA1(key, hashSize); } #endif // FEATURE_HMAC_SHA1 #if FEATURE_HMAC_SHA256 public static System.Security.Cryptography.HMACSHA256 CreateHMACSHA256(byte[] key) { return new System.Security.Cryptography.HMACSHA256(key); } public static HMACSHA256 CreateHMACSHA256(byte[] key, int hashSize) { return new HMACSHA256(key, hashSize); } #else public static global::BinBridge.Cryptography.HMACSHA256 CreateHMACSHA256(byte[] key) { return new global::BinBridge.Cryptography.HMACSHA256(key); } public static global::BinBridge.Cryptography.HMACSHA256 CreateHMACSHA256(byte[] key, int hashSize) { return new global::BinBridge.Cryptography.HMACSHA256(key, hashSize); } #endif // FEATURE_HMAC_SHA256 #if FEATURE_HMAC_SHA384 public static System.Security.Cryptography.HMACSHA384 CreateHMACSHA384(byte[] key) { return new System.Security.Cryptography.HMACSHA384(key); } public static HMACSHA384 CreateHMACSHA384(byte[] key, int hashSize) { return new HMACSHA384(key, hashSize); } #else public static global::BinBridge.Cryptography.HMACSHA384 CreateHMACSHA384(byte[] key) { return new global::BinBridge.Cryptography.HMACSHA384(key); } public static global::BinBridge.Cryptography.HMACSHA384 CreateHMACSHA384(byte[] key, int hashSize) { return new global::BinBridge.Cryptography.HMACSHA384(key, hashSize); } #endif // FEATURE_HMAC_SHA384 #if FEATURE_HMAC_SHA512 public static System.Security.Cryptography.HMACSHA512 CreateHMACSHA512(byte[] key) { return new System.Security.Cryptography.HMACSHA512(key); } public static HMACSHA512 CreateHMACSHA512(byte[] key, int hashSize) { return new HMACSHA512(key, hashSize); } #else public static global::BinBridge.Cryptography.HMACSHA512 CreateHMACSHA512(byte[] key) { return new global::BinBridge.Cryptography.HMACSHA512(key); } public static global::BinBridge.Cryptography.HMACSHA512 CreateHMACSHA512(byte[] key, int hashSize) { return new global::BinBridge.Cryptography.HMACSHA512(key, hashSize); } #endif // FEATURE_HMAC_SHA512 #if FEATURE_HMAC_RIPEMD160 public static System.Security.Cryptography.HMACRIPEMD160 CreateHMACRIPEMD160(byte[] key) { return new System.Security.Cryptography.HMACRIPEMD160(key); } #else public static global::BinBridge.Cryptography.HMACRIPEMD160 CreateHMACRIPEMD160(byte[] key) { return new global::BinBridge.Cryptography.HMACRIPEMD160(key); } #endif // FEATURE_HMAC_RIPEMD160 } }
34.850575
126
0.67865
[ "MIT" ]
mazong1123/binbridge
BinBridge/src/BinBridge.Ssh/Abstractions/CryptoAbstraction.cs
9,098
C#
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Andy.Mes.Application; using Andy.Mes.Entity; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace Andy.Mes.Web.Areas.SysMgr.Controllers { [Area("SysMgr")] public class UserController : ControllerBase { public IUserService UserService { get; set; } // GET: UserController public ActionResult Index() { var set = UserService.List(); var vm = set.Select(x => ObjectMapper.Map<SysMgrUserViewModel>(x)); return View(vm); } // GET: UserController/Details/5 public ActionResult Details(string id) { var ent = UserService.GetById(id); var vm = ObjectMapper.Map<SysMgrUserViewModel>(ent); return View(vm); } // GET: UserController/Create public ActionResult Create() { return View(); } // POST: UserController/Create [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create(SysMgrUserViewModel input) { try { var ent = ObjectMapper.Map<SysMgrUser>(input); UserService.Create(ent); return RedirectToAction(nameof(Index)); } catch (Exception es) { Logger.Error(es,"create fault"); return View(); } } // GET: UserController/Edit/5 public ActionResult Edit(string id) { var ent = UserService.GetById(id); var vm = ObjectMapper.Map<SysMgrUserViewModel>(ent); return View(vm); } // POST: UserController/Edit/5 [HttpPost] [ValidateAntiForgeryToken] public ActionResult Edit(SysMgrUserViewModel input) { try { var ent = ObjectMapper.Map<SysMgrUser>(input); UserService.Update(ent); return RedirectToAction(nameof(Index)); } catch(Exception ex) { return BadRequest(ex); } } // GET: UserController/Delete/5 public ActionResult Delete(string id) { UserService.Delete(id); return View(); } // POST: UserController/Delete/5 [HttpPost] [ValidateAntiForgeryToken] public ActionResult Delete(int id, IFormCollection collection) { try { return RedirectToAction(nameof(Index)); } catch { return View(); } } } }
26.102804
79
0.526674
[ "MIT" ]
YanhuaGuo/Andy.Mes
Andy.Mes.Web/Areas/SysMgr/Controllers/UserController.cs
2,795
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.V20190501.Outputs { [OutputType] public sealed class FrontendEndpointUpdateParametersResponseWebApplicationFirewallPolicyLink { /// <summary> /// Resource ID. /// </summary> public readonly string? Id; [OutputConstructor] private FrontendEndpointUpdateParametersResponseWebApplicationFirewallPolicyLink(string? id) { Id = id; } } }
27.214286
100
0.691601
[ "Apache-2.0" ]
pulumi-bot/pulumi-azure-native
sdk/dotnet/Network/V20190501/Outputs/FrontendEndpointUpdateParametersResponseWebApplicationFirewallPolicyLink.cs
762
C#
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AzureNextGen.Network.V20190801 { public static class GetRouteFilterRule { public static Task<GetRouteFilterRuleResult> InvokeAsync(GetRouteFilterRuleArgs args, InvokeOptions? options = null) => Pulumi.Deployment.Instance.InvokeAsync<GetRouteFilterRuleResult>("azure-nextgen:network/v20190801:getRouteFilterRule", args ?? new GetRouteFilterRuleArgs(), options.WithVersion()); } public sealed class GetRouteFilterRuleArgs : Pulumi.InvokeArgs { /// <summary> /// The name of the resource group. /// </summary> [Input("resourceGroupName", required: true)] public string ResourceGroupName { get; set; } = null!; /// <summary> /// The name of the route filter. /// </summary> [Input("routeFilterName", required: true)] public string RouteFilterName { get; set; } = null!; /// <summary> /// The name of the rule. /// </summary> [Input("ruleName", required: true)] public string RuleName { get; set; } = null!; public GetRouteFilterRuleArgs() { } } [OutputType] public sealed class GetRouteFilterRuleResult { /// <summary> /// The access type of the rule. /// </summary> public readonly string Access; /// <summary> /// The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. /// </summary> public readonly ImmutableArray<string> Communities; /// <summary> /// A unique read-only string that changes whenever the resource is updated. /// </summary> public readonly string Etag; /// <summary> /// Resource location. /// </summary> public readonly string? Location; /// <summary> /// The name of the resource that is unique within a resource group. This name can be used to access the resource. /// </summary> public readonly string? Name; /// <summary> /// The provisioning state of the route filter rule resource. /// </summary> public readonly string ProvisioningState; /// <summary> /// The rule type of the rule. /// </summary> public readonly string RouteFilterRuleType; [OutputConstructor] private GetRouteFilterRuleResult( string access, ImmutableArray<string> communities, string etag, string? location, string? name, string provisioningState, string routeFilterRuleType) { Access = access; Communities = communities; Etag = etag; Location = location; Name = name; ProvisioningState = provisioningState; RouteFilterRuleType = routeFilterRuleType; } } }
31.475728
195
0.599321
[ "Apache-2.0" ]
test-wiz-sec/pulumi-azure-nextgen
sdk/dotnet/Network/V20190801/GetRouteFilterRule.cs
3,242
C#
using System; namespace zadatak_1 { class Program { static void Main(string[] args) { Console.WriteLine("Zadatak 1"); // Ispisati svako drugo slovu stringu string a = "Bio sam u zoloskom vrtu"; a = a.Replace(" ", ""); for (int i = 0; i < a.Length; i += 4) { Console.WriteLine(a.Substring(i, 2)); } } } }
18.32
53
0.436681
[ "MIT" ]
Csharp2020/csharp2020
dvukasovic/Moj projekt/zadatak_1/Program.cs
460
C#
using System; using AsmResolver.PE.DotNet.Metadata.Tables.Rows; namespace AsmResolver.DotNet.Signatures.Types { /// <summary> /// Represents a sentinel type signature to be used in a method signature, indicating the start of any vararg /// argument types. /// </summary> /// <remarks> /// This type signature should not be used directly. /// </remarks> public class SentinelTypeSignature : TypeSignature { /// <inheritdoc /> public override ElementType ElementType => ElementType.Sentinel; /// <inheritdoc /> public override string Name => "<<SENTINEL>>"; /// <inheritdoc /> public override string? Namespace => null; /// <inheritdoc /> public override IResolutionScope? Scope => null; /// <inheritdoc /> public override bool IsValueType => false; /// <inheritdoc /> public override TypeDefinition? Resolve() => throw new InvalidOperationException(); /// <inheritdoc /> public override ITypeDefOrRef? GetUnderlyingTypeDefOrRef() => null; /// <inheritdoc /> public override bool IsImportedInModule(ModuleDefinition module) => true; /// <inheritdoc /> protected override void WriteContents(BlobSerializationContext context) => context.Writer.WriteByte((byte) ElementType); /// <inheritdoc /> public override TResult AcceptVisitor<TResult>(ITypeSignatureVisitor<TResult> visitor) => visitor.VisitSentinelType(this); /// <inheritdoc /> public override TResult AcceptVisitor<TState, TResult>(ITypeSignatureVisitor<TState, TResult> visitor, TState state) => visitor.VisitSentinelType(this, state); } }
33.415094
113
0.640316
[ "MIT" ]
ds5678/AsmResolver
src/AsmResolver.DotNet/Signatures/Types/SentinelTypeSignature.cs
1,771
C#
using System; using System.Threading.Tasks; using System.Web.Mvc; using Sp.Agent; using Sp.Samples.Agent.Mvc.Models; using Resource = Sp.Samples.Agent.Mvc.App_LocalResources; namespace Sp.Samples.Agent.Mvc.Controllers { #if MVC4TAP // The following code requires // a) MVC 4 or later // b) C# async keyword support, which requires both: // - VS2012/the C# 5.0 compiler // - either target .NET 4.5 to get native support or target .NET 4.0 and add the AsyncTargetingPack‎ NuGetPackage public class ActivationController : Controller { // // POST: /Activation/Add [ValidateAntiForgeryToken] [HttpPost] public async Task<ActionResult> Add( ActivationModel model ) { if ( !ModelState.IsValid ) return View( model ); if ( PostTokenIsMostRecentlySubmittedOne( model.PostToken ) ) { // Resubmits get bounced with an error message (only a refresh will generate a new token)- client side JS should prevent this from being a normal occurrence ModelState.AddModelError( "", Resource.Controllers.ActivationController.AlreadySubmittedErrorMessage ); return View( model ); } // Prevent any resubmits (minus ones just for validation purposes) as that could result in another activation taking place from Software Potential service's perspective StashLastRequestToken( model.PostToken ); try { await SpAgent.Product.Activation.OnlineActivateAsync( model.ActivationKey ); } catch ( Exception ex ) { ModelState.AddModelError( "", string.Format( Resource.Controllers.ActivationController.FailureMessage, model.ActivationKey, ex.Message ) ); // Re-render the page (with a new PostToken so that a form resubmission will pass the PostToken validation) return View( new ActivationModel { PostToken = Guid.NewGuid(), ActivationKey = model.ActivationKey } ); } // Redirect as per PRG to prevent resubmits return RedirectToAction( "Success" ); } #else // The following code has a low bar in terms of dependencies:- // a) VS2010 or later // b) MVC 3 or later // Yes, it really is the idiomatic way to have an Action call an Async Task as part of its activities. // If at all possible, we recommend using the version above public class ActivationController : AsyncController { #region MVC3 pre Task Async support translation of code above, please do all you can to use the C# async version instead // // POST: /Activation/Add [ValidateAntiForgeryToken] [HttpPost] public void AddAsync( ActivationModel model ) { AsyncManager.Parameters[ "activationModel" ] = model; if (!ModelState.IsValid) { AsyncManager.Parameters["validationError"] = true; return; } if ( PostTokenIsMostRecentlySubmittedOne( model.PostToken ) ) { // Resubmits get bounced with an error message (only a refresh will generate a new token)- client side JS should prevent this from being a normal occurrence ModelState.AddModelError( "", Resource.Controllers.ActivationController.AlreadySubmittedErrorMessage ); AsyncManager.Parameters[ "validationError" ] = true; return; } // Prevent any resubmits (minus ones just for validation purposes) as that could result in another activation taking place from Software Potential service's perspective StashLastRequestToken( model.PostToken ); AsyncManager.OutstandingOperations.Increment(); AsyncManager.Parameters[ "validationError" ] = false; AsyncManager.Parameters[ "activationTask" ] = SpAgent.Product.Activation.OnlineActivateAsync( model.ActivationKey ) .ContinueWith( task => { AsyncManager.OutstandingOperations.Decrement(); if ( task.IsFaulted ) throw task.Exception; } ); } public ActionResult AddCompleted( Task activationTask, ActivationModel activationModel, bool validationError ) { if ( validationError ) return View( activationModel ); try { activationTask.Wait(); } catch ( Exception ex ) { string exceptionMessage = ex is AggregateException ? ((AggregateException)ex).Flatten().InnerException.Message : ex.Message; ModelState.AddModelError( "", string.Format( Resource.Controllers.ActivationController.FailureMessage, activationModel.ActivationKey, exceptionMessage ) ); // Re-render the page (with a new PostToken so that a form resubmission will pass the PostToken validation) return View( new ActivationModel { PostToken = Guid.NewGuid(), ActivationKey = activationModel.ActivationKey } ); } // Redirect as per PRG to prevent resubmits return RedirectToAction( "Success" ); } #endregion #endif // // GET: /Activation/ public ActionResult Index() { return RedirectToAction( "Add" ); } // // GET: /Activation/Add public ActionResult Add() { return View( new ActivationModel { PostToken = Guid.NewGuid() } ); } // // GET: /Activation/Success public ActionResult Success() { return View(); } void StashLastRequestToken( Guid token ) { Session[ "LASTTOKEN" ] = token; } bool PostTokenIsMostRecentlySubmittedOne( Guid token ) { var lastToken = Session[ "LASTTOKEN" ] as Guid?; return lastToken == token; } } }
34.172185
171
0.725
[ "BSD-3-Clause" ]
SoftwarePotential/samples
Licensing/FullFramework/MVC/Sp.Samples.Agent.Mvc/Controllers/ActivationController.cs
5,164
C#
namespace FrameworkTester.ViewModels.Interfaces { public interface IWinBioEnrollSelectViewModel : IWinBioViewModel { } }
17.75
69
0.725352
[ "MIT" ]
poseidonjm/WinBiometricDotNet
examples/FrameworkTester/ViewModels/Interfaces/IWinBioEnrollSelectViewModel.cs
144
C#
namespace openLSEService { partial class DebugHost { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form 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.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DebugHost)); this.LabelNotice = new System.Windows.Forms.Label(); this.m_notifyIcon = new System.Windows.Forms.NotifyIcon(this.components); this.m_contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.m_showToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.m_toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.m_exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.m_contextMenuStrip.SuspendLayout(); this.SuspendLayout(); // // LabelNotice // this.LabelNotice.Dock = System.Windows.Forms.DockStyle.Fill; this.LabelNotice.Location = new System.Drawing.Point(10, 10); this.LabelNotice.Name = "LabelNotice"; this.LabelNotice.Size = new System.Drawing.Size(324, 53); this.LabelNotice.TabIndex = 1; this.LabelNotice.Text = resources.GetString("LabelNotice.Text"); this.LabelNotice.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // m_notifyIcon // this.m_notifyIcon.ContextMenuStrip = this.m_contextMenuStrip; this.m_notifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("m_notifyIcon.Icon"))); this.m_notifyIcon.Text = "{0} (Debug Mode)"; this.m_notifyIcon.Visible = true; // // m_contextMenuStrip // this.m_contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.m_showToolStripMenuItem, this.m_toolStripSeparator1, this.m_exitToolStripMenuItem}); this.m_contextMenuStrip.Name = "contextMenuStrip"; this.m_contextMenuStrip.ShowImageMargin = false; this.m_contextMenuStrip.Size = new System.Drawing.Size(85, 54); // // m_showToolStripMenuItem // this.m_showToolStripMenuItem.Name = "m_showToolStripMenuItem"; this.m_showToolStripMenuItem.Size = new System.Drawing.Size(84, 22); this.m_showToolStripMenuItem.Text = "Show"; this.m_showToolStripMenuItem.Click += new System.EventHandler(this.ShowToolStripMenuItem_Click); // // m_toolStripSeparator1 // this.m_toolStripSeparator1.Name = "m_toolStripSeparator1"; this.m_toolStripSeparator1.Size = new System.Drawing.Size(81, 6); // // m_exitToolStripMenuItem // this.m_exitToolStripMenuItem.Name = "m_exitToolStripMenuItem"; this.m_exitToolStripMenuItem.Size = new System.Drawing.Size(84, 22); this.m_exitToolStripMenuItem.Text = "Exit {0}"; this.m_exitToolStripMenuItem.Click += new System.EventHandler(this.ExitToolStripMenuItem_Click); // // DebugHost // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(344, 73); this.Controls.Add(this.LabelNotice); this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.Name = "DebugHost"; this.Padding = new System.Windows.Forms.Padding(10); this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "{0} (Debug Mode)"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DebugHost_FormClosing); this.Load += new System.EventHandler(this.DebugHost_Load); this.Resize += new System.EventHandler(this.DebugHost_Resize); this.m_contextMenuStrip.ResumeLayout(false); this.ResumeLayout(false); } #endregion private System.Windows.Forms.Label LabelNotice; private System.Windows.Forms.NotifyIcon m_notifyIcon; private System.Windows.Forms.ContextMenuStrip m_contextMenuStrip; private System.Windows.Forms.ToolStripMenuItem m_showToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator m_toolStripSeparator1; private System.Windows.Forms.ToolStripMenuItem m_exitToolStripMenuItem; } }
49
147
0.632996
[ "MIT" ]
kdjones/openLSE
openLSEService/DebugHost.Designer.cs
5,831
C#
using System; using System.Collections.Generic; using System.Data; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; using Cosmos.Data.Statements; using QueryOneType = Cosmos.Dapper.Core.DapperImplementor.QueryOneType; namespace Cosmos.Dapper.Core { public partial class DapperConnector { /// <summary> /// Delete by given condition /// </summary> /// <param name="predicate"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public bool Delete<T>(Expression<Func<T, bool>> predicate, IDbTransaction transaction, ISQLPredicate[] filters = null) where T : class => _proxy.Delete(Connection, predicate, transaction, filters); /// <summary> /// Delete by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<bool> DeleteAsync<T>(Expression<Func<T, bool>> predicate, IDbTransaction transaction, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.DeleteAsync(Connection, predicate, transaction, filters, cancellationToken); /// <summary> /// Delete by given condition /// </summary> /// <param name="predicate"></param> /// <param name="filters"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public bool Delete<T>(Expression<Func<T, bool>> predicate, ISQLPredicate[] filters = null) where T : class => _proxy.Delete(Connection, predicate, Transaction, filters); /// <summary> /// Delete by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<bool> DeleteAsync<T>(Expression<Func<T, bool>> predicate, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.DeleteAsync(Connection, predicate, Transaction, filters, cancellationToken); /// <summary> /// Get one entity by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="transaction"></param> /// <param name="filter"></param> /// <param name="buffered"></param> /// <param name="type"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public T GetOne<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, IDbTransaction transaction, ISQLPredicate[] filter = null, bool buffered = true, QueryOneType type = QueryOneType.FirstOrDefault) where T : class => _proxy.GetOne(Connection, predicate, sortSet, Transaction, filter, buffered, type); /// <summary> /// Get one entity by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="type"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<T> GetOneAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, IDbTransaction transaction, ISQLPredicate[] filters = null, QueryOneType type = QueryOneType.FirstOrDefault, CancellationToken cancellationToken = default) where T : class => _proxy.GetOneAsync(Connection, predicate, sortSet, Transaction, filters, type, cancellationToken); /// <summary> /// Get one entity by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <param name="type"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public T GetOne<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, ISQLPredicate[] filters = null, bool buffered = true, QueryOneType type = QueryOneType.FirstOrDefault) where T : class => _proxy.GetOne(Connection, predicate, sortSet, Transaction, filters, buffered, type); /// <summary> /// Get one entity by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="filters"></param> /// <param name="type"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<T> GetOneAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, ISQLPredicate[] filters = null, QueryOneType type = QueryOneType.FirstOrDefault, CancellationToken cancellationToken = default) where T : class => _proxy.GetOneAsync(Connection, predicate, sortSet, Transaction, filters, type, cancellationToken); /// <summary> /// Get first entity by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public T First<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, IDbTransaction transaction, ISQLPredicate[] filters = null, bool buffered = true) where T : class => _proxy.GetOne(Connection, predicate, sortSet, transaction, filters, buffered, QueryOneType.First); /// <summary> /// Get first entity by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<T> FirstAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, IDbTransaction transaction, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.GetOneAsync(Connection, predicate, sortSet, transaction, filters, QueryOneType.First, cancellationToken); /// <summary> /// Get first entity by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public T First<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, ISQLPredicate[] filters = null, bool buffered = true) where T : class => _proxy.GetOne(Connection, predicate, sortSet, Transaction, filters, buffered, QueryOneType.First); /// <summary> /// Get first entity by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<T> FirstAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.GetOneAsync(Connection, predicate, sortSet, Transaction, filters, QueryOneType.First, cancellationToken); /// <summary> /// Get first entity or default by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public T FirstOrDefault<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, IDbTransaction transaction, ISQLPredicate[] filters = null, bool buffered = true) where T : class => _proxy.GetOne(Connection, predicate, sortSet, transaction, filters, buffered, QueryOneType.FirstOrDefault); /// <summary> /// Get first entity or default by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<T> FirstOrDefaultAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, IDbTransaction transaction, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.GetOneAsync(Connection, predicate, sortSet, transaction, filters, QueryOneType.FirstOrDefault, cancellationToken); /// <summary> /// Get first entity or default by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public T FirstOrDefault<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, ISQLPredicate[] filters = null, bool buffered = true) where T : class => _proxy.GetOne(Connection, predicate, sortSet, Transaction, filters, buffered, QueryOneType.FirstOrDefault); /// <summary> /// Get first entity or default by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<T> FirstOrDefaultAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.GetOneAsync(Connection, predicate, sortSet, Transaction, filters, QueryOneType.FirstOrDefault, cancellationToken); /// <summary> /// Get single entity by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public T Single<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, IDbTransaction transaction, ISQLPredicate[] filters = null, bool buffered = true) where T : class => _proxy.GetOne(Connection, predicate, sortSet, transaction, filters, buffered, QueryOneType.Single); /// <summary> /// Get single entity by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<T> SingleAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, IDbTransaction transaction, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.GetOneAsync(Connection, predicate, sortSet, transaction, filters, QueryOneType.Single, cancellationToken); /// <summary> /// Get single entity by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public T Single<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, ISQLPredicate[] filters = null, bool buffered = true) where T : class => _proxy.GetOne(Connection, predicate, sortSet, Transaction, filters, buffered, QueryOneType.Single); /// <summary> /// Get single entity by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<T> SingleAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.GetOneAsync(Connection, predicate, sortSet, Transaction, filters, QueryOneType.Single, cancellationToken); /// <summary> /// Get single entity or default by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public T SingleOrDefault<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, IDbTransaction transaction, ISQLPredicate[] filters = null, bool buffered = true) where T : class => _proxy.GetOne(Connection, predicate, sortSet, transaction, filters, buffered, QueryOneType.SingleOrDefault); /// <summary> /// Get single entity or default by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<T> SingleOrDefaultAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, IDbTransaction transaction, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.GetOneAsync(Connection, predicate, sortSet, transaction, filters, QueryOneType.SingleOrDefault, cancellationToken); /// <summary> /// Get single entity or default by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public T SingleOrDefault<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, ISQLPredicate[] filters = null, bool buffered = true) where T : class => _proxy.GetOne(Connection, predicate, sortSet, Transaction, filters, buffered, QueryOneType.SingleOrDefault); /// <summary> /// Get single entity or default by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sortSet"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<T> SingleOrDefaultAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sortSet, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.GetOneAsync(Connection, predicate, sortSet, Transaction, filters, QueryOneType.SingleOrDefault, cancellationToken); /// <summary> /// Get a list of entity by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sort"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public IEnumerable<T> GetList<T>(Expression<Func<T, bool>> predicate, SQLSortSet sort, IDbTransaction transaction, ISQLPredicate[] filters = null, bool buffered = true) where T : class => _proxy.GetList(Connection, predicate, sort, transaction, filters, buffered); /// <summary> /// Get a list of entity by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sort"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<IEnumerable<T>> GetListAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sort, IDbTransaction transaction, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.GetListAsync(Connection, predicate, sort, transaction, filters, cancellationToken); /// <summary> /// Get a list of entity by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sort"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public IEnumerable<T> GetList<T>(Expression<Func<T, bool>> predicate, SQLSortSet sort, ISQLPredicate[] filters = null, bool buffered = true) where T : class => _proxy.GetList(Connection, predicate, sort, Transaction, filters, buffered); /// <summary> /// Get a list of entity by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sort"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<IEnumerable<T>> GetListAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sort, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.GetListAsync(Connection, predicate, sort, Transaction, filters, cancellationToken); /// <summary> /// Get a paged list of entity by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sort"></param> /// <param name="pageNumber"></param> /// <param name="pageSize"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public IEnumerable<T> GetPage<T>(Expression<Func<T, bool>> predicate, SQLSortSet sort, int pageNumber, int pageSize, IDbTransaction transaction, ISQLPredicate[] filters = null, bool buffered = true) where T : class => _proxy.GetPage(Connection, predicate, sort, pageNumber, pageSize, transaction, filters, buffered); /// <summary> /// Get a paged list of entity by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sort"></param> /// <param name="pageNumber"></param> /// <param name="pageSize"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<IEnumerable<T>> GetPageAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sort, int pageNumber, int pageSize, IDbTransaction transaction, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.GetPageAsync(Connection, predicate, sort, pageNumber, pageSize, transaction, filters, cancellationToken); /// <summary> /// Get a paged list of entity by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sort"></param> /// <param name="pageNumber"></param> /// <param name="pageSize"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public IEnumerable<T> GetPage<T>(Expression<Func<T, bool>> predicate, SQLSortSet sort, int pageNumber, int pageSize, ISQLPredicate[] filters = null, bool buffered = true) where T : class => _proxy.GetPage(Connection, predicate, sort, pageNumber, pageSize, Transaction, filters, buffered); /// <summary> /// Get a paged list of entity by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sort"></param> /// <param name="pageNumber"></param> /// <param name="pageSize"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<IEnumerable<T>> GetPageAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sort, int pageNumber, int pageSize, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.GetPageAsync(Connection, predicate, sort, pageNumber, pageSize, Transaction, filters, cancellationToken); /// <summary> /// Get a collection of entity by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sort"></param> /// <param name="limitFrom"></param> /// <param name="limitTo"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public IEnumerable<T> GetSet<T>(Expression<Func<T, bool>> predicate, SQLSortSet sort, int limitFrom, int limitTo, IDbTransaction transaction, ISQLPredicate[] filters = null, bool buffered = true) where T : class => _proxy.GetSet(Connection, predicate, sort, limitFrom, limitTo, transaction, filters, buffered); /// <summary> /// Get a collection of entity by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sort"></param> /// <param name="limitFrom"></param> /// <param name="limitTo"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<IEnumerable<T>> GetSetAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sort, int limitFrom, int limitTo, IDbTransaction transaction, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.GetSetAsync(Connection, predicate, sort, limitFrom, limitTo, transaction, filters, cancellationToken); /// <summary> /// Get a collection of entity by given condition /// </summary> /// <param name="predicate"></param> /// <param name="sort"></param> /// <param name="limitFrom"></param> /// <param name="limitTo"></param> /// <param name="filters"></param> /// <param name="buffered"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public IEnumerable<T> GetSet<T>(Expression<Func<T, bool>> predicate, SQLSortSet sort, int limitFrom, int limitTo, ISQLPredicate[] filters = null, bool buffered = true) where T : class => _proxy.GetSet(Connection, predicate, sort, limitFrom, limitTo, Transaction, filters, buffered); /// <summary> /// Get a collection of entity by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="sort"></param> /// <param name="limitFrom"></param> /// <param name="limitTo"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<IEnumerable<T>> GetSetAsync<T>(Expression<Func<T, bool>> predicate, SQLSortSet sort, int limitFrom, int limitTo, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.GetSetAsync(Connection, predicate, sort, limitFrom, limitTo, Transaction, filters, cancellationToken); /// <summary> /// Get count by given condition /// </summary> /// <param name="predicate"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public int Count<T>(Expression<Func<T, bool>> predicate, IDbTransaction transaction, ISQLPredicate[] filters = null) where T : class => _proxy.Count(Connection, predicate, transaction, filters); /// <summary> /// Get count by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="transaction"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<int> CountAsync<T>(Expression<Func<T, bool>> predicate, IDbTransaction transaction, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.CountAsync(Connection, predicate, transaction, filters, cancellationToken); /// <summary> /// Get count by given condition /// </summary> /// <param name="predicate"></param> /// <param name="filters"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public int Count<T>(Expression<Func<T, bool>> predicate, ISQLPredicate[] filters = null) where T : class => _proxy.Count(Connection, predicate, Transaction, filters); /// <summary> /// Get count by given condition async /// </summary> /// <param name="predicate"></param> /// <param name="filters"></param> /// <param name="cancellationToken"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public Task<int> CountAsync<T>(Expression<Func<T, bool>> predicate, ISQLPredicate[] filters = null, CancellationToken cancellationToken = default) where T : class => _proxy.CountAsync(Connection, predicate, Transaction, filters, cancellationToken); } }
51.530686
170
0.600112
[ "Apache-2.0" ]
cosmos-loops/cosmos-dapper
src/Cosmos.Dapper/Cosmos/Dapper/Core/DapperConnector.DynamicExpression.cs
28,548
C#
using System; using System.Linq; using System.Numerics; using System.Security.Cryptography; namespace DukptNet { public static class Dukpt { private static readonly BigInteger Reg3Mask = BigInt.FromHex("1FFFFF"); private static readonly BigInteger ShiftRegMask = BigInt.FromHex("100000"); private static readonly BigInteger Reg8Mask = BigInt.FromHex("FFFFFFFFFFE00000"); private static readonly BigInteger Ls16Mask = BigInt.FromHex("FFFFFFFFFFFFFFFF"); private static readonly BigInteger Ms16Mask = BigInt.FromHex("FFFFFFFFFFFFFFFF0000000000000000"); private static readonly BigInteger KeyMask = BigInt.FromHex("C0C0C0C000000000C0C0C0C000000000"); private static readonly BigInteger PekMask = BigInt.FromHex("FF00000000000000FF"); private static readonly BigInteger KsnMask = BigInt.FromHex("FFFFFFFFFFFFFFE00000"); private static readonly BigInteger DekMask = BigInt.FromHex("0000000000FF00000000000000FF0000"); // Used by IDTECH public static BigInteger CreateBdk(BigInteger key1, BigInteger key2) { return key1 ^ key2; } public static BigInteger CreateIpek(BigInteger ksn, BigInteger bdk) { return Transform("TripleDES", true, bdk, (ksn & KsnMask) >> 16) << 64 | Transform("TripleDES", true, bdk ^ KeyMask, (ksn & KsnMask) >> 16); } public static BigInteger CreateSessionKey(BigInteger ipek, BigInteger ksn) { return DeriveKey(ipek, ksn) ^ PekMask; } // Issue #7 Added in the handling for decrypting IDTech tracks jm97 public static BigInteger CreateSessionKeyIdTech(BigInteger ipek, BigInteger ksn) { var key = DeriveKey(ipek, ksn) ^ DekMask; return Transform("TripleDES", true, key, (key & Ms16Mask) >> 64) << 64 | Transform("TripleDES", true, key, (key & Ls16Mask)); } public static BigInteger DeriveKey(BigInteger ipek, BigInteger ksn) { var ksnReg = ksn & Ls16Mask & Reg8Mask; var curKey = ipek; for (var shiftReg = ShiftRegMask; shiftReg > 0; shiftReg >>= 1) if ((shiftReg & ksn & Reg3Mask) > 0) curKey = GenerateKey(curKey, ksnReg |= shiftReg); return curKey; } public static BigInteger GenerateKey(BigInteger key, BigInteger ksn) { return EncryptRegister(key ^ KeyMask, ksn) << 64 | EncryptRegister(key, ksn); } public static BigInteger EncryptRegister(BigInteger curKey, BigInteger reg8) { return (curKey & Ls16Mask) ^ Transform("DES", true, (curKey & Ms16Mask) >> 64, (curKey & Ls16Mask ^ reg8)); } public static BigInteger Transform(string name, bool encrypt, BigInteger key, BigInteger message) { using (var cipher = SymmetricAlgorithm.Create(name)) { var k = key.GetBytes(); // Credit goes to ichoes (https://github.com/ichoes) for fixing this issue (https://github.com/sgbj/Dukpt.NET/issues/5) // gets the next multiple of 8 cipher.Key = new byte[Math.Max(0, GetNearestWholeMultiple(k.Length, 8) - k.Length)].Concat(key.GetBytes()).ToArray(); cipher.IV = new byte[8]; cipher.Mode = CipherMode.CBC; cipher.Padding = PaddingMode.Zeros; using (var crypto = encrypt ? cipher.CreateEncryptor() : cipher.CreateDecryptor()) { var data = message.GetBytes(); // Added the GetNearestWholeMultiple here. data = new byte[Math.Max(0, GetNearestWholeMultiple(data.Length, 8) - data.Length)].Concat(message.GetBytes()).ToArray(); return BigInt.FromBytes(crypto.TransformFinalBlock(data, 0, data.Length)); } } } // Gets the next multiple of 8 // Works with both scenarios, getting 7 bytes instead of 8 and works when expecting 16 bytes and getting 15. private static int GetNearestWholeMultiple(decimal input, int multiple) { var output = Math.Round(input / multiple); if (output == 0 && input > 0) output += 1; output *= multiple; return (int)output; } public static byte[] Encrypt(string bdk, string ksn, byte[] track) { return Transform("TripleDES", true, CreateSessionKey(CreateIpek( BigInt.FromHex(ksn), BigInt.FromHex(bdk)), BigInt.FromHex(ksn)), BigInt.FromBytes(track)).GetBytes(); } public static byte[] Decrypt(string bdk, string ksn, byte[] track) { return Transform("TripleDES", false, CreateSessionKey(CreateIpek( BigInt.FromHex(ksn), BigInt.FromHex(bdk)), BigInt.FromHex(ksn)), BigInt.FromBytes(track)).GetBytes(); } // Issue #7 Added in the handling for decrypting IDTech tracks jm97 public static byte[] DecryptIdTech(string bdk, string ksn, byte[] track) { return Transform("TripleDES", false, CreateSessionKeyIdTech(CreateIpek( BigInt.FromHex(ksn), BigInt.FromHex(bdk)), BigInt.FromHex(ksn)), BigInt.FromBytes(track)).GetBytes(); } } }
46.394737
141
0.628285
[ "MIT" ]
jm97/Dukpt.NET
Dukpt/Dukpt.cs
5,289
C#
using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using LayerDataReaderWriter.V9; using LevelEditor.Extensibility; namespace LevelEditor.BuiltinValidators { [Export(typeof(IValidator))] [ExportMetadata("Name", "SpriteHelper Tester Validator")] [ExportMetadata("Description", "Validator that unit tests the default SpriteHelper implementation.")] public class SpriteHelperTesterValidator : IValidator { public void Validate(IValidationController controller, LayerBlock[] blocks, IGeometryHelper spriteHelper) { if (blocks.Length == 0) { controller.Report(new ValidationEntry(SeverityLevel.Fatal, "It must have at least one block", null)); return; } var block = blocks[0]; if (block.Elements == null || block.Elements.Length < 2) { controller.Report(new ValidationEntry(SeverityLevel.Fatal, "The first block must have at least two elements", block)); return; } var passed = true; var elem1 = block.Elements[0]; var elem2 = block.Elements[1]; var rect = spriteHelper.GetAxisAlignedBoundingBox(block, elem1); if (passed &= rect.Contains(elem2.Tx, elem2.Ty) == false) controller.Report(new ValidationEntry(SeverityLevel.Info, "Center position of element 2 is not inside transformed bounding box of element 1", block)); if (passed &= spriteHelper.AreColliding(block, elem1, elem2) == false) controller.Report(new ValidationEntry(SeverityLevel.Info, "Element 1 and element 2 are not colliding", block)); if (passed &= spriteHelper.AreColliding(block, elem1, new Point(0.0, 0.0), new Point(1.0, 1.0)) == false) controller.Report(new ValidationEntry(SeverityLevel.Info, "Element 1 does not interset line from 0,0 to 1,1", block)); if (passed &= spriteHelper.AreColliding(block, elem2, new Point(0.0, 1.0), new Point(1.0, 0.0)) == false) controller.Report(new ValidationEntry(SeverityLevel.Info, "Element 2 does not interset line from 0,1 to 1,0", block)); if(passed == false) controller.Report(new ValidationEntry(SeverityLevel.Error, "The sprite helper validator did not pass all the tests", block)); } } }
46.017857
167
0.639891
[ "MIT" ]
bitcraftCoLtd/level-editor
LevelEditor.BuiltinValidators/SpriteHelperTesterValidator.cs
2,579
C#
public class Solution { public int OrangesRotting(int[][] grid) { //BFS with queue approach var neighbours = new []{ new[] {0, 1}, new[] {0, -1}, new[] {1, 0}, new[] {-1, 0}, }; var result = 0; var cur = 0; var ly = grid.Length; var lx = grid[0].Length; var q = new Queue<int[]>(); for(var y = 0; y < ly; ++y){ for(var x = 0; x < lx; ++x){ if(grid[y][x] == 0 || grid[y][x] == 1) continue; q.Enqueue(new []{x, y, 0}); //the 3rd number is to record the minutes } } while(q.Count > 0){ var item = q.Dequeue(); var curx = item[0]; var cury = item[1]; var curm = item[2]; result = Math.Max(result, curm); foreach(var n in neighbours){ if(curx + n[0] >= 0 && curx + n[0] < lx && cury + n[1] >= 0 && cury + n[1] < ly && grid[cury + n[1]][curx + n[0]] == 1){ grid[cury + n[1]][curx + n[0]] = 2; q.Enqueue(new []{curx + n[0], cury + n[1], curm + 1}); } } } for(var y = 0; y< ly; ++y){ for(var x = 0; x < lx; ++x){ if(grid[y][x] == 1) return -1; } } return result; } }
32.860465
95
0.365888
[ "MIT" ]
webigboss/Leetcode
994. Rotting Oranges/994_Original_BFS_Queue.cs
1,413
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("TestUtilities")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("TestUtilities")] [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("bf6a68ce-ef4e-40e4-af2e-ce9bf2b6cfed")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
38.648649
85
0.729371
[ "BSD-2-Clause" ]
KaiqiZhang/continuous-integration
TestUtilities/Properties/AssemblyInfo.cs
1,433
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("08_Prime Number Check")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("08_Prime Number Check")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("413e4280-7fd5-4b02-ac01-b2fd8f7c36fb")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
39.216216
85
0.727085
[ "MIT" ]
jsdelivrbot/Telerik-Academy-Homeworks
Module 1 - Essentials/01_C# Part 1/03_Operators and Expressions/08_Prime Number Check/Properties/AssemblyInfo.cs
1,454
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 AlmaAutoSensitize.Properties { using System; /// <summary> /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. /// </summary> // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. [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> /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. /// </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("AlmaAutoSensitize.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } /// <summary> /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). /// </summary> internal static System.Drawing.Icon iconDefault { get { object obj = ResourceManager.GetObject("iconDefault", resourceCulture); return ((System.Drawing.Icon)(obj)); } } /// <summary> /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). /// </summary> internal static System.Drawing.Icon iconLocked { get { object obj = ResourceManager.GetObject("iconLocked", resourceCulture); return ((System.Drawing.Icon)(obj)); } } /// <summary> /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). /// </summary> internal static System.Drawing.Icon iconUnlocked { get { object obj = ResourceManager.GetObject("iconUnlocked", resourceCulture); return ((System.Drawing.Icon)(obj)); } } } }
44.585106
183
0.611549
[ "Apache-2.0" ]
ponchofiesta/AlmaAutoSensitize
AlmaAutoSensitize/Properties/Resources.Designer.cs
4,204
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.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; using Moq; using NuGet.Test.Utility; using Xunit; namespace NuGet.Protocol.Plugins.Tests { public class PluginDiscovererTests { [Theory] [InlineData(null)] [InlineData("")] [InlineData(" ")] public void Constructor_AcceptsAnyString(string rawPluginPaths) { using (new PluginDiscoverer(rawPluginPaths, Mock.Of<EmbeddedSignatureVerifier>())) { } } [Fact] public void DiscoverAsync_ThrowsForNullVerifier() { var exception = Assert.Throws<ArgumentNullException>( () => new PluginDiscoverer(rawPluginPaths: "", verifier: null)); Assert.Equal("verifier", exception.ParamName); } [Fact] public async Task DiscoverAsync_ThrowsIfCancelled() { using (var discoverer = new PluginDiscoverer( rawPluginPaths: "", verifier: Mock.Of<EmbeddedSignatureVerifier>())) { await Assert.ThrowsAsync<OperationCanceledException>( () => discoverer.DiscoverAsync(new CancellationToken(canceled: true))); } } [Fact] public async Task DiscoverAsync_ThrowsPlatformNotSupportedIfEmbeddedSignatureVerifierIsRequired() { using (var testDirectory = TestDirectory.Create()) { var pluginPath = Path.Combine(testDirectory.Path, "a"); File.WriteAllText(pluginPath, string.Empty); using (var discoverer = new PluginDiscoverer(pluginPath, new FallbackEmbeddedSignatureVerifier())) { var plugins = await discoverer.DiscoverAsync(CancellationToken.None); Assert.Throws<PlatformNotSupportedException>( () => plugins.SingleOrDefault().PluginFile.State.Value); } } } [Fact] public async Task DiscoverAsync_DoesNotThrowIfNoValidFilePathsAndFallbackEmbeddedSignatureVerifier() { using (var discoverer = new PluginDiscoverer( rawPluginPaths: "", verifier: new FallbackEmbeddedSignatureVerifier())) { var pluginFiles = await discoverer.DiscoverAsync(CancellationToken.None); Assert.Empty(pluginFiles); } } [Fact] public async Task DiscoverAsync_PerformsDiscoveryOnlyOnce() { using (var testDirectory = TestDirectory.Create()) { var pluginPath = Path.Combine(testDirectory.Path, "a"); File.WriteAllText(pluginPath, string.Empty); var responses = new Dictionary<string, bool>() { { pluginPath, true } }; var verifierStub = new EmbeddedSignatureVerifierStub(responses); using (var discoverer = new PluginDiscoverer(pluginPath, verifierStub)) { var results = (await discoverer.DiscoverAsync(CancellationToken.None)).ToArray(); foreach (var result in results) { var pluginState = result.PluginFile.State.Value; } Assert.Equal(1, results.Length); Assert.Equal(1, verifierStub.IsValidCallCount); results = (await discoverer.DiscoverAsync(CancellationToken.None)).ToArray(); Assert.Equal(1, results.Length); Assert.Equal(1, verifierStub.IsValidCallCount); } } } [Fact] public async Task DiscoverAsync_SignatureIsVerifiedLazily() { using (var testDirectory = TestDirectory.Create()) { var pluginPath = Path.Combine(testDirectory.Path, "a"); File.WriteAllText(pluginPath, string.Empty); var responses = new Dictionary<string, bool>() { { pluginPath, true } }; var verifierStub = new EmbeddedSignatureVerifierStub(responses); using (var discoverer = new PluginDiscoverer(pluginPath, verifierStub)) { var results = (await discoverer.DiscoverAsync(CancellationToken.None)).ToArray(); Assert.Equal(1, results.Length); Assert.Equal(0, verifierStub.IsValidCallCount); var pluginState = results.SingleOrDefault().PluginFile.State.Value; Assert.Equal(1, verifierStub.IsValidCallCount); } } } [Fact] public async Task DiscoverAsync_HandlesAllPluginFileStates() { using (var testDirectory = TestDirectory.Create()) { var pluginPaths = new[] { "a", "b", "c", "d" } .Select(fileName => Path.Combine(testDirectory.Path, fileName)) .ToArray(); File.WriteAllText(pluginPaths[1], string.Empty); File.WriteAllText(pluginPaths[2], string.Empty); var responses = new Dictionary<string, bool>() { { pluginPaths[0], false }, { pluginPaths[1], false }, { pluginPaths[2], true }, { pluginPaths[3], false }, { "e", true } }; var verifierStub = new EmbeddedSignatureVerifierStub(responses); var rawPluginPaths = string.Join(";", responses.Keys); using (var discoverer = new PluginDiscoverer(rawPluginPaths, verifierStub)) { var results = (await discoverer.DiscoverAsync(CancellationToken.None)).ToArray(); Assert.Equal(5, results.Length); Assert.Equal(pluginPaths[0], results[0].PluginFile.Path); Assert.Equal(PluginFileState.NotFound, results[0].PluginFile.State.Value); Assert.Equal($"A plugin was not found at path '{pluginPaths[0]}'.", results[0].Message); Assert.Equal(pluginPaths[1], results[1].PluginFile.Path); Assert.Equal(PluginFileState.InvalidEmbeddedSignature, results[1].PluginFile.State.Value); Assert.Equal($"The plugin at '{pluginPaths[1]}' did not have a valid embedded signature.", results[1].Message); Assert.Equal(pluginPaths[2], results[2].PluginFile.Path); Assert.Equal(PluginFileState.Valid, results[2].PluginFile.State.Value); Assert.Null(results[2].Message); Assert.Equal(pluginPaths[3], results[3].PluginFile.Path); Assert.Equal(PluginFileState.NotFound, results[3].PluginFile.State.Value); Assert.Equal($"A plugin was not found at path '{pluginPaths[3]}'.", results[3].Message); Assert.Equal("e", results[4].PluginFile.Path); Assert.Equal(PluginFileState.InvalidFilePath, results[4].PluginFile.State.Value); Assert.Equal($"The plugin file path 'e' is invalid.", results[4].Message); } } } [Theory] [InlineData("a")] [InlineData(@"\a")] [InlineData(@".\a")] [InlineData(@"..\a")] public async Task DiscoverAsync_DisallowsNonRootedFilePaths(string pluginPath) { var responses = new Dictionary<string, bool>() { { pluginPath, true } }; var verifierStub = new EmbeddedSignatureVerifierStub(responses); using (var discoverer = new PluginDiscoverer(pluginPath, verifierStub)) { var results = (await discoverer.DiscoverAsync(CancellationToken.None)).ToArray(); Assert.Equal(1, results.Length); Assert.Equal(pluginPath, results[0].PluginFile.Path); Assert.Equal(PluginFileState.InvalidFilePath, results[0].PluginFile.State.Value); } } [Fact] public async Task DiscoverAsync_IsIdempotent() { using (var testDirectory = TestDirectory.Create()) { var pluginPath = Path.Combine(testDirectory.Path, "a"); File.WriteAllText(pluginPath, string.Empty); var verifierSpy = new Mock<EmbeddedSignatureVerifier>(); verifierSpy.Setup(spy => spy.IsValid(It.IsAny<string>())) .Returns(true); using (var discoverer = new PluginDiscoverer(pluginPath, verifierSpy.Object)) { var firstResult = await discoverer.DiscoverAsync(CancellationToken.None); var firstState = firstResult.SingleOrDefault().PluginFile.State.Value; verifierSpy.Verify(spy => spy.IsValid(It.IsAny<string>()), Times.Once); var secondResult = await discoverer.DiscoverAsync(CancellationToken.None); var secondState = secondResult.SingleOrDefault().PluginFile.State.Value; verifierSpy.Verify(spy => spy.IsValid(It.IsAny<string>()), Times.Once); Assert.Same(firstResult, secondResult); } } } private sealed class EmbeddedSignatureVerifierStub : EmbeddedSignatureVerifier { private readonly Dictionary<string, bool> _responses; internal int IsValidCallCount { get; private set; } public EmbeddedSignatureVerifierStub(Dictionary<string, bool> responses) { _responses = responses; } public override bool IsValid(string filePath) { ++IsValidCallCount; bool value; Assert.True(_responses.TryGetValue(filePath, out value)); return value; } } } }
38.479853
131
0.560305
[ "Apache-2.0" ]
CosminRadu/NuGet.Client
test/NuGet.Core.Tests/NuGet.Protocol.Tests/Plugins/PluginDiscovererTests.cs
10,505
C#
/** * Copyright (c) 2008-2020 Bryan Biedenkapp., All Rights Reserved. * MIT Open Source. Use is subject to license terms. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. */ /* * 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. */ /* * Based on code from Lidgren Network v3 * Copyright (C) 2010 Michael Lidgren., All Rights Reserved. * Licensed under MIT License. */ using System; using TridentFramework.RPC.Net.Message; using TridentFramework.RPC.Net.PeerConnection; namespace TridentFramework.RPC.Net.Channel { /// <summary> /// Unreliable sequenced, network receiver /// </summary> internal sealed class UnreliableSequencedReceiver : IReceiverChannel { private int lastReceivedSequenceNumber; /* ** Methods */ /// <summary> /// Initializes a new instance of the <see cref="UnreliableSequencedReceiver"/> class. /// </summary> /// <param name="connection">Connection channel belongs to</param> public UnreliableSequencedReceiver(Connection connection) : base(connection) { // stub } /// <inheritdoc /> public override void ReceiveMessage(IncomingMessage msg) { int nr = msg.SequenceNumber; // ack no matter what connection.QueueAck(msg.ReceivedMessageType, nr); int relate = NetUtility.RelativeSequenceNumber(nr, lastReceivedSequenceNumber); if (relate < 0) return; // drop if late lastReceivedSequenceNumber = nr; peer.ReleaseMessage(msg); } } // internal sealed class NetUnreliableSequencedReceiver : IReceiverChannel } // namespace TridentFramework.RPC.Net.Channel
40.794118
208
0.695025
[ "MIT" ]
gatekeep/Trident.RPC
Net/Channel/UnreliableSequencedReceiver.cs
2,776
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.IO; using System.Globalization; using System.Reflection; using System.Collections.Generic; using System.Diagnostics; namespace System.Resources { // Resource Manager exposes an assembly's resources to an application for // the correct CultureInfo. An example would be localizing text for a // user-visible message. Create a set of resource files listing a name // for a message and its value, compile them using ResGen, put them in // an appropriate place (your assembly manifest(?)), then create a Resource // Manager and query for the name of the message you want. The Resource // Manager will use CultureInfo.GetCurrentUICulture() to look // up a resource for your user's locale settings. // // Users should ideally create a resource file for every culture, or // at least a meaningful subset. The filenames will follow the naming // scheme: // // basename.culture name.resources // // The base name can be the name of your application, or depending on // the granularity desired, possibly the name of each class. The culture // name is determined from CultureInfo's Name property. // An example file name may be MyApp.en-US.resources for // MyApp's US English resources. // // ----------------- // Refactoring Notes // ----------------- // In Feb 08, began first step of refactoring ResourceManager to improve // maintainability (sd changelist 3012100). This resulted in breaking // apart the InternalGetResourceSet "big loop" so that the file-based // and manifest-based lookup was located in separate methods. // In Apr 08, continued refactoring so that file-based and manifest-based // concerns are encapsulated by separate classes. At construction, the // ResourceManager creates one of these classes based on whether the // RM will need to use file-based or manifest-based resources, and // afterwards refers to this through the interface IResourceGroveler. // // Serialization Compat: Ideally, we could have refactored further but // this would have broken serialization compat. For example, the // ResourceManager member UseManifest and UseSatelliteAssem are no // longer relevant on ResourceManager. Similarly, other members could // ideally be moved to the file-based or manifest-based classes // because they are only relevant for those types of lookup. // // Solution now / in the future: // For now, we simply use a mediator class so that we can keep these // members on ResourceManager but allow the file-based and manifest- // based classes to access/set these members in a uniform way. See // ResourceManagerMediator. // We encapsulate fallback logic in a fallback iterator class, so that // this logic isn't duplicated in several methods. // // In the future, we can also look into further factoring and better // design of IResourceGroveler interface to accommodate unused parameters // that don't make sense for either file-based or manifest-based lookup paths. // // Benefits of this refactoring: // - Makes it possible to understand what the ResourceManager does, // which is key for maintainability. // - Makes the ResourceManager more extensible by identifying and // encapsulating what varies // - Unearthed a bug that's been lurking a while in file-based // lookup paths for InternalGetResourceSet if createIfNotExists is // false. // - Reuses logic, e.g. by breaking apart the culture fallback into // the fallback iterator class, we don't have to repeat the // sometimes confusing fallback logic across multiple methods // - Fxcop violations reduced to 1/5th of original count. Most // importantly, code complexity violations disappeared. // - Finally, it got rid of dead code paths. Because the big loop was // so confusing, it masked unused chunks of code. Also, dividing // between file-based and manifest-based allowed functionaliy // unused in silverlight to fall out. // // Note: this type is integral to the construction of exception objects, // and sometimes this has to be done in low memory situtations (OOM) or // to create TypeInitializationExceptions due to failure of a static class // constructor. This type needs to be extremely careful and assume that // any type it references may have previously failed to construct, so statics // belonging to that type may not be initialized. FrameworkEventSource.Log // is one such example. // public partial class ResourceManager { internal class CultureNameResourceSetPair { public string? lastCultureName; public ResourceSet? lastResourceSet; } protected string? BaseNameField; protected Assembly? MainAssembly; // Need the assembly manifest sometimes. private Dictionary<string, ResourceSet>? _resourceSets; private string? _moduleDir; // For assembly-ignorant directory location private Type? _locationInfo; // For Assembly or type-based directory layout private Type? _userResourceSet; // Which ResourceSet instance to create private CultureInfo? _neutralResourcesCulture; // For perf optimizations. private CultureNameResourceSetPair? _lastUsedResourceCache; private bool _ignoreCase; // Whether case matters in GetString & GetObject private bool _useManifest; // Use Assembly manifest, or grovel disk. // Whether to fall back to the main assembly or a particular // satellite for the neutral resources. private UltimateResourceFallbackLocation _fallbackLoc; // Version number of satellite assemblies to look for. May be null. private Version? _satelliteContractVersion; private bool _lookedForSatelliteContractVersion; private IResourceGroveler _resourceGroveler = null!; public static readonly int MagicNumber = unchecked((int)0xBEEFCACE); // If only hex had a K... // Version number so ResMgr can get the ideal set of classes for you. // ResMgr header is: // 1) MagicNumber (little endian Int32) // 2) HeaderVersionNumber (little endian Int32) // 3) Num Bytes to skip past ResMgr header (little endian Int32) // 4) IResourceReader type name for this file (bytelength-prefixed UTF-8 String) // 5) ResourceSet type name for this file (bytelength-prefixed UTF8 String) public static readonly int HeaderVersionNumber = 1; // //It would be better if we could use _neutralCulture instead of calling //CultureInfo.InvariantCulture everywhere, but we run into problems with the .cctor. CultureInfo //initializes assembly, which initializes ResourceManager, which tries to get a CultureInfo which isn't //there yet because CultureInfo's class initializer hasn't finished. If we move SystemResMgr off of //Assembly (or at least make it an internal property) we should be able to circumvent this problem. // // private static CultureInfo _neutralCulture = null; // This is our min required ResourceSet type. private static readonly Type s_minResourceSet = typeof(ResourceSet); // These Strings are used to avoid using Reflection in CreateResourceSet. internal const string ResReaderTypeName = "System.Resources.ResourceReader"; internal const string ResSetTypeName = "System.Resources.RuntimeResourceSet"; internal const string ResFileExtension = ".resources"; internal const int ResFileExtensionLength = 10; protected ResourceManager() { _lastUsedResourceCache = new CultureNameResourceSetPair(); ResourceManagerMediator mediator = new ResourceManagerMediator(this); _resourceGroveler = new ManifestBasedResourceGroveler(mediator); } // Constructs a Resource Manager for files beginning with // baseName in the directory specified by resourceDir // or in the current directory. This Assembly-ignorant constructor is // mostly useful for testing your own ResourceSet implementation. // // A good example of a baseName might be "Strings". BaseName // should not end in ".resources". // // Note: System.Windows.Forms uses this method at design time. // private ResourceManager(string baseName, string resourceDir, Type? userResourceSet) { if (null == baseName) throw new ArgumentNullException(nameof(baseName)); if (null == resourceDir) throw new ArgumentNullException(nameof(resourceDir)); BaseNameField = baseName; _moduleDir = resourceDir; _userResourceSet = userResourceSet; _resourceSets = new Dictionary<string, ResourceSet>(); _lastUsedResourceCache = new CultureNameResourceSetPair(); _useManifest = false; ResourceManagerMediator mediator = new ResourceManagerMediator(this); _resourceGroveler = new FileBasedResourceGroveler(mediator); } public ResourceManager(string baseName, Assembly assembly) { if (null == baseName) throw new ArgumentNullException(nameof(baseName)); if (null == assembly) throw new ArgumentNullException(nameof(assembly)); if (!assembly.IsRuntimeImplemented()) throw new ArgumentException(SR.Argument_MustBeRuntimeAssembly); MainAssembly = assembly; BaseNameField = baseName; CommonAssemblyInit(); } public ResourceManager(string baseName, Assembly assembly, Type? usingResourceSet) { if (null == baseName) throw new ArgumentNullException(nameof(baseName)); if (null == assembly) throw new ArgumentNullException(nameof(assembly)); if (!assembly.IsRuntimeImplemented()) throw new ArgumentException(SR.Argument_MustBeRuntimeAssembly); MainAssembly = assembly; BaseNameField = baseName; if (usingResourceSet != null && (usingResourceSet != s_minResourceSet) && !(usingResourceSet.IsSubclassOf(s_minResourceSet))) throw new ArgumentException(SR.Arg_ResMgrNotResSet, nameof(usingResourceSet)); _userResourceSet = usingResourceSet; CommonAssemblyInit(); } public ResourceManager(Type resourceSource) { if (null == resourceSource) throw new ArgumentNullException(nameof(resourceSource)); if (!resourceSource.IsRuntimeImplemented()) throw new ArgumentException(SR.Argument_MustBeRuntimeType); _locationInfo = resourceSource; MainAssembly = _locationInfo.Assembly; BaseNameField = resourceSource.Name; CommonAssemblyInit(); } // Trying to unify code as much as possible, even though having to do a // security check in each constructor prevents it. private void CommonAssemblyInit() { #if FEATURE_APPX || ENABLE_WINRT SetUapConfiguration(); #endif // Now we can use the managed resources even when using PRI's to support the APIs GetObject, GetStream...etc. _useManifest = true; _resourceSets = new Dictionary<string, ResourceSet>(); _lastUsedResourceCache = new CultureNameResourceSetPair(); ResourceManagerMediator mediator = new ResourceManagerMediator(this); _resourceGroveler = new ManifestBasedResourceGroveler(mediator); Debug.Assert(MainAssembly != null); _neutralResourcesCulture = ManifestBasedResourceGroveler.GetNeutralResourcesLanguage(MainAssembly, out _fallbackLoc); } // Gets the base name for the ResourceManager. public virtual string? BaseName { get { return BaseNameField; } } // Whether we should ignore the capitalization of resources when calling // GetString or GetObject. public virtual bool IgnoreCase { get { return _ignoreCase; } set { _ignoreCase = value; } } // Returns the Type of the ResourceSet the ResourceManager uses // to construct ResourceSets. public virtual Type ResourceSetType { get { return (_userResourceSet == null) ? typeof(RuntimeResourceSet) : _userResourceSet; } } protected UltimateResourceFallbackLocation FallbackLocation { get { return _fallbackLoc; } set { _fallbackLoc = value; } } // Tells the ResourceManager to call Close on all ResourceSets and // release all resources. This will shrink your working set by // potentially a substantial amount in a running application. Any // future resource lookups on this ResourceManager will be as // expensive as the very first lookup, since it will need to search // for files and load resources again. // // This may be useful in some complex threading scenarios, where // creating a new ResourceManager isn't quite the correct behavior. public virtual void ReleaseAllResources() { Debug.Assert(_resourceSets != null); Dictionary<string, ResourceSet> localResourceSets = _resourceSets; // If any calls to Close throw, at least leave ourselves in a // consistent state. _resourceSets = new Dictionary<string, ResourceSet>(); _lastUsedResourceCache = new CultureNameResourceSetPair(); lock (localResourceSets) { foreach ((_, ResourceSet resourceSet) in localResourceSets) { resourceSet.Close(); } } } public static ResourceManager CreateFileBasedResourceManager(string baseName, string resourceDir, Type usingResourceSet) { return new ResourceManager(baseName, resourceDir, usingResourceSet); } // Given a CultureInfo, GetResourceFileName generates the name for // the binary file for the given CultureInfo. This method uses // CultureInfo's Name property as part of the file name for all cultures // other than the invariant culture. This method does not touch the disk, // and is used only to construct what a resource file name (suitable for // passing to the ResourceReader constructor) or a manifest resource file // name should look like. // // This method can be overriden to look for a different extension, // such as ".ResX", or a completely different format for naming files. protected virtual string GetResourceFileName(CultureInfo culture) { // If this is the neutral culture, don't include the culture name. if (culture.HasInvariantCultureName) { return BaseNameField + ResFileExtension; } else { CultureInfo.VerifyCultureName(culture.Name, throwException: true); return BaseNameField + "." + culture.Name + ResFileExtension; } } // WARNING: This function must be kept in sync with ResourceFallbackManager.GetEnumerator() // Return the first ResourceSet, based on the first culture ResourceFallbackManager would return internal ResourceSet? GetFirstResourceSet(CultureInfo culture) { // Logic from ResourceFallbackManager.GetEnumerator() if (_neutralResourcesCulture != null && culture.Name == _neutralResourcesCulture.Name) { culture = CultureInfo.InvariantCulture; } if (_lastUsedResourceCache != null) { lock (_lastUsedResourceCache) { if (culture.Name == _lastUsedResourceCache.lastCultureName) return _lastUsedResourceCache.lastResourceSet; } } // Look in the ResourceSet table Dictionary<string, ResourceSet>? localResourceSets = _resourceSets; ResourceSet? rs = null; if (localResourceSets != null) { lock (localResourceSets) { localResourceSets.TryGetValue(culture.Name, out rs); } } if (rs != null) { // update the cache with the most recent ResourceSet if (_lastUsedResourceCache != null) { lock (_lastUsedResourceCache) { _lastUsedResourceCache.lastCultureName = culture.Name; _lastUsedResourceCache.lastResourceSet = rs; } } return rs; } return null; } // Looks up a set of resources for a particular CultureInfo. This is // not useful for most users of the ResourceManager - call // GetString() or GetObject() instead. // // The parameters let you control whether the ResourceSet is created // if it hasn't yet been loaded and if parent CultureInfos should be // loaded as well for resource inheritance. // public virtual ResourceSet? GetResourceSet(CultureInfo culture, bool createIfNotExists, bool tryParents) { if (null == culture) throw new ArgumentNullException(nameof(culture)); Dictionary<string, ResourceSet>? localResourceSets = _resourceSets; ResourceSet? rs; if (localResourceSets != null) { lock (localResourceSets) { if (localResourceSets.TryGetValue(culture.Name, out rs)) return rs; } } if (_useManifest && culture.HasInvariantCultureName) { string fileName = GetResourceFileName(culture); Debug.Assert(MainAssembly != null); Stream? stream = MainAssembly.GetManifestResourceStream(_locationInfo!, fileName); if (createIfNotExists && stream != null) { rs = ((ManifestBasedResourceGroveler)_resourceGroveler).CreateResourceSet(stream, MainAssembly); Debug.Assert(localResourceSets != null); AddResourceSet(localResourceSets, culture.Name, ref rs); return rs; } } return InternalGetResourceSet(culture, createIfNotExists, tryParents); } // InternalGetResourceSet is a non-threadsafe method where all the logic // for getting a resource set lives. Access to it is controlled by // threadsafe methods such as GetResourceSet, GetString, & GetObject. // This will take a minimal number of locks. protected virtual ResourceSet? InternalGetResourceSet(CultureInfo culture, bool createIfNotExists, bool tryParents) { Debug.Assert(culture != null, "culture != null"); Debug.Assert(_resourceSets != null); Dictionary<string, ResourceSet> localResourceSets = _resourceSets; ResourceSet? rs = null; CultureInfo? foundCulture = null; lock (localResourceSets) { if (localResourceSets.TryGetValue(culture.Name, out rs)) { return rs; } } ResourceFallbackManager mgr = new ResourceFallbackManager(culture, _neutralResourcesCulture, tryParents); foreach (CultureInfo currentCultureInfo in mgr) { lock (localResourceSets) { if (localResourceSets.TryGetValue(currentCultureInfo.Name, out rs)) { // we need to update the cache if we fellback if (culture != currentCultureInfo) foundCulture = currentCultureInfo; break; } } // InternalGetResourceSet will never be threadsafe. However, it must // be protected against reentrancy from the SAME THREAD. (ie, calling // GetSatelliteAssembly may send some window messages or trigger the // Assembly load event, which could fail then call back into the // ResourceManager). It's happened. rs = _resourceGroveler.GrovelForResourceSet(currentCultureInfo, localResourceSets, tryParents, createIfNotExists); // found a ResourceSet; we're done if (rs != null) { foundCulture = currentCultureInfo; break; } } if (rs != null && foundCulture != null) { // add entries to the cache for the cultures we have gone through // currentCultureInfo now refers to the culture that had resources. // update cultures starting from requested culture up to the culture // that had resources. foreach (CultureInfo updateCultureInfo in mgr) { AddResourceSet(localResourceSets, updateCultureInfo.Name, ref rs); // stop when we've added current or reached invariant (top of chain) if (updateCultureInfo == foundCulture) { break; } } } return rs; } // Simple helper to ease maintenance and improve readability. private static void AddResourceSet(Dictionary<string, ResourceSet> localResourceSets, string cultureName, ref ResourceSet rs) { // InternalGetResourceSet is both recursive and reentrant - // assembly load callbacks in particular are a way we can call // back into the ResourceManager in unexpectedly on the same thread. lock (localResourceSets) { // If another thread added this culture, return that. ResourceSet? lostRace; if (localResourceSets.TryGetValue(cultureName, out lostRace)) { if (!object.ReferenceEquals(lostRace, rs)) { // Note: In certain cases, we can be trying to add a ResourceSet for multiple // cultures on one thread, while a second thread added another ResourceSet for one // of those cultures. If there is a race condition we must make sure our ResourceSet // isn't in our dictionary before closing it. if (!localResourceSets.ContainsValue(rs)) rs.Dispose(); rs = lostRace; } } else { localResourceSets.Add(cultureName, rs); } } } protected static Version? GetSatelliteContractVersion(Assembly a) { // Ensure that the assembly reference is not null if (a == null) { throw new ArgumentNullException(nameof(a), SR.ArgumentNull_Assembly); } string? v = a.GetCustomAttribute<SatelliteContractVersionAttribute>()?.Version; if (v == null) { // Return null. The calling code will use the assembly version instead to avoid potential type // and library loads caused by CA lookup. return null; } if (!Version.TryParse(v, out Version? version)) { throw new ArgumentException(SR.Format(SR.Arg_InvalidSatelliteContract_Asm_Ver, a, v)); } return version; } protected static CultureInfo GetNeutralResourcesLanguage(Assembly a) { // This method should be obsolete - replace it with the one below. // Unfortunately, we made it protected. return ManifestBasedResourceGroveler.GetNeutralResourcesLanguage(a, out _); } // IGNORES VERSION internal static bool IsDefaultType(string asmTypeName, string typeName) { Debug.Assert(asmTypeName != null, "asmTypeName was unexpectedly null"); // First, compare type names int comma = asmTypeName.IndexOf(','); if (((comma == -1) ? asmTypeName.Length : comma) != typeName.Length) return false; // case sensitive if (string.Compare(asmTypeName, 0, typeName, 0, typeName.Length, StringComparison.Ordinal) != 0) return false; if (comma == -1) return true; // Now, compare assembly display names (IGNORES VERSION AND PROCESSORARCHITECTURE) // also, for mscorlib ignores everything, since that's what the binder is going to do while (char.IsWhiteSpace(asmTypeName[++comma])) ; // case insensitive AssemblyName an = new AssemblyName(asmTypeName.Substring(comma)); // to match IsMscorlib() in VM return string.Equals(an.Name, "mscorlib", StringComparison.OrdinalIgnoreCase); } // Looks up a resource value for a particular name. Looks in the // current thread's CultureInfo, and if not found, all parent CultureInfos. // Returns null if the resource wasn't found. // public virtual string? GetString(string name) { return GetString(name, (CultureInfo?)null); } // Looks up a resource value for a particular name. Looks in the // specified CultureInfo, and if not found, all parent CultureInfos. // Returns null if the resource wasn't found. // public virtual string? GetString(string name, CultureInfo? culture) { if (null == name) throw new ArgumentNullException(nameof(name)); #if FEATURE_APPX || ENABLE_WINRT if (_useUapResourceManagement) { // Throws WinRT hresults. Debug.Assert(_neutralResourcesCulture != null); return GetStringFromPRI(name, culture, _neutralResourcesCulture.Name); } #endif if (culture == null) { culture = CultureInfo.CurrentUICulture; } ResourceSet? last = GetFirstResourceSet(culture); if (last != null) { string? value = last.GetString(name, _ignoreCase); if (value != null) return value; } // This is the CultureInfo hierarchy traversal code for resource // lookups, similar but necessarily orthogonal to the ResourceSet // lookup logic. ResourceFallbackManager mgr = new ResourceFallbackManager(culture, _neutralResourcesCulture, true); foreach (CultureInfo currentCultureInfo in mgr) { ResourceSet? rs = InternalGetResourceSet(currentCultureInfo, true, true); if (rs == null) break; if (rs != last) { string? value = rs.GetString(name, _ignoreCase); if (value != null) { // update last used ResourceSet if (_lastUsedResourceCache != null) { lock (_lastUsedResourceCache) { _lastUsedResourceCache.lastCultureName = currentCultureInfo.Name; _lastUsedResourceCache.lastResourceSet = rs; } } return value; } last = rs; } } return null; } // Looks up a resource value for a particular name. Looks in the // current thread's CultureInfo, and if not found, all parent CultureInfos. // Returns null if the resource wasn't found. // public virtual object? GetObject(string name) { return GetObject(name, (CultureInfo?)null, true); } // Looks up a resource value for a particular name. Looks in the // specified CultureInfo, and if not found, all parent CultureInfos. // Returns null if the resource wasn't found. public virtual object? GetObject(string name, CultureInfo culture) { return GetObject(name, culture, true); } private object? GetObject(string name, CultureInfo? culture, bool wrapUnmanagedMemStream) { if (null == name) throw new ArgumentNullException(nameof(name)); if (null == culture) { culture = CultureInfo.CurrentUICulture; } ResourceSet? last = GetFirstResourceSet(culture); if (last != null) { object? value = last.GetObject(name, _ignoreCase); if (value != null) { if (value is UnmanagedMemoryStream stream && wrapUnmanagedMemStream) return new UnmanagedMemoryStreamWrapper(stream); else return value; } } // This is the CultureInfo hierarchy traversal code for resource // lookups, similar but necessarily orthogonal to the ResourceSet // lookup logic. ResourceFallbackManager mgr = new ResourceFallbackManager(culture, _neutralResourcesCulture, true); foreach (CultureInfo currentCultureInfo in mgr) { ResourceSet? rs = InternalGetResourceSet(currentCultureInfo, true, true); if (rs == null) break; if (rs != last) { object? value = rs.GetObject(name, _ignoreCase); if (value != null) { // update the last used ResourceSet if (_lastUsedResourceCache != null) { lock (_lastUsedResourceCache) { _lastUsedResourceCache.lastCultureName = currentCultureInfo.Name; _lastUsedResourceCache.lastResourceSet = rs; } } if (value is UnmanagedMemoryStream stream && wrapUnmanagedMemStream) return new UnmanagedMemoryStreamWrapper(stream); else return value; } last = rs; } } return null; } public UnmanagedMemoryStream? GetStream(string name) { return GetStream(name, (CultureInfo?)null); } public UnmanagedMemoryStream? GetStream(string name, CultureInfo? culture) { object? obj = GetObject(name, culture, false); UnmanagedMemoryStream? ums = obj as UnmanagedMemoryStream; if (ums == null && obj != null) throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResourceNotStream_Name, name)); return ums; } internal class ResourceManagerMediator { private ResourceManager _rm; internal ResourceManagerMediator(ResourceManager rm) { if (rm == null) { throw new ArgumentNullException(nameof(rm)); } _rm = rm; } // NEEDED ONLY BY FILE-BASED internal string? ModuleDir { get { return _rm._moduleDir; } } // NEEDED BOTH BY FILE-BASED AND ASSEMBLY-BASED internal Type? LocationInfo { get { return _rm._locationInfo; } } internal Type? UserResourceSet { get { return _rm._userResourceSet; } } internal string? BaseNameField { get { return _rm.BaseNameField; } } internal CultureInfo? NeutralResourcesCulture { get { return _rm._neutralResourcesCulture; } set { _rm._neutralResourcesCulture = value; } } internal string GetResourceFileName(CultureInfo culture) { return _rm.GetResourceFileName(culture); } // NEEDED ONLY BY ASSEMBLY-BASED internal bool LookedForSatelliteContractVersion { get { return _rm._lookedForSatelliteContractVersion; } set { _rm._lookedForSatelliteContractVersion = value; } } internal Version? SatelliteContractVersion { get { return _rm._satelliteContractVersion; } set { _rm._satelliteContractVersion = value; } } internal Version? ObtainSatelliteContractVersion(Assembly a) { return ResourceManager.GetSatelliteContractVersion(a); } internal UltimateResourceFallbackLocation FallbackLoc { get { return _rm.FallbackLocation; } set { _rm._fallbackLoc = value; } } internal Assembly? MainAssembly { get { return _rm.MainAssembly; } } // this is weird because we have BaseNameField accessor above, but we're sticking // with it for compat. internal string? BaseName { get { return _rm.BaseName; } } } } }
41.80355
137
0.589259
[ "MIT" ]
85331479/coreclr
src/System.Private.CoreLib/shared/System/Resources/ResourceManager.cs
35,324
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 Runner.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public global::System.Collections.Specialized.StringCollection AcceptanceTests { get { return ((global::System.Collections.Specialized.StringCollection)(this["AcceptanceTests"])); } set { this["AcceptanceTests"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("")] public string AcceptanceTestsFolder { get { return ((string)(this["AcceptanceTestsFolder"])); } set { this["AcceptanceTestsFolder"] = value; } } } }
39.7
151
0.58136
[ "Unlicense" ]
Malavos/Runner
Runner/Properties/Settings.Designer.cs
1,987
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 Login_Project { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void label1_Click(object sender, EventArgs e) { } private void Form1_Load(object sender, EventArgs e) { } } }
17.354839
61
0.637546
[ "MIT" ]
jeffhawk/Login_Project
Login_Project/Form1.cs
540
C#
using System.Text.Json.Serialization; namespace Horizon.Payment.Alipay.Domain { /// <summary> /// StoreOrderGood Data Structure. /// </summary> public class StoreOrderGood : AlipayObject { /// <summary> /// 商品的ID /// </summary> [JsonPropertyName("item_id")] public string ItemId { get; set; } /// <summary> /// 商品数量 /// </summary> [JsonPropertyName("quantity")] public long Quantity { get; set; } /// <summary> /// 规格的ID /// </summary> [JsonPropertyName("sku_id")] public string SkuId { get; set; } } }
22.448276
46
0.52381
[ "Apache-2.0" ]
bluexray/Horizon.Sample
Horizon.Payment.Alipay/Domain/StoreOrderGood.cs
673
C#
namespace SpaBing.Models { public class VideoSearchResult : ISearchResult { public string Name { get; set; } public string Description { get; set; } public string ContentUrl { get; set; } public string ThumbnailUrl { get; set; } } }
25.272727
50
0.618705
[ "MIT" ]
PacktPublishing/Implementing-Azure-Cognitive-Services-for-Search
Section 2/2.5/full-example/SpaBing/Models/VideoSearchResult.cs
280
C#
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ---------------------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Security; using System.Security.Cryptography.X509Certificates; using System.Xml; using Microsoft.Azure.Commands.Common.Authentication.Abstractions; using Microsoft.Azure.KeyVault; using Microsoft.Azure.KeyVault.Models; using Microsoft.Azure.KeyVault.WebKey; using Microsoft.Rest.Azure; using KeyVaultProperties = Microsoft.Azure.Commands.KeyVault.Properties; namespace Microsoft.Azure.Commands.KeyVault.Models { internal class KeyVaultDataServiceClient : IKeyVaultDataServiceClient { public KeyVaultDataServiceClient(IAuthenticationFactory authFactory, IAzureContext context) { if (authFactory == null) throw new ArgumentNullException(nameof(authFactory)); if (context == null) throw new ArgumentNullException(nameof(context)); if (context.Environment == null) throw new ArgumentException(KeyVaultProperties.Resources.InvalidAzureEnvironment); var credential = new DataServiceCredential(authFactory, context, AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId); this.keyVaultClient = new KeyVaultClient(credential.OnAuthentication); this.vaultUriHelper = new VaultUriHelper( context.Environment.GetEndpoint(AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix)); } /// <summary> /// Parameterless constructor for Mocking. /// </summary> public KeyVaultDataServiceClient() { } public PSKeyVaultKey CreateKey(string vaultName, string keyName, PSKeyVaultKeyAttributes keyAttributes, int? size) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(keyName)) throw new ArgumentNullException(nameof(keyName)); if (keyAttributes == null) throw new ArgumentNullException(nameof(keyAttributes)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); var attributes = (Azure.KeyVault.Models.KeyAttributes)keyAttributes; Azure.KeyVault.Models.KeyBundle keyBundle; try { keyBundle = this.keyVaultClient.CreateKeyAsync( vaultBaseUrl: vaultAddress, keyName: keyName, kty: keyAttributes.KeyType, keySize: size, keyOps: keyAttributes.KeyOps == null ? null : new List<string> (keyAttributes.KeyOps), keyAttributes: attributes, tags: keyAttributes.TagsDirectionary).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultKey(keyBundle, this.vaultUriHelper); } public PSKeyVaultCertificate MergeCertificate(string vaultName, string certName, X509Certificate2Collection certs, IDictionary<string, string> tags) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certName)) throw new ArgumentNullException(nameof(certName)); if (null == certs) throw new ArgumentNullException(nameof(certs)); CertificateBundle certBundle; string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); try { certBundle = this.keyVaultClient.MergeCertificateAsync(vaultAddress, certName, certs, null, tags).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultCertificate(certBundle); } public PSKeyVaultCertificate ImportCertificate(string vaultName, string certName, string base64CertColl, SecureString certPassword, IDictionary<string, string> tags) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certName)) throw new ArgumentNullException(nameof(certName)); if (string.IsNullOrEmpty(base64CertColl)) throw new ArgumentNullException(nameof(base64CertColl)); CertificateBundle certBundle; string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); var password = (certPassword == null) ? string.Empty : certPassword.ConvertToString(); try { certBundle = this.keyVaultClient.ImportCertificateAsync(vaultAddress, certName, base64CertColl, password, new CertificatePolicy { SecretProperties = new SecretProperties { ContentType = "application/x-pkcs12" } }, null, tags).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultCertificate(certBundle); } public PSKeyVaultCertificate ImportCertificate(string vaultName, string certName, X509Certificate2Collection certificateCollection, IDictionary<string, string> tags) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certName)) throw new ArgumentNullException(nameof(certName)); if (null == certificateCollection) throw new ArgumentNullException(nameof(certificateCollection)); CertificateBundle certBundle; var vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); try { certBundle = this.keyVaultClient.ImportCertificateAsync(vaultAddress, certName, certificateCollection, new CertificatePolicy { SecretProperties = new SecretProperties { ContentType = "application/x-pkcs12" } }, null, tags).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultCertificate(certBundle); } public PSKeyVaultKey ImportKey(string vaultName, string keyName, PSKeyVaultKeyAttributes keyAttributes, JsonWebKey webKey, bool? importToHsm) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(keyName)) throw new ArgumentNullException(nameof(keyName)); if (keyAttributes == null) throw new ArgumentNullException(nameof(keyAttributes)); if (webKey == null) throw new ArgumentNullException(nameof(webKey)); if (webKey.Kty == JsonWebKeyType.RsaHsm && (importToHsm.HasValue && !importToHsm.Value)) throw new ArgumentException(KeyVaultProperties.Resources.ImportByokAsSoftkeyError); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); webKey.KeyOps = keyAttributes.KeyOps; var keyBundle = new Azure.KeyVault.Models.KeyBundle() { Attributes = (Azure.KeyVault.Models.KeyAttributes)keyAttributes, Key = webKey, Tags = keyAttributes.TagsDirectionary }; try { keyBundle = this.keyVaultClient.ImportKeyAsync(vaultAddress, keyName, keyBundle, importToHsm).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultKey(keyBundle, this.vaultUriHelper); } public PSKeyVaultKey UpdateKey(string vaultName, string keyName, string keyVersion, PSKeyVaultKeyAttributes keyAttributes) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(keyName)) throw new ArgumentNullException(nameof(keyName)); if (keyAttributes == null) throw new ArgumentNullException(nameof(keyAttributes)); var attributes = (Azure.KeyVault.Models.KeyAttributes)keyAttributes; var keyIdentifier = new KeyIdentifier(this.vaultUriHelper.CreateVaultAddress(vaultName), keyName, keyVersion); Azure.KeyVault.Models.KeyBundle keyBundle; try { keyBundle = this.keyVaultClient.UpdateKeyAsync( keyIdentifier.Identifier, keyAttributes.KeyOps, attributes: attributes, tags: keyAttributes.TagsDirectionary).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultKey(keyBundle, this.vaultUriHelper); } public IEnumerable<PSKeyVaultCertificateContact> GetCertificateContacts(string vaultName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); Contacts contacts; try { contacts = this.keyVaultClient.GetCertificateContactsAsync(vaultAddress).GetAwaiter().GetResult(); } catch (KeyVaultErrorException ex) { if (ex.Response.StatusCode == HttpStatusCode.NotFound) return null; else throw; } catch (Exception ex) { throw GetInnerException(ex); } if (contacts == null || contacts.ContactList == null) { return null; } var contactsModel = new List<PSKeyVaultCertificateContact>(); foreach (var contact in contacts.ContactList) { contactsModel.Add(PSKeyVaultCertificateContact.FromKVCertificateContact(contact, vaultName)); } return contactsModel; } public PSKeyVaultCertificate GetCertificate(string vaultName, string certName, string certificateVersion) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certName)) throw new ArgumentNullException(nameof(certName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); CertificateBundle certBundle; try { certBundle = this.keyVaultClient.GetCertificateAsync(vaultAddress, certName, certificateVersion).GetAwaiter().GetResult(); } catch (KeyVaultErrorException ex) { if (ex.Response.StatusCode == HttpStatusCode.NotFound) return null; else throw; } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultCertificate(certBundle); } public PSKeyVaultKey GetKey(string vaultName, string keyName, string keyVersion) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(keyName)) throw new ArgumentNullException(nameof(keyName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); Azure.KeyVault.Models.KeyBundle keyBundle; try { keyBundle = this.keyVaultClient.GetKeyAsync(vaultAddress, keyName, keyVersion).GetAwaiter().GetResult(); } catch (KeyVaultErrorException ex) { if (ex.Response.StatusCode == HttpStatusCode.NotFound) return null; else throw; } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultKey(keyBundle, this.vaultUriHelper); } public IEnumerable<PSKeyVaultCertificateIdentityItem> GetCertificates(KeyVaultCertificateFilterOptions options) { if (options == null) throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName); try { IPage<CertificateItem> result; if (string.IsNullOrEmpty(options.NextLink)) result = this.keyVaultClient.GetCertificatesAsync(vaultAddress, maxresults: null, includePending: options.IncludePending).GetAwaiter().GetResult(); else result = this.keyVaultClient.GetCertificatesNextAsync(options.NextLink).GetAwaiter().GetResult(); options.NextLink = result.NextPageLink; return (result == null) ? new List<PSKeyVaultCertificateIdentityItem>() : result.Select((certItem) => { return new PSKeyVaultCertificateIdentityItem(certItem, this.vaultUriHelper); }); } catch (Exception ex) { throw GetInnerException(ex); } } public IEnumerable<PSKeyVaultCertificateIdentityItem> GetCertificateVersions(KeyVaultObjectFilterOptions options) { if (options == null) throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); if (string.IsNullOrEmpty(options.Name)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidKeyName); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName); try { IPage<CertificateItem> result; if (string.IsNullOrEmpty(options.NextLink)) result = this.keyVaultClient.GetCertificateVersionsAsync(vaultAddress, options.Name).GetAwaiter().GetResult(); else result = this.keyVaultClient.GetCertificateVersionsNextAsync(options.NextLink).GetAwaiter().GetResult(); options.NextLink = result.NextPageLink; return result.Select((certificateItem) => new PSKeyVaultCertificateIdentityItem(certificateItem, this.vaultUriHelper)); } catch (Exception ex) { throw GetInnerException(ex); } } public IEnumerable<PSKeyVaultKeyIdentityItem> GetKeys(KeyVaultObjectFilterOptions options) { if (options == null) throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName); try { IPage<KeyItem> result; if (string.IsNullOrEmpty(options.NextLink)) result = this.keyVaultClient.GetKeysAsync(vaultAddress).GetAwaiter().GetResult(); else result = this.keyVaultClient.GetKeysNextAsync(options.NextLink).GetAwaiter().GetResult(); options.NextLink = result.NextPageLink; return (result == null) ? new List<PSKeyVaultKeyIdentityItem>() : result.Select((keyItem) => new PSKeyVaultKeyIdentityItem(keyItem, this.vaultUriHelper)); } catch (Exception ex) { throw GetInnerException(ex); } } public IEnumerable<PSKeyVaultKeyIdentityItem> GetKeyVersions(KeyVaultObjectFilterOptions options) { if (options == null) throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); if (string.IsNullOrEmpty(options.Name)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidKeyName); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName); try { IPage<KeyItem> result; if (string.IsNullOrEmpty(options.NextLink)) result = this.keyVaultClient.GetKeyVersionsAsync(vaultAddress, options.Name).GetAwaiter().GetResult(); else result = this.keyVaultClient.GetKeyVersionsNextAsync(options.NextLink).GetAwaiter().GetResult(); options.NextLink = result.NextPageLink; return result.Select((keyItem) => new PSKeyVaultKeyIdentityItem(keyItem, this.vaultUriHelper)); } catch (Exception ex) { throw GetInnerException(ex); } } public PSDeletedKeyVaultKey DeleteKey(string vaultName, string keyName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(keyName)) throw new ArgumentNullException(nameof(keyName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); Azure.KeyVault.Models.DeletedKeyBundle keyBundle; try { keyBundle = this.keyVaultClient.DeleteKeyAsync(vaultAddress, keyName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSDeletedKeyVaultKey(keyBundle, this.vaultUriHelper); } public IEnumerable<PSKeyVaultCertificateContact> SetCertificateContacts(string vaultName, IEnumerable<PSKeyVaultCertificateContact> contacts) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); List<Contact> contactList = null; if (contacts != null) { contactList = new List<Contact>(); foreach (var psContact in contacts) { contactList.Add(new Contact { EmailAddress = psContact.Email }); } } Contacts inputContacts = new Contacts { ContactList = contactList }; Contacts outputContacts; try { outputContacts = this.keyVaultClient.SetCertificateContactsAsync(vaultAddress, inputContacts).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } if (outputContacts == null || outputContacts.ContactList == null) { return null; } var contactsModel = new List<PSKeyVaultCertificateContact>(); foreach (var contact in outputContacts.ContactList) { contactsModel.Add(PSKeyVaultCertificateContact.FromKVCertificateContact(contact, vaultName)); } return contactsModel; } public PSKeyVaultSecret SetSecret(string vaultName, string secretName, SecureString secretValue, PSKeyVaultSecretAttributes secretAttributes) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(secretName)) throw new ArgumentNullException(nameof(secretName)); if (secretValue == null) throw new ArgumentNullException(nameof(secretValue)); if (secretAttributes == null) throw new ArgumentNullException(nameof(secretAttributes)); string value = secretValue.ConvertToString(); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); var attributes = (Azure.KeyVault.Models.SecretAttributes)secretAttributes; Azure.KeyVault.Models.SecretBundle secret; try { secret = this.keyVaultClient.SetSecretAsync(vaultAddress, secretName, value, secretAttributes.TagsDictionary, secretAttributes.ContentType, attributes).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultSecret(secret, this.vaultUriHelper); } public PSKeyVaultSecret UpdateSecret(string vaultName, string secretName, string secretVersion, PSKeyVaultSecretAttributes secretAttributes) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(secretName)) throw new ArgumentNullException(nameof(secretName)); if (secretAttributes == null) throw new ArgumentNullException(nameof(secretAttributes)); var secretIdentifier = new SecretIdentifier(this.vaultUriHelper.CreateVaultAddress(vaultName), secretName, secretVersion); Azure.KeyVault.Models.SecretAttributes attributes = (Azure.KeyVault.Models.SecretAttributes)secretAttributes; SecretBundle secret; try { secret = this.keyVaultClient.UpdateSecretAsync(secretIdentifier.Identifier, secretAttributes.ContentType, attributes, secretAttributes.TagsDictionary).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultSecret(secret, this.vaultUriHelper); } public PSKeyVaultSecret GetSecret(string vaultName, string secretName, string secretVersion) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(secretName)) throw new ArgumentNullException(nameof(secretName)); var secretIdentifier = new SecretIdentifier(this.vaultUriHelper.CreateVaultAddress(vaultName), secretName, secretVersion); SecretBundle secret; try { secret = this.keyVaultClient.GetSecretAsync(secretIdentifier.Identifier).GetAwaiter().GetResult(); } catch (KeyVaultErrorException ex) { if (ex.Response.StatusCode == HttpStatusCode.NotFound) return null; else throw; } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultSecret(secret, this.vaultUriHelper); } public IEnumerable<PSKeyVaultSecretIdentityItem> GetSecrets(KeyVaultObjectFilterOptions options) { if (options == null) throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName); try { IPage<SecretItem> result; if (string.IsNullOrEmpty(options.NextLink)) result = this.keyVaultClient.GetSecretsAsync(vaultAddress).GetAwaiter().GetResult(); else result = this.keyVaultClient.GetSecretsNextAsync(options.NextLink).GetAwaiter().GetResult(); options.NextLink = result.NextPageLink; return (result == null) ? new List<PSKeyVaultSecretIdentityItem>() : result.Select((secretItem) => new PSKeyVaultSecretIdentityItem(secretItem, this.vaultUriHelper)); } catch (Exception ex) { throw GetInnerException(ex); } } public IEnumerable<PSKeyVaultSecretIdentityItem> GetSecretVersions(KeyVaultObjectFilterOptions options) { if (options == null) throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); if (string.IsNullOrEmpty(options.Name)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidSecretName); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName); try { IPage<SecretItem> result; if (string.IsNullOrEmpty(options.NextLink)) result = this.keyVaultClient.GetSecretVersionsAsync(vaultAddress, options.Name).GetAwaiter().GetResult(); else result = this.keyVaultClient.GetSecretVersionsNextAsync(options.NextLink).GetAwaiter().GetResult(); options.NextLink = result.NextPageLink; return result.Select((secretItem) => new PSKeyVaultSecretIdentityItem(secretItem, this.vaultUriHelper)); } catch (Exception ex) { throw GetInnerException(ex); } } public PSKeyVaultCertificateOperation EnrollCertificate(string vaultName, string certificateName, CertificatePolicy certificatePolicy, IDictionary<string, string> tags) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) throw new ArgumentNullException(nameof(certificateName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); CertificateOperation certificateOperation; try { certificateOperation = this.keyVaultClient.CreateCertificateAsync(vaultAddress, certificateName, certificatePolicy, null, tags).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return PSKeyVaultCertificateOperation.FromCertificateOperation(certificateOperation); } public PSKeyVaultCertificate UpdateCertificate(string vaultName, string certificateName, string certificateVersion, CertificateAttributes certificateAttributes, IDictionary<string, string> tags) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) throw new ArgumentNullException(nameof(certificateName)); var certificateIdentifier = new CertificateIdentifier(this.vaultUriHelper.CreateVaultAddress(vaultName), certificateName, certificateVersion); CertificateBundle certificateBundle; try { certificateBundle = this.keyVaultClient.UpdateCertificateAsync( certificateIdentifier.Identifier, null, certificateAttributes, tags).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultCertificate(certificateBundle); } public PSDeletedKeyVaultCertificate DeleteCertificate(string vaultName, string certName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certName)) throw new ArgumentNullException(nameof(certName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); DeletedCertificateBundle certBundle; try { certBundle = this.keyVaultClient.DeleteCertificateAsync(vaultAddress, certName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSDeletedKeyVaultCertificate(certBundle); } public void PurgeCertificate(string vaultName, string certName) { if ( string.IsNullOrEmpty( vaultName ) ) throw new ArgumentNullException( "vaultName" ); if ( string.IsNullOrEmpty( certName ) ) throw new ArgumentNullException( "certName" ); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); try { this.keyVaultClient.PurgeDeletedCertificateAsync( vaultAddress, certName ).GetAwaiter( ).GetResult( ); } catch (Exception ex) { throw GetInnerException( ex ); } } public PSKeyVaultCertificateOperation GetCertificateOperation(string vaultName, string certificateName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) throw new ArgumentNullException(nameof(certificateName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); CertificateOperation certificateOperation; try { certificateOperation = this.keyVaultClient.GetCertificateOperationAsync(vaultAddress, certificateName).GetAwaiter().GetResult(); } catch (KeyVaultErrorException ex) { if (ex.Response.StatusCode == HttpStatusCode.NotFound) return null; else throw; } catch (Exception ex) { throw GetInnerException(ex); } return PSKeyVaultCertificateOperation.FromCertificateOperation(certificateOperation); } public PSKeyVaultCertificateOperation CancelCertificateOperation(string vaultName, string certificateName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) throw new ArgumentNullException(nameof(certificateName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); CertificateOperation certificateOperation; try { certificateOperation = this.keyVaultClient.UpdateCertificateOperationAsync(vaultAddress, certificateName, true).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return PSKeyVaultCertificateOperation.FromCertificateOperation(certificateOperation); } public PSKeyVaultCertificateOperation DeleteCertificateOperation(string vaultName, string certificateName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) throw new ArgumentNullException(nameof(certificateName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); CertificateOperation certificateOperation; try { certificateOperation = this.keyVaultClient.DeleteCertificateOperationAsync(vaultAddress, certificateName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return PSKeyVaultCertificateOperation.FromCertificateOperation(certificateOperation); } public PSDeletedKeyVaultSecret DeleteSecret(string vaultName, string secretName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(secretName)) throw new ArgumentNullException(nameof(secretName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); DeletedSecretBundle secret; try { secret = this.keyVaultClient.DeleteSecretAsync(vaultAddress, secretName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSDeletedKeyVaultSecret(secret, this.vaultUriHelper); } public string BackupKey(string vaultName, string keyName, string outputBlobPath) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(keyName)) throw new ArgumentNullException(nameof(keyName)); if (string.IsNullOrEmpty(outputBlobPath)) throw new ArgumentNullException(nameof(outputBlobPath)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); BackupKeyResult backupKeyResult; try { backupKeyResult = this.keyVaultClient.BackupKeyAsync(vaultAddress, keyName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } File.WriteAllBytes(outputBlobPath, backupKeyResult.Value); return outputBlobPath; } public PSKeyVaultKey RestoreKey(string vaultName, string inputBlobPath) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(inputBlobPath)) throw new ArgumentNullException(nameof(inputBlobPath)); var backupBlob = File.ReadAllBytes(inputBlobPath); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); Azure.KeyVault.Models.KeyBundle keyBundle; try { keyBundle = this.keyVaultClient.RestoreKeyAsync(vaultAddress, backupBlob).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultKey(keyBundle, this.vaultUriHelper); } public string BackupSecret( string vaultName, string secretName, string outputBlobPath ) { if ( string.IsNullOrEmpty( vaultName ) ) throw new ArgumentNullException(nameof(vaultName)); if ( string.IsNullOrEmpty( secretName ) ) throw new ArgumentNullException(nameof(secretName)); if ( string.IsNullOrEmpty( outputBlobPath ) ) throw new ArgumentNullException(nameof(outputBlobPath)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); BackupSecretResult backupSecretResult; try { backupSecretResult = this.keyVaultClient.BackupSecretAsync( vaultAddress, secretName ).GetAwaiter( ).GetResult( ); } catch ( Exception ex ) { throw GetInnerException( ex ); } File.WriteAllBytes( outputBlobPath, backupSecretResult.Value ); return outputBlobPath; } public PSKeyVaultSecret RestoreSecret( string vaultName, string inputBlobPath ) { if ( string.IsNullOrEmpty( vaultName ) ) throw new ArgumentNullException(nameof(vaultName)); if ( string.IsNullOrEmpty( inputBlobPath ) ) throw new ArgumentNullException(nameof(inputBlobPath)); var backupBlob = File.ReadAllBytes(inputBlobPath); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); Azure.KeyVault.Models.SecretBundle secretBundle; try { secretBundle = this.keyVaultClient.RestoreSecretAsync( vaultAddress, backupBlob ).GetAwaiter( ).GetResult( ); } catch ( Exception ex ) { throw GetInnerException( ex ); } return new PSKeyVaultSecret( secretBundle, this.vaultUriHelper ); } public PSKeyVaultCertificatePolicy GetCertificatePolicy(string vaultName, string certificateName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) throw new ArgumentNullException(nameof(certificateName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); CertificatePolicy certificatePolicy; try { certificatePolicy = this.keyVaultClient.GetCertificatePolicyAsync(vaultAddress, certificateName).GetAwaiter().GetResult(); } catch (KeyVaultErrorException ex) { if (ex.Response.StatusCode == HttpStatusCode.NotFound) return null; else throw; } catch (Exception ex) { throw GetInnerException(ex); } return PSKeyVaultCertificatePolicy.FromCertificatePolicy(certificatePolicy); } public PSKeyVaultCertificatePolicy UpdateCertificatePolicy(string vaultName, string certificateName, CertificatePolicy certificatePolicy) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) throw new ArgumentNullException(nameof(certificateName)); if (certificatePolicy == null) throw new ArgumentNullException(nameof(certificatePolicy)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); CertificatePolicy resultantCertificatePolicy; try { resultantCertificatePolicy = this.keyVaultClient.UpdateCertificatePolicyAsync(vaultAddress, certificateName, certificatePolicy).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return PSKeyVaultCertificatePolicy.FromCertificatePolicy(certificatePolicy); } public PSKeyVaultCertificateIssuer GetCertificateIssuer(string vaultName, string issuerName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(issuerName)) throw new ArgumentNullException(nameof(issuerName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); IssuerBundle certificateIssuer; try { certificateIssuer = this.keyVaultClient.GetCertificateIssuerAsync(vaultAddress, issuerName).GetAwaiter().GetResult(); } catch (KeyVaultErrorException ex) { if (ex.Response.StatusCode == HttpStatusCode.NotFound) return null; else throw; } catch (Exception ex) { throw GetInnerException(ex); } return PSKeyVaultCertificateIssuer.FromIssuer(certificateIssuer); } public IEnumerable<PSKeyVaultCertificateIssuerIdentityItem> GetCertificateIssuers(KeyVaultObjectFilterOptions options) { if (options == null) throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName); try { IPage<CertificateIssuerItem> result; if (string.IsNullOrEmpty(options.NextLink)) result = this.keyVaultClient.GetCertificateIssuersAsync(vaultAddress).GetAwaiter().GetResult(); else result = this.keyVaultClient.GetCertificateIssuersNextAsync(options.NextLink).GetAwaiter().GetResult(); options.NextLink = result.NextPageLink; return (result == null) ? new List<PSKeyVaultCertificateIssuerIdentityItem>() : result.Select(issuerItem => new PSKeyVaultCertificateIssuerIdentityItem(issuerItem, this.vaultUriHelper)); } catch (Exception ex) { throw GetInnerException(ex); } } public PSKeyVaultCertificateIssuer SetCertificateIssuer( string vaultName, string issuerName, string issuerProvider, string accountId, SecureString apiKey, PSKeyVaultCertificateOrganizationDetails organizationDetails) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(issuerName)) throw new ArgumentNullException(nameof(issuerName)); if (string.IsNullOrEmpty(issuerProvider)) throw new ArgumentNullException(nameof(issuerProvider)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); var issuer = new IssuerBundle { Provider = issuerProvider, OrganizationDetails = organizationDetails == null ? null : organizationDetails.ToOrganizationDetails(), }; if (!string.IsNullOrEmpty(accountId) || apiKey != null) { issuer.Credentials = new IssuerCredentials { AccountId = accountId, Password = apiKey == null ? null : apiKey.ConvertToString(), }; } IssuerBundle resultantIssuer; try { resultantIssuer = this.keyVaultClient.SetCertificateIssuerAsync( vaultAddress, issuerName, issuer.Provider, issuer.Credentials, issuer.OrganizationDetails, issuer.Attributes).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return PSKeyVaultCertificateIssuer.FromIssuer(resultantIssuer); } public PSKeyVaultCertificateIssuer DeleteCertificateIssuer(string vaultName, string issuerName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(issuerName)) throw new ArgumentNullException(nameof(issuerName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); IssuerBundle issuer; try { issuer = this.keyVaultClient.DeleteCertificateIssuerAsync(vaultAddress, issuerName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return PSKeyVaultCertificateIssuer.FromIssuer(issuer); } #region Managed Storage Accounts public IEnumerable<PSKeyVaultManagedStorageAccountIdentityItem> GetManagedStorageAccounts( KeyVaultObjectFilterOptions options ) { if ( options == null ) throw new ArgumentNullException( "options" ); if ( string.IsNullOrEmpty( options.VaultName ) ) throw new ArgumentException( KeyVaultProperties.Resources.InvalidVaultName ); string vaultAddress = this.vaultUriHelper.CreateVaultAddress( options.VaultName ); try { IPage<StorageAccountItem> result; if ( string.IsNullOrEmpty( options.NextLink ) ) result = this.keyVaultClient.GetStorageAccountsAsync( vaultAddress ).GetAwaiter().GetResult(); else result = this.keyVaultClient.GetStorageAccountsNextAsync( options.NextLink ).GetAwaiter().GetResult(); options.NextLink = result.NextPageLink; return result.Select( ( storageAccountItem ) => new PSKeyVaultManagedStorageAccountIdentityItem( storageAccountItem, this.vaultUriHelper ) ); } catch ( Exception ex ) { throw GetInnerException( ex ); } } public PSKeyVaultManagedStorageAccount GetManagedStorageAccount( string vaultName, string managedStorageAccountName ) { if ( string.IsNullOrWhiteSpace( vaultName ) ) throw new ArgumentNullException( "vaultName" ); if ( string.IsNullOrWhiteSpace( managedStorageAccountName ) ) throw new ArgumentNullException( "managedStorageAccountName" ); StorageBundle storageBundle; var vaultAddress = this.vaultUriHelper.CreateVaultAddress( vaultName ); try { storageBundle = this.keyVaultClient.GetStorageAccountAsync( vaultAddress, managedStorageAccountName ).GetAwaiter().GetResult(); } catch ( Exception ex ) { throw GetInnerException( ex ); } return new PSKeyVaultManagedStorageAccount( storageBundle, this.vaultUriHelper ); } public PSKeyVaultManagedStorageAccount SetManagedStorageAccount( string vaultName, string managedStorageAccountName, string storageResourceId, string activeKeyName, bool? autoRegenerateKey, TimeSpan? regenerationPeriod, PSKeyVaultManagedStorageAccountAttributes managedStorageAccountAttributes, Hashtable tags ) { if ( string.IsNullOrEmpty( vaultName ) ) throw new ArgumentNullException( "vaultName" ); if ( string.IsNullOrEmpty( managedStorageAccountName ) ) throw new ArgumentNullException( "managedStorageAccountName" ); if ( string.IsNullOrEmpty( storageResourceId ) ) throw new ArgumentNullException( "storageResourceId" ); if ( string.IsNullOrEmpty( activeKeyName ) ) throw new ArgumentNullException( "activeKeyName" ); var vaultAddress = this.vaultUriHelper.CreateVaultAddress( vaultName ); var attributes = managedStorageAccountAttributes == null ? null : new Azure.KeyVault.Models.StorageAccountAttributes { Enabled = managedStorageAccountAttributes.Enabled, }; Azure.KeyVault.Models.StorageBundle storageBundle; try { storageBundle = this.keyVaultClient.SetStorageAccountAsync( vaultAddress, managedStorageAccountName, storageResourceId, activeKeyName, autoRegenerateKey ?? true, regenerationPeriod == null ? null : XmlConvert.ToString( regenerationPeriod.Value ), attributes, tags == null ? null : tags.ConvertToDictionary() ).GetAwaiter().GetResult(); } catch ( Exception ex ) { throw GetInnerException( ex ); } return new PSKeyVaultManagedStorageAccount( storageBundle, this.vaultUriHelper ); } public PSKeyVaultManagedStorageAccount UpdateManagedStorageAccount( string vaultName, string managedStorageAccountName, string activeKeyName, bool? autoRegenerateKey, TimeSpan? regenerationPeriod, PSKeyVaultManagedStorageAccountAttributes managedStorageAccountAttributes, Hashtable tags ) { if ( string.IsNullOrEmpty( vaultName ) ) throw new ArgumentNullException( "vaultName" ); if ( string.IsNullOrEmpty( managedStorageAccountName ) ) throw new ArgumentNullException( "managedStorageAccountName" ); var vaultAddress = this.vaultUriHelper.CreateVaultAddress( vaultName ); var attributes = managedStorageAccountAttributes == null ? null : new Azure.KeyVault.Models.StorageAccountAttributes { Enabled = managedStorageAccountAttributes.Enabled, }; Azure.KeyVault.Models.StorageBundle storageBundle; try { storageBundle = this.keyVaultClient.UpdateStorageAccountAsync( vaultAddress, managedStorageAccountName, activeKeyName, autoRegenerateKey, regenerationPeriod == null ? null : XmlConvert.ToString( regenerationPeriod.Value ), attributes, tags == null ? null : tags.ConvertToDictionary() ).GetAwaiter().GetResult(); } catch ( Exception ex ) { throw GetInnerException( ex ); } return new PSKeyVaultManagedStorageAccount( storageBundle, this.vaultUriHelper ); } public PSDeletedKeyVaultManagedStorageAccount DeleteManagedStorageAccount( string vaultName, string managedStorageAccountName ) { if ( string.IsNullOrEmpty( vaultName ) ) throw new ArgumentNullException( "vaultName" ); if ( string.IsNullOrEmpty( managedStorageAccountName ) ) throw new ArgumentNullException( "managedStorageAccountName" ); var vaultAddress = this.vaultUriHelper.CreateVaultAddress( vaultName ); Azure.KeyVault.Models.DeletedStorageBundle storageBundle; try { storageBundle = this.keyVaultClient.DeleteStorageAccountAsync( vaultAddress, managedStorageAccountName ).GetAwaiter().GetResult(); } catch ( Exception ex ) { throw GetInnerException( ex ); } return new PSDeletedKeyVaultManagedStorageAccount( storageBundle, this.vaultUriHelper ); } public PSKeyVaultManagedStorageAccount RegenerateManagedStorageAccountKey( string vaultName, string managedStorageAccountName, string keyName ) { if ( string.IsNullOrEmpty( vaultName ) ) throw new ArgumentNullException( "vaultName" ); if ( string.IsNullOrEmpty( managedStorageAccountName ) ) throw new ArgumentNullException( "managedStorageAccountName" ); if ( string.IsNullOrEmpty( keyName ) ) throw new ArgumentNullException( "keyName" ); Azure.KeyVault.Models.StorageBundle storageBundle; var vaultAddress = this.vaultUriHelper.CreateVaultAddress( vaultName ); try { storageBundle = this.keyVaultClient.RegenerateStorageAccountKeyAsync( vaultAddress, managedStorageAccountName, keyName ).GetAwaiter().GetResult(); } catch ( Exception ex ) { throw GetInnerException( ex ); } return new PSKeyVaultManagedStorageAccount( storageBundle, this.vaultUriHelper ); } public PSKeyVaultManagedStorageSasDefinition GetManagedStorageSasDefinition( string vaultName, string managedStorageAccountName, string sasDefinitionName ) { if ( string.IsNullOrWhiteSpace( vaultName ) ) throw new ArgumentNullException( "vaultName" ); if ( string.IsNullOrWhiteSpace( managedStorageAccountName ) ) throw new ArgumentNullException( "managedStorageAccountName" ); if ( string.IsNullOrWhiteSpace( sasDefinitionName ) ) throw new ArgumentNullException( "sasDefinitionName" ); SasDefinitionBundle storagesasDefinitionBundle; var vaultAddress = this.vaultUriHelper.CreateVaultAddress( vaultName ); try { storagesasDefinitionBundle = this.keyVaultClient.GetSasDefinitionAsync( vaultAddress, managedStorageAccountName, sasDefinitionName ).GetAwaiter().GetResult(); } catch ( Exception ex ) { throw GetInnerException( ex ); } return new PSKeyVaultManagedStorageSasDefinition( storagesasDefinitionBundle, this.vaultUriHelper ); } public IEnumerable<PSKeyVaultManagedStorageSasDefinitionIdentityItem> GetManagedStorageSasDefinitions( KeyVaultStorageSasDefinitiontFilterOptions options ) { if ( options == null ) throw new ArgumentNullException( "options" ); if ( string.IsNullOrEmpty( options.VaultName ) ) throw new ArgumentException( KeyVaultProperties.Resources.InvalidVaultName ); if ( string.IsNullOrEmpty( options.AccountName ) ) throw new ArgumentException( KeyVaultProperties.Resources.InvalidManagedStorageAccountName ); string vaultAddress = this.vaultUriHelper.CreateVaultAddress( options.VaultName ); try { IPage<SasDefinitionItem> result; if ( string.IsNullOrEmpty( options.NextLink ) ) result = this.keyVaultClient.GetSasDefinitionsAsync( vaultAddress, options.AccountName ).GetAwaiter().GetResult(); else result = this.keyVaultClient.GetSasDefinitionsNextAsync( options.NextLink ).GetAwaiter().GetResult(); options.NextLink = result.NextPageLink; return result.Select( ( storageAccountItem ) => new PSKeyVaultManagedStorageSasDefinitionIdentityItem( storageAccountItem, this.vaultUriHelper ) ); } catch ( Exception ex ) { throw GetInnerException( ex ); } } public PSKeyVaultManagedStorageSasDefinition SetManagedStorageSasDefinition( string vaultName, string managedStorageAccountName, string sasDefinitionName, string templateUri, string sasType, string validityPeriod, PSKeyVaultManagedStorageSasDefinitionAttributes sasDefinitionAttributes, Hashtable tags ) { if ( string.IsNullOrEmpty( vaultName ) ) throw new ArgumentNullException(nameof(vaultName)); if ( string.IsNullOrEmpty( managedStorageAccountName ) ) throw new ArgumentNullException(nameof(managedStorageAccountName)); if (string.IsNullOrEmpty(templateUri)) throw new ArgumentNullException(nameof(templateUri)); if (string.IsNullOrEmpty(sasType)) throw new ArgumentNullException(nameof(sasType)); if (string.IsNullOrEmpty(validityPeriod)) throw new ArgumentNullException(nameof(validityPeriod)); if ( string.IsNullOrEmpty( sasDefinitionName ) ) throw new ArgumentNullException(nameof(sasDefinitionName)); var vaultAddress = this.vaultUriHelper.CreateVaultAddress( vaultName ); var attributes = sasDefinitionAttributes == null ? null : new Azure.KeyVault.Models.SasDefinitionAttributes { Enabled = sasDefinitionAttributes.Enabled, }; Azure.KeyVault.Models.SasDefinitionBundle sasDefinitionBundle; try { sasDefinitionBundle = this.keyVaultClient.SetSasDefinitionAsync( vaultBaseUrl: vaultAddress, storageAccountName: managedStorageAccountName, sasDefinitionName: sasDefinitionName, templateUri: templateUri, sasType: sasType, validityPeriod:validityPeriod, sasDefinitionAttributes: attributes, tags: tags == null ? null : tags.ConvertToDictionary() ).GetAwaiter().GetResult(); } catch ( Exception ex ) { throw GetInnerException( ex ); } return new PSKeyVaultManagedStorageSasDefinition( sasDefinitionBundle, this.vaultUriHelper ); } public PSDeletedKeyVaultManagedStorageSasDefinition DeleteManagedStorageSasDefinition( string vaultName, string managedStorageAccountName, string sasDefinitionName ) { if ( string.IsNullOrEmpty( vaultName ) ) throw new ArgumentNullException( "vaultName" ); if ( string.IsNullOrEmpty( managedStorageAccountName ) ) throw new ArgumentNullException( "managedStorageAccountName" ); if ( string.IsNullOrEmpty( sasDefinitionName ) ) throw new ArgumentNullException( "sasDefinitionName" ); var vaultAddress = this.vaultUriHelper.CreateVaultAddress( vaultName ); Azure.KeyVault.Models.DeletedSasDefinitionBundle sasDefinitionBundle; try { sasDefinitionBundle = this.keyVaultClient.DeleteSasDefinitionAsync( vaultAddress, managedStorageAccountName, sasDefinitionName ).GetAwaiter().GetResult(); } catch ( Exception ex ) { throw GetInnerException( ex ); } return new PSDeletedKeyVaultManagedStorageSasDefinition( sasDefinitionBundle, this.vaultUriHelper ); } #endregion private Exception GetInnerException(Exception exception) { while (exception.InnerException != null) exception = exception.InnerException; return exception; } public PSDeletedKeyVaultKey GetDeletedKey(string vaultName, string keyName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException("vaultName"); if (string.IsNullOrEmpty(keyName)) throw new ArgumentNullException("keyName"); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); Azure.KeyVault.Models.DeletedKeyBundle deletedKeyBundle; try { deletedKeyBundle = this.keyVaultClient.GetDeletedKeyAsync(vaultAddress, keyName).GetAwaiter().GetResult(); } catch (KeyVaultErrorException ex) { if(ex.Response.StatusCode == HttpStatusCode.NotFound) return null; else throw; } catch (Exception ex) { throw GetInnerException(ex); } return new PSDeletedKeyVaultKey(deletedKeyBundle, this.vaultUriHelper); } public IEnumerable<PSDeletedKeyVaultKeyIdentityItem> GetDeletedKeys(KeyVaultObjectFilterOptions options) { if (options == null) throw new ArgumentNullException("options"); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName); try { IPage<DeletedKeyItem> result; if (string.IsNullOrEmpty(options.NextLink)) result = this.keyVaultClient.GetDeletedKeysAsync(vaultAddress).GetAwaiter().GetResult(); else result = this.keyVaultClient.GetDeletedKeysNextAsync(options.NextLink).GetAwaiter().GetResult(); options.NextLink = result.NextPageLink; return (result == null) ? new List<PSDeletedKeyVaultKeyIdentityItem>() : result.Select((deletedKeyItem) => new PSDeletedKeyVaultKeyIdentityItem(deletedKeyItem, this.vaultUriHelper)); } catch (Exception ex) { throw GetInnerException(ex); } } public PSDeletedKeyVaultSecret GetDeletedSecret(string vaultName, string secretName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException("vaultName"); if (string.IsNullOrEmpty(secretName)) throw new ArgumentNullException("secretName"); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); DeletedSecretBundle deletedSecret; try { deletedSecret = this.keyVaultClient.GetDeletedSecretAsync(vaultAddress, secretName).GetAwaiter().GetResult(); } catch (KeyVaultErrorException ex) { if (ex.Response.StatusCode == HttpStatusCode.NotFound) return null; else throw; } catch (Exception ex) { throw GetInnerException(ex); } return new PSDeletedKeyVaultSecret(deletedSecret, this.vaultUriHelper); } public IEnumerable<PSDeletedKeyVaultSecretIdentityItem> GetDeletedSecrets(KeyVaultObjectFilterOptions options) { if (options == null) throw new ArgumentNullException("options"); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName); try { IPage<DeletedSecretItem> result; if (string.IsNullOrEmpty(options.NextLink)) result = this.keyVaultClient.GetDeletedSecretsAsync(vaultAddress).GetAwaiter().GetResult(); else result = this.keyVaultClient.GetDeletedSecretsNextAsync(options.NextLink).GetAwaiter().GetResult(); options.NextLink = result.NextPageLink; return (result == null) ? new List<PSDeletedKeyVaultSecretIdentityItem>() : result.Select((deletedSecretItem) => new PSDeletedKeyVaultSecretIdentityItem(deletedSecretItem, this.vaultUriHelper)); } catch (Exception ex) { throw GetInnerException(ex); } } public void PurgeKey(string vaultName, string keyName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException("vaultName"); if (string.IsNullOrEmpty(keyName)) throw new ArgumentNullException("keyName"); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); try { this.keyVaultClient.PurgeDeletedKeyAsync(vaultAddress, keyName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } } public void PurgeSecret(string vaultName, string secretName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException("vaultName"); if (string.IsNullOrEmpty(secretName)) throw new ArgumentNullException("secretName"); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); try { this.keyVaultClient.PurgeDeletedSecretAsync(vaultAddress, secretName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } } public PSKeyVaultKey RecoverKey(string vaultName, string keyName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException("vaultName"); if (string.IsNullOrEmpty(keyName)) throw new ArgumentNullException("keyName"); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); Microsoft.Azure.KeyVault.Models.KeyBundle recoveredKey; try { recoveredKey = this.keyVaultClient.RecoverDeletedKeyAsync(vaultAddress, keyName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultKey(recoveredKey, this.vaultUriHelper); } public PSKeyVaultSecret RecoverSecret(string vaultName, string secretName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException("vaultName"); if (string.IsNullOrEmpty(secretName)) throw new ArgumentNullException("secretName"); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); SecretBundle recoveredSecret; try { recoveredSecret = this.keyVaultClient.RecoverDeletedSecretAsync(vaultAddress, secretName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultSecret(recoveredSecret, this.vaultUriHelper); } public PSDeletedKeyVaultCertificate GetDeletedCertificate( string vaultName, string certName ) { if ( string.IsNullOrEmpty( vaultName ) ) throw new ArgumentNullException( nameof(vaultName) ); if ( string.IsNullOrEmpty( certName ) ) throw new ArgumentNullException( nameof(certName) ); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); DeletedCertificateBundle deletedCertificate; try { deletedCertificate = this.keyVaultClient.GetDeletedCertificateAsync( vaultAddress, certName ).GetAwaiter( ).GetResult( ); } catch ( KeyVaultErrorException ex ) { if ( ex.Response.StatusCode == HttpStatusCode.NotFound ) return null; else throw; } catch ( Exception ex ) { throw GetInnerException( ex ); } return new PSDeletedKeyVaultCertificate(deletedCertificate); } public IEnumerable<PSDeletedKeyVaultCertificateIdentityItem> GetDeletedCertificates( KeyVaultCertificateFilterOptions options ) { if ( options == null ) throw new ArgumentNullException( nameof( options ) ); if ( string.IsNullOrEmpty( options.VaultName ) ) throw new ArgumentException( KeyVaultProperties.Resources.InvalidVaultName ); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName); try { IPage<DeletedCertificateItem> result; if ( string.IsNullOrEmpty( options.NextLink ) ) result = this.keyVaultClient.GetDeletedCertificatesAsync( vaultAddress, maxresults: null, includePending: options.IncludePending ).GetAwaiter( ).GetResult( ); else result = this.keyVaultClient.GetDeletedCertificatesNextAsync( options.NextLink ).GetAwaiter( ).GetResult( ); options.NextLink = result.NextPageLink; return ( result == null ) ? new List<PSDeletedKeyVaultCertificateIdentityItem>( ) : result.Select( ( deletedItem ) => new PSDeletedKeyVaultCertificateIdentityItem( deletedItem, this.vaultUriHelper ) ); } catch ( Exception ex ) { throw GetInnerException( ex ); } } public PSKeyVaultCertificate RecoverCertificate( string vaultName, string certName ) { if ( string.IsNullOrEmpty( vaultName ) ) throw new ArgumentNullException( nameof( vaultName ) ); if ( string.IsNullOrEmpty( certName ) ) throw new ArgumentNullException( nameof( certName ) ); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); CertificateBundle recoveredCertificate; try { recoveredCertificate = this.keyVaultClient.RecoverDeletedCertificateAsync( vaultAddress, certName ).GetAwaiter( ).GetResult( ); } catch ( Exception ex ) { throw GetInnerException( ex ); } return new PSKeyVaultCertificate(recoveredCertificate); } public string BackupCertificate(string vaultName, string certificateName, string outputBlobPath) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(certificateName)) throw new ArgumentNullException(nameof(certificateName)); if (string.IsNullOrEmpty(outputBlobPath)) throw new ArgumentNullException(nameof(outputBlobPath)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); BackupCertificateResult backupCertificateResult; try { backupCertificateResult = this.keyVaultClient.BackupCertificateAsync(vaultAddress, certificateName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } File.WriteAllBytes(outputBlobPath, backupCertificateResult.Value); return outputBlobPath; } public PSKeyVaultCertificate RestoreCertificate(string vaultName, string inputBlobPath) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(inputBlobPath)) throw new ArgumentNullException(nameof(inputBlobPath)); var backupBlob = File.ReadAllBytes(inputBlobPath); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); Azure.KeyVault.Models.CertificateBundle certificateBundle; try { certificateBundle = this.keyVaultClient.RestoreCertificateAsync(vaultAddress, backupBlob).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultCertificate(certificateBundle, this.vaultUriHelper); } public PSDeletedKeyVaultManagedStorageAccount GetDeletedManagedStorageAccount(string vaultName, string managedStorageAccountName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(managedStorageAccountName)) throw new ArgumentNullException(nameof(managedStorageAccountName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); Azure.KeyVault.Models.DeletedStorageBundle deletedStorageBundle; try { deletedStorageBundle = this.keyVaultClient.GetDeletedStorageAccountAsync(vaultAddress, managedStorageAccountName).GetAwaiter().GetResult(); } catch (KeyVaultErrorException ex) { if (ex.Response.StatusCode == HttpStatusCode.NotFound) return null; else throw; } catch (Exception ex) { throw GetInnerException(ex); } return new PSDeletedKeyVaultManagedStorageAccount(deletedStorageBundle, this.vaultUriHelper); } public PSDeletedKeyVaultManagedStorageSasDefinition GetDeletedManagedStorageSasDefinition(string vaultName, string managedStorageAccountName, string sasDefinitionName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(managedStorageAccountName)) throw new ArgumentNullException(nameof(managedStorageAccountName)); if (string.IsNullOrWhiteSpace(sasDefinitionName)) throw new ArgumentNullException(nameof(sasDefinitionName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); Azure.KeyVault.Models.DeletedSasDefinitionBundle deletedSasDefinitionBundle; try { deletedSasDefinitionBundle = this.keyVaultClient.GetDeletedSasDefinitionAsync(vaultAddress, managedStorageAccountName, sasDefinitionName).GetAwaiter().GetResult(); } catch (KeyVaultErrorException ex) { if (ex.Response.StatusCode == HttpStatusCode.NotFound) return null; else throw; } catch (Exception ex) { throw GetInnerException(ex); } return new PSDeletedKeyVaultManagedStorageSasDefinition(deletedSasDefinitionBundle, this.vaultUriHelper); } public IEnumerable<PSDeletedKeyVaultManagedStorageAccountIdentityItem> GetDeletedManagedStorageAccounts(KeyVaultObjectFilterOptions options) { if (options == null) throw new ArgumentNullException("options"); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName); try { IPage<DeletedStorageAccountItem> result; if (string.IsNullOrEmpty(options.NextLink)) result = this.keyVaultClient.GetDeletedStorageAccountsAsync(vaultAddress).GetAwaiter().GetResult(); else result = this.keyVaultClient.GetDeletedStorageAccountsNextAsync(options.NextLink).GetAwaiter().GetResult(); options.NextLink = result.NextPageLink; return (result == null) ? new List<PSDeletedKeyVaultManagedStorageAccountIdentityItem>() : result.Select((deletedItem) => new PSDeletedKeyVaultManagedStorageAccountIdentityItem(deletedItem, this.vaultUriHelper)); } catch (Exception ex) { throw GetInnerException(ex); } } public IEnumerable<PSDeletedKeyVaultManagedStorageSasDefinitionIdentityItem> GetDeletedManagedStorageSasDefinitions(KeyVaultObjectFilterOptions options) { if (options == null) throw new ArgumentNullException(nameof(options)); if (string.IsNullOrEmpty(options.VaultName)) throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName); if (String.IsNullOrWhiteSpace(options.Name)) throw new ArgumentNullException(KeyVaultProperties.Resources.InvalidManagedStorageAccountName); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName); try { IPage<DeletedSasDefinitionItem> result; if (string.IsNullOrEmpty(options.NextLink)) result = this.keyVaultClient.GetDeletedSasDefinitionsAsync(vaultAddress, options.Name).GetAwaiter().GetResult(); else result = this.keyVaultClient.GetDeletedSasDefinitionsNextAsync(options.NextLink).GetAwaiter().GetResult(); options.NextLink = result.NextPageLink; return (result == null) ? new List<PSDeletedKeyVaultManagedStorageSasDefinitionIdentityItem>() : result.Select((deletedItem) => new PSDeletedKeyVaultManagedStorageSasDefinitionIdentityItem(deletedItem, this.vaultUriHelper)); } catch (Exception ex) { throw GetInnerException(ex); } } public PSKeyVaultManagedStorageAccount RecoverManagedStorageAccount(string vaultName, string deletedManagedStorageAccountName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(deletedManagedStorageAccountName)) throw new ArgumentNullException(nameof(deletedManagedStorageAccountName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); StorageBundle recoveredStorageBundle; try { recoveredStorageBundle = this.keyVaultClient.RecoverDeletedStorageAccountAsync(vaultAddress, deletedManagedStorageAccountName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultManagedStorageAccount(recoveredStorageBundle, this.vaultUriHelper); } public PSKeyVaultManagedStorageSasDefinition RecoverManagedStorageSasDefinition(string vaultName, string managedStorageAccountName, string sasDefinitionName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(managedStorageAccountName)) throw new ArgumentNullException(nameof(managedStorageAccountName)); if (string.IsNullOrWhiteSpace(sasDefinitionName)) throw new ArgumentNullException(nameof(sasDefinitionName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); SasDefinitionBundle recoveredSasDefinitionBundle; try { recoveredSasDefinitionBundle = this.keyVaultClient.RecoverDeletedSasDefinitionAsync(vaultAddress, managedStorageAccountName, sasDefinitionName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultManagedStorageSasDefinition(recoveredSasDefinitionBundle, this.vaultUriHelper); } public void PurgeManagedStorageAccount(string vaultName, string managedStorageAccountName) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(managedStorageAccountName)) throw new ArgumentNullException(nameof(managedStorageAccountName)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); try { this.keyVaultClient.PurgeDeletedStorageAccountAsync(vaultAddress, managedStorageAccountName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } } public string BackupManagedStorageAccount(string vaultName, string managedStorageAccountName, string outputBlobPath) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(managedStorageAccountName)) throw new ArgumentNullException(nameof(managedStorageAccountName)); if (string.IsNullOrEmpty(outputBlobPath)) throw new ArgumentNullException(nameof(outputBlobPath)); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); BackupStorageResult backupStorageAccountResult; try { backupStorageAccountResult = this.keyVaultClient.BackupStorageAccountAsync(vaultAddress, managedStorageAccountName).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } File.WriteAllBytes(outputBlobPath, backupStorageAccountResult.Value); return outputBlobPath; } public PSKeyVaultManagedStorageAccount RestoreManagedStorageAccount(string vaultName, string inputBlobPath) { if (string.IsNullOrEmpty(vaultName)) throw new ArgumentNullException(nameof(vaultName)); if (string.IsNullOrEmpty(inputBlobPath)) throw new ArgumentNullException(nameof(inputBlobPath)); var backupBlob = File.ReadAllBytes(inputBlobPath); string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName); Azure.KeyVault.Models.StorageBundle storageAccountBundle; try { storageAccountBundle = this.keyVaultClient.RestoreStorageAccountAsync(vaultAddress, backupBlob).GetAwaiter().GetResult(); } catch (Exception ex) { throw GetInnerException(ex); } return new PSKeyVaultManagedStorageAccount(storageAccountBundle, this.vaultUriHelper); } private VaultUriHelper vaultUriHelper; private KeyVaultClient keyVaultClient; } }
42.966152
203
0.600725
[ "MIT" ]
Acidburn0zzz/azure-powershell
src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs
84,313
C#
using System; using System.Runtime.InteropServices; using System.Threading.Tasks; using AltV.Net.Data; using AltV.Net.Elements.Entities; using AltV.Net.Elements.Args; using AltV.Net.Native; namespace AltV.Net.Async { public static partial class AltAsync { public static Task<bool> IsConnectedAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsConnected); public static Task SetModelAsync(this IPlayer player, uint model) => AltVAsync.Schedule(() => player.Model = model); public static async Task<string> GetNameAsync(this IPlayer player) { var resultPtr = await AltVAsync.Schedule( () => { var ptr = IntPtr.Zero; unsafe { player.CheckIfEntityExists(); Alt.Server.Library.Player_GetName(player.NativePointer, &ptr); } return ptr; }); return resultPtr == IntPtr.Zero ? string.Empty : Marshal.PtrToStringUTF8(resultPtr); } public static Task<ushort> GetHealthAsync(this IPlayer player) => AltVAsync.Schedule(() => player.Health); public static Task SetHealthAsync(this IPlayer player, ushort health) => AltVAsync.Schedule(() => player.Health = health); public static Task<bool> IsDeadAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsDead); public static Task<bool> IsJumpingAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsJumping); public static Task<bool> IsInRagdollAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsInRagdoll); public static Task<bool> IsAimingAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsAiming); public static Task<bool> IsShootingAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsShooting); public static Task<bool> IsReloadingAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsReloading); public static Task<ushort> GetArmorAsync(this IPlayer player) => AltVAsync.Schedule(() => player.Armor); public static Task SetArmorAsync(this IPlayer player, ushort armor) => AltVAsync.Schedule(() => player.Armor = armor); public static Task<float> GetMoveSpeedAsync(this IPlayer player) => AltVAsync.Schedule(() => player.MoveSpeed); public static Task<Position> GetAimPositionAsync(this IPlayer player) => AltVAsync.Schedule(() => player.AimPosition); public static Task<Rotation> GetHeadRotationAsync(this IPlayer player) => AltVAsync.Schedule(() => player.HeadRotation); public static Task<bool> IsInVehicleAsync(this IPlayer player) => AltVAsync.Schedule(() => player.IsInVehicle); public static async Task<IVehicle> GetVehicleAsync(this IPlayer player) { return await AltVAsync.Schedule(() => { unsafe { player.CheckIfEntityExists(); var vehiclePtr = Alt.Server.Library.Player_GetVehicle(player.NativePointer); return Alt.Module.VehiclePool.Get(vehiclePtr, out var vehicle) ? vehicle : null; } }); } public static Task<byte> GetSeatAsync(this IPlayer player) => AltVAsync.Schedule(() => player.Seat); public static Task<uint> GetPingAsync(this IPlayer player) => AltVAsync.Schedule(() => player.Ping); public static Task SpawnAsync(this IPlayer player, Position position) => AltVAsync.Schedule(() => player.Spawn(position)); public static Task DespawnAsync(this IPlayer player) => AltVAsync.Schedule(player.Despawn); public static Task SetDateTimeAsync(this IPlayer player, int day, int month, int year, int hour, int minute, int second) => AltVAsync.Schedule(() => player.SetDateTime(day, month, year, hour, minute, second)); public static Task SetDateTimeAsync(this IPlayer player, DateTime dateTime) => AltVAsync.Schedule(() => player.SetDateTime(dateTime)); public static Task SetWeatherAsync(this IPlayer player, uint weather) => AltVAsync.Schedule(() => player.SetWeather(weather)); public static Task GiveWeaponAsync(this IPlayer player, uint weapon, int ammo, bool selectWeapon) => AltVAsync.Schedule(() => player.GiveWeapon(weapon, ammo, selectWeapon)); public static Task RemoveWeaponAsync(this IPlayer player, uint weapon) => AltVAsync.Schedule(() => player.RemoveWeapon(weapon)); public static Task RemoveAllWeaponsAsync(this IPlayer player) => AltVAsync.Schedule(player.RemoveAllWeapons); public static Task SetMaxHealthAsync(this IPlayer player, ushort maxhealth) => AltVAsync.Schedule(() => player.MaxHealth = maxhealth); public static Task SetMaxArmorAsync(this IPlayer player, ushort maxarmor) => AltVAsync.Schedule(() => player.MaxArmor = maxarmor); public static Task SetCurrentWeaponAsync(this IPlayer player, uint weapon) => AltVAsync.Schedule(() => player.CurrentWeapon = weapon); public static async Task KickAsync(this IPlayer player, string reason) { var reasonPtr = AltNative.StringUtils.StringToHGlobalUtf8(reason); await AltVAsync.Schedule(() => { unsafe { player.CheckIfEntityExists(); Alt.Server.Library.Player_Kick(player.NativePointer, reasonPtr); } }); Marshal.FreeHGlobal(reasonPtr); } public static async Task EmitAsync(this IPlayer player, string eventName, params object[] args) { var size = args.Length; var mValues = new MValueConst[size]; Alt.Server.CreateMValues(mValues, args); var eventNamePtr = AltNative.StringUtils.StringToHGlobalUtf8(eventName); await AltVAsync.Schedule(() => { player.CheckIfEntityExists(); Alt.Server.TriggerClientEvent(player, eventNamePtr, mValues); }); Marshal.FreeHGlobal(eventNamePtr); for (var i = 0; i < size; i++) { mValues[i].Dispose(); } } } }
41.388889
108
0.605966
[ "MIT" ]
C0kkie/coreclr-module
api/AltV.Net.Async/AltAsync.Player.cs
6,705
C#
using System; using System.Collections.Generic; using System.Text; namespace CAMOWA.FBXRuntimeImporter { public class FBXProperty { //I'm going to regret doing this public FBXPropertyType propertyType; //PLS, THIS CAN'T BE THE ONLY WAY WITHOUT REFLECTION public bool boolProperty; public short int16Property; public int int32Property; public long int64Property; public float singleProperty; public double doubleProperty; public bool[] boolArrayProperty; public int[] int32ArrayProperty; public long[] int64ArrayProperty; public float[] singleArrayProperty; public double[] doubleArrayProperty; public string stringProperty; public byte[] rawBytesProperty; public FBXProperty(bool boolProperty){propertyType = FBXPropertyType.BOOL; this.boolProperty = boolProperty;} public FBXProperty(short int16Property) { propertyType = FBXPropertyType.INT16; this.int16Property = int16Property;} public FBXProperty(int int32Property) { propertyType = FBXPropertyType.INT32; this.int32Property = int32Property;} public FBXProperty(long int64Property) { propertyType = FBXPropertyType.INT64;this.int64Property = int64Property;} public FBXProperty(float singleProperty) { propertyType = FBXPropertyType.SINGLE; this.singleProperty = singleProperty;} public FBXProperty(double doubleProperty) { propertyType = FBXPropertyType.DOUBLE; this.doubleProperty = doubleProperty;} public FBXProperty(bool[] boolArrayProperty) { propertyType = FBXPropertyType.BOOL_ARRAY; this.boolArrayProperty = boolArrayProperty; } public FBXProperty(int[] int32ArrayProperty) { propertyType = FBXPropertyType.INT32_ARRAY; this.int32ArrayProperty = int32ArrayProperty;} public FBXProperty(long[] int64ArrayProperty) { propertyType = FBXPropertyType.INT64_ARRAY; this.int64ArrayProperty = int64ArrayProperty;} public FBXProperty(float[] singleArrayProperty) { propertyType = FBXPropertyType.SINGLE_ARRAY; this.singleArrayProperty= singleArrayProperty;} public FBXProperty(double[] doubleArrayProperty) { propertyType = FBXPropertyType.DOUBLE_ARRAY; this.doubleArrayProperty = doubleArrayProperty;} public FBXProperty(string stringProperty) { propertyType = FBXPropertyType.STRING; this.stringProperty = stringProperty;} public FBXProperty(byte[] rawBytesProperty) { propertyType = FBXPropertyType.RAW_BYTES; this.rawBytesProperty = rawBytesProperty;} override public string ToString() { string s = ""; switch (propertyType) { case FBXPropertyType.BOOL: return "Bool: " + boolProperty.ToString(); case FBXPropertyType.INT16: return "Int 16: " + int16Property.ToString(); case FBXPropertyType.INT32: return "Int32: " + int32Property.ToString(); case FBXPropertyType.INT64: return "Int64: " + int64Property.ToString(); case FBXPropertyType.SINGLE: return "Single: " + singleProperty.ToString(); case FBXPropertyType.DOUBLE: return "Double: " + doubleProperty.ToString(); case FBXPropertyType.BOOL_ARRAY: foreach (bool b in boolArrayProperty) s += b.ToString() + " , "; return $"Bool Array[{boolArrayProperty.Length}]: " + s; case FBXPropertyType.INT32_ARRAY: foreach (int i in int32ArrayProperty) s += i + " , "; return $"Int32 Array[{int32ArrayProperty.Length}]: "+ s; case FBXPropertyType.INT64_ARRAY: foreach (long l in int64ArrayProperty) s += l + " , "; return $"Int64 Array[{int64ArrayProperty.Length}]: "+ s; case FBXPropertyType.SINGLE_ARRAY: foreach (float f in singleArrayProperty) s += f + " , "; return $"Single Array[{singleArrayProperty.Length}]: "+ s; case FBXPropertyType.DOUBLE_ARRAY: foreach (int d in doubleArrayProperty) s += d + " , "; return $"Double Array[{doubleArrayProperty.Length}]: " + s; case FBXPropertyType.STRING: return $"String[{stringProperty.Length}]: " + stringProperty + $" (In ASCII: {FromHexToChar(stringProperty)})"; case FBXPropertyType.RAW_BYTES: for (int i = 0; i < rawBytesProperty.Length; i++) s += rawBytesProperty[i] + ((i%8==0 && i>0) ? " " : ""); return $"Raw Bytes[{rawBytesProperty.Length}]: " + s; } return s; } /// <summary> /// Only for the strings that come from the FBX file /// </summary> /// <param name="s"></param> /// <returns></returns> static public string FromHexToChar(string s) { string parsedString = ""; try { for (int i = 0; i < s.Length; i += 3) parsedString += Convert.ToChar(Convert.ToByte(s.Substring(i, 2), 16)); } catch { } return parsedString; } } public enum FBXPropertyType : byte { BOOL, INT16, INT32, INT64, SINGLE, DOUBLE, BOOL_ARRAY, INT64_ARRAY, INT32_ARRAY, SINGLE_ARRAY, DOUBLE_ARRAY, STRING, RAW_BYTES } }
45.390625
152
0.594492
[ "MIT" ]
ShoosGun/DIMOWA
CAMOWA/FileImporting/FbxImporter/GenericFBXNodeRead/FBXProperty.cs
5,812
C#
using System.Collections; using System.Threading; using UnityEngine; public class ForceRenderRate : MonoBehaviour { public float Rate = 90.0f; float currentFrameTime; void Start() { QualitySettings.vSyncCount = 0; Application.targetFrameRate = 9999; currentFrameTime = Time.realtimeSinceStartup; StartCoroutine("WaitForNextFrame"); } IEnumerator WaitForNextFrame() { while (true) { yield return new WaitForEndOfFrame(); currentFrameTime += 1.0f / Rate; var t = Time.realtimeSinceStartup; var sleepTime = currentFrameTime - t - 0.01f; if (sleepTime > 0) Thread.Sleep((int)(sleepTime * 1000)); while (t < currentFrameTime) t = Time.realtimeSinceStartup; } } }
26.65625
57
0.596717
[ "BSD-3-Clause" ]
maddoxlab/VRSpeechCorpusBooth
VRSpeechCorpusBooth-Unity/Assets/Experiment_Tools/Scripts/ForceRenderRate.cs
855
C#
// <copyright file="AmazonFiles.cs" company="Rambalac"> // Copyright (c) Rambalac. All rights reserved. // </copyright> using System; using System.IO; using System.Threading; using System.Threading.Tasks; namespace Azi.Amazon.CloudDrive.Http { /// <summary> /// Information about file to upload /// </summary> public class FileUpload { /// <summary> /// Gets or sets folder Id to place new file into. /// </summary> public string ParentId { get; set; } /// <summary> /// Gets or sets file name /// </summary> public string FileName { get; set; } /// <summary> /// Gets or sets Stream creator func with content to upload. Can be requested multiple time in case of retry. /// </summary> public Func<Stream> StreamOpener { get; set; } /// <summary> /// Gets or sets upload Cancellation Token /// </summary> public CancellationToken CancellationToken { get; set; } /// <summary> /// Gets or sets a value indicating whether allow duplicate uploads allowed. /// If it's False and file MD5 is the same as some other file in the cloud then HTTP error Conflict will be thrown /// </summary> public bool AllowDuplicate { get; set; } = true; /// <summary> /// Gets or sets size of memory buffer for stream operations /// </summary> public int BufferSize { get; set; } = 81920; /// <summary> /// Gets or sets func that receive progress and provide next position for progress report. /// Next position is not guarantied and depends on upload buffer. /// </summary> public Func<long, long> Progress { get; set; } = null; /// <summary> /// Gets or sets async func that receive progress and provide next position for progress report as Task result. /// Next position is not guarantied and depends on upload buffer. /// </summary> public Func<long, Task<long>> ProgressAsync { get; set; } = null; } }
34.95
122
0.604673
[ "MIT" ]
J-kit/AmazonCloudDriveApi
AmazonCloudDriveApi/Http/FileUpload.cs
2,099
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; using Xunit; namespace System.Net.Quic.Tests { [ConditionalClass(typeof(MsQuicTests), nameof(IsMsQuicSupported))] public class MsQuicTests : MsQuicTestBase { public static bool IsMsQuicSupported => QuicImplementationProviders.MsQuic.IsSupported; private static ReadOnlyMemory<byte> s_data = Encoding.UTF8.GetBytes("Hello world!"); [Fact] public async Task UnidirectionalAndBidirectionalStreamCountsWork() { using QuicListener listener = CreateQuicListener(); using QuicConnection clientConnection = CreateQuicConnection(listener.ListenEndPoint); ValueTask clientTask = clientConnection.ConnectAsync(); using QuicConnection serverConnection = await listener.AcceptConnectionAsync(); await clientTask; Assert.Equal(100, serverConnection.GetRemoteAvailableBidirectionalStreamCount()); Assert.Equal(100, serverConnection.GetRemoteAvailableUnidirectionalStreamCount()); } [Fact] public async Task UnidirectionalAndBidirectionalChangeValues() { using QuicListener listener = CreateQuicListener(); QuicClientConnectionOptions options = new QuicClientConnectionOptions() { MaxBidirectionalStreams = 10, MaxUnidirectionalStreams = 20, RemoteEndPoint = listener.ListenEndPoint, ClientAuthenticationOptions = GetSslClientAuthenticationOptions() }; using QuicConnection clientConnection = new QuicConnection(QuicImplementationProviders.MsQuic, options); ValueTask clientTask = clientConnection.ConnectAsync(); using QuicConnection serverConnection = await listener.AcceptConnectionAsync(); await clientTask; Assert.Equal(100, clientConnection.GetRemoteAvailableBidirectionalStreamCount()); Assert.Equal(100, clientConnection.GetRemoteAvailableUnidirectionalStreamCount()); Assert.Equal(10, serverConnection.GetRemoteAvailableBidirectionalStreamCount()); Assert.Equal(20, serverConnection.GetRemoteAvailableUnidirectionalStreamCount()); } [Fact] [OuterLoop("May take several seconds")] public async Task SetListenerTimeoutWorksWithSmallTimeout() { var quicOptions = new QuicListenerOptions(); quicOptions.IdleTimeout = TimeSpan.FromSeconds(10); quicOptions.ServerAuthenticationOptions = GetSslServerAuthenticationOptions(); quicOptions.ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0); using QuicListener listener = new QuicListener(QuicImplementationProviders.MsQuic, quicOptions); listener.Start(); QuicClientConnectionOptions options = new QuicClientConnectionOptions() { RemoteEndPoint = listener.ListenEndPoint, ClientAuthenticationOptions = GetSslClientAuthenticationOptions(), }; using QuicConnection clientConnection = new QuicConnection(QuicImplementationProviders.MsQuic, options); ValueTask clientTask = clientConnection.ConnectAsync(); using QuicConnection serverConnection = await listener.AcceptConnectionAsync(); await clientTask; await Assert.ThrowsAsync<QuicOperationAbortedException>(async () => await serverConnection.AcceptStreamAsync().AsTask().WaitAsync(TimeSpan.FromSeconds(100))); } [ActiveIssue("https://github.com/dotnet/runtime/issues/49157")] [Theory] [MemberData(nameof(WriteData))] public async Task WriteTests(int[][] writes, WriteType writeType) { await RunClientServer( async clientConnection => { await using QuicStream stream = clientConnection.OpenUnidirectionalStream(); foreach (int[] bufferLengths in writes) { switch (writeType) { case WriteType.SingleBuffer: foreach (int bufferLength in bufferLengths) { await stream.WriteAsync(new byte[bufferLength]); } break; case WriteType.GatheredBuffers: var buffers = bufferLengths .Select(bufferLength => new ReadOnlyMemory<byte>(new byte[bufferLength])) .ToArray(); await stream.WriteAsync(buffers); break; case WriteType.GatheredSequence: var firstSegment = new BufferSegment(new byte[bufferLengths[0]]); BufferSegment lastSegment = firstSegment; foreach (int bufferLength in bufferLengths.Skip(1)) { lastSegment = lastSegment.Append(new byte[bufferLength]); } var buffer = new ReadOnlySequence<byte>(firstSegment, 0, lastSegment, lastSegment.Memory.Length); await stream.WriteAsync(buffer); break; default: Debug.Fail("Unknown write type."); break; } } stream.Shutdown(); await stream.ShutdownCompleted(); }, async serverConnection => { await using QuicStream stream = await serverConnection.AcceptStreamAsync(); var buffer = new byte[4096]; int receivedBytes = 0, totalBytes = 0; while ((receivedBytes = await stream.ReadAsync(buffer)) != 0) { totalBytes += receivedBytes; } int expectedTotalBytes = writes.SelectMany(x => x).Sum(); Assert.Equal(expectedTotalBytes, totalBytes); stream.Shutdown(); await stream.ShutdownCompleted(); }); } public static IEnumerable<object[]> WriteData() { var bufferSizes = new[] { 1, 502, 15_003, 1_000_004 }; var r = new Random(); return from bufferCount in new[] { 1, 2, 3, 10 } from writeType in Enum.GetValues<WriteType>() let writes = Enumerable.Range(0, 5) .Select(_ => Enumerable.Range(0, bufferCount) .Select(_ => bufferSizes[r.Next(bufferSizes.Length)]) .ToArray()) .ToArray() select new object[] { writes, writeType }; } public enum WriteType { SingleBuffer, GatheredBuffers, GatheredSequence } // will induce failure (byte mixing) in QuicStreamTests_MsQuicProvider.LargeDataSentAndReceived if run in parallel with it [Fact] public async Task CallDifferentWriteMethodsWorks() { using QuicListener listener = CreateQuicListener(); using QuicConnection clientConnection = CreateQuicConnection(listener.ListenEndPoint); ValueTask clientTask = clientConnection.ConnectAsync(); using QuicConnection serverConnection = await listener.AcceptConnectionAsync(); await clientTask; ReadOnlyMemory<byte> helloWorld = Encoding.ASCII.GetBytes("Hello world!"); ReadOnlySequence<byte> ros = CreateReadOnlySequenceFromBytes(helloWorld.ToArray()); Assert.False(ros.IsSingleSegment); using QuicStream clientStream = clientConnection.OpenBidirectionalStream(); ValueTask writeTask = clientStream.WriteAsync(ros); using QuicStream serverStream = await serverConnection.AcceptStreamAsync(); await writeTask; byte[] memory = new byte[24]; int res = await serverStream.ReadAsync(memory); Assert.Equal(12, res); ReadOnlyMemory<ReadOnlyMemory<byte>> romrom = new ReadOnlyMemory<ReadOnlyMemory<byte>>(new ReadOnlyMemory<byte>[] { helloWorld, helloWorld }); await clientStream.WriteAsync(romrom); res = await serverStream.ReadAsync(memory); Assert.Equal(24, res); } [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/49157")] public async Task CloseAsync_ByServer_AcceptThrows() { await RunClientServer( clientConnection => { return Task.CompletedTask; }, async serverConnection => { var acceptTask = serverConnection.AcceptStreamAsync(); await serverConnection.CloseAsync(errorCode: 0); // make sure await Assert.ThrowsAsync<QuicOperationAbortedException>(() => acceptTask.AsTask()); }); } internal static ReadOnlySequence<byte> CreateReadOnlySequenceFromBytes(byte[] data) { List<byte[]> segments = new List<byte[]> { Array.Empty<byte>() }; foreach (var b in data) { segments.Add(new[] { b }); segments.Add(Array.Empty<byte>()); } return CreateSegments(segments.ToArray()); } private static ReadOnlySequence<byte> CreateSegments(params byte[][] inputs) { if (inputs == null || inputs.Length == 0) { throw new InvalidOperationException(); } int i = 0; BufferSegment last = null; BufferSegment first = null; do { byte[] s = inputs[i]; int length = s.Length; int dataOffset = length; var chars = new byte[length * 2]; for (int j = 0; j < length; j++) { chars[dataOffset + j] = s[j]; } // Create a segment that has offset relative to the OwnedMemory and OwnedMemory itself has offset relative to array var memory = new Memory<byte>(chars).Slice(length, length); if (first == null) { first = new BufferSegment(memory); last = first; } else { last = last.Append(memory); } i++; } while (i < inputs.Length); return new ReadOnlySequence<byte>(first, 0, last, last.Memory.Length); } internal class BufferSegment : ReadOnlySequenceSegment<byte> { public BufferSegment(ReadOnlyMemory<byte> memory) { Memory = memory; } public BufferSegment Append(ReadOnlyMemory<byte> memory) { var segment = new BufferSegment(memory) { RunningIndex = RunningIndex + Memory.Length }; Next = segment; return segment; } } } }
40.221854
170
0.551
[ "MIT" ]
ericstj/runtime
src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs
12,147
C#
#if !NETSTANDARD13 /* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the iam-2010-05-08.normal.json service model. */ using System; using System.Collections.Generic; using System.Text; using System.Collections; using System.Threading; using System.Threading.Tasks; using Amazon.Runtime; namespace Amazon.IdentityManagement.Model { /// <summary> /// Base class for ListRolePolicies paginators. /// </summary> internal sealed partial class ListRolePoliciesPaginator : IPaginator<ListRolePoliciesResponse>, IListRolePoliciesPaginator { private readonly IAmazonIdentityManagementService _client; private readonly ListRolePoliciesRequest _request; private int _isPaginatorInUse = 0; /// <summary> /// Enumerable containing all full responses for the operation /// </summary> public IPaginatedEnumerable<ListRolePoliciesResponse> Responses => new PaginatedResponse<ListRolePoliciesResponse>(this); /// <summary> /// Enumerable containing all of the PolicyNames /// </summary> public IPaginatedEnumerable<string> PolicyNames => new PaginatedResultKeyResponse<ListRolePoliciesResponse, string>(this, (i) => i.PolicyNames); internal ListRolePoliciesPaginator(IAmazonIdentityManagementService client, ListRolePoliciesRequest request) { this._client = client; this._request = request; } #if BCL IEnumerable<ListRolePoliciesResponse> IPaginator<ListRolePoliciesResponse>.Paginate() { if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0) { throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance."); } PaginatorUtils.SetUserAgentAdditionOnRequest(_request); var marker = _request.Marker; ListRolePoliciesResponse response; do { _request.Marker = marker; response = _client.ListRolePolicies(_request); marker = response.Marker; yield return response; } while (response.IsTruncated); } #endif #if AWS_ASYNC_ENUMERABLES_API async IAsyncEnumerable<ListRolePoliciesResponse> IPaginator<ListRolePoliciesResponse>.PaginateAsync(CancellationToken cancellationToken = default) { if (Interlocked.Exchange(ref _isPaginatorInUse, 1) != 0) { throw new System.InvalidOperationException("Paginator has already been consumed and cannot be reused. Please create a new instance."); } PaginatorUtils.SetUserAgentAdditionOnRequest(_request); var marker = _request.Marker; ListRolePoliciesResponse response; do { _request.Marker = marker; response = await _client.ListRolePoliciesAsync(_request, cancellationToken).ConfigureAwait(false); marker = response.Marker; cancellationToken.ThrowIfCancellationRequested(); yield return response; } while (response.IsTruncated); } #endif } } #endif
39.969697
154
0.652009
[ "Apache-2.0" ]
philasmar/aws-sdk-net
sdk/src/Services/IdentityManagement/Generated/Model/_bcl45+netstandard/ListRolePoliciesPaginator.cs
3,957
C#
using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Abp; using Abp.Extensions; using Abp.Notifications; using Abp.Timing; using AbpAlain.Controllers; namespace AbpAlain.Web.Host.Controllers { public class HomeController : AbpAlainControllerBase { private readonly INotificationPublisher _notificationPublisher; public HomeController(INotificationPublisher notificationPublisher) { _notificationPublisher = notificationPublisher; } public IActionResult Index() { return Redirect("/swagger"); } /// <summary> /// This is a demo code to demonstrate sending notification to default tenant admin and host admin uers. /// Don't use this code in production !!! /// </summary> /// <param name="message"></param> /// <returns></returns> public async Task<ActionResult> TestNotification(string message = "") { if (message.IsNullOrEmpty()) { message = "This is a test notification, created at " + Clock.Now; } var defaultTenantAdmin = new UserIdentifier(1, 2); var hostAdmin = new UserIdentifier(null, 1); await _notificationPublisher.PublishAsync( "App.SimpleMessage", new MessageNotificationData(message), severity: NotificationSeverity.Info, userIds: new[] { defaultTenantAdmin, hostAdmin } ); return Content("Sent notification: " + message); } } }
30.846154
112
0.610973
[ "MIT" ]
ZhaoRd/abp-alain
aspnet-core/src/AbpAlain.Web.Host/Controllers/HomeController.cs
1,604
C#
using Newtonsoft.Json.Linq; using ReactNative.UIManager.Events; using System; #if WINDOWS_UWP using Windows.UI.Xaml.Controls; #else using System.Windows.Controls; #endif namespace ReactNative.Views.TextInput { /// <summary> /// Event emitted by <see cref="TextBox"/> native /// view when the control gains focus. /// </summary> class ReactTextInputBlurEvent : Event { /// <summary> /// Instantiate a <see cref="ReactTextInputBlurEvent"/>. /// </summary> /// <param name="viewTag">The view tag.</param> public ReactTextInputBlurEvent(int viewTag) : base(viewTag, TimeSpan.FromTicks(Environment.TickCount)) { } /// <summary> /// The event name. /// </summary> public override string EventName { get { return "topBlur"; } } /// <summary> /// Disabling event coalescing. /// </summary> /// <remarks> /// Return false if the event can never be coalesced. /// </remarks> public override bool CanCoalesce { get { return false; } } /// <summary> /// Dispatch this event to JavaScript using the given event emitter. /// </summary> /// <param name="eventEmitter">The event emitter.</param> public override void Dispatch(RCTEventEmitter eventEmitter) { var eventData = new JObject { { "target", ViewTag }, }; eventEmitter.receiveEvent(ViewTag, EventName, eventData); } } }
25.522388
76
0.530994
[ "MIT" ]
bluejeans/react-native-windows
ReactWindows/ReactNative.Shared/Views/TextInput/ReactTextInputBlurEvent.cs
1,712
C#
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; namespace ParkingSlotAPI { public class Program { public static void Main(string[] args) { CreateWebHostBuilder(args).Build().Run(); } public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>(); } }
24.4
76
0.695082
[ "MIT" ]
jlgoh/Parking-Slot-Web-App
backend/ParkingSlotAPI/Program.cs
612
C#
// Copyright 2010 Chris Patterson // // 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 Stact.Configuration.Builders { using System; using System.Threading; public class SynchronizedChannelBuilder<TChannel> : ChannelBuilder<TChannel> { readonly ChannelBuilder<TChannel> _builder; readonly object _state; readonly SynchronizationContext _synchronizationContext; public SynchronizedChannelBuilder(ChannelBuilder<TChannel> builder, SynchronizationContext synchronizationContext, object state) { _builder = builder; _synchronizationContext = synchronizationContext; _state = state; } public void AddChannel(Fiber fiber, Func<Fiber, Channel<TChannel>> channelFactory) { _builder.AddChannel(fiber, x => { Channel<TChannel> channel = channelFactory(new SynchronousFiber()); return new SynchronizedChannel<TChannel>(fiber, channel, _synchronizationContext, _state); }); } public void AddDisposable(IDisposable disposable) { _builder.AddDisposable(disposable); } } }
33.346939
117
0.71787
[ "Apache-2.0" ]
Nangal/Stact
src/Stact/Channels/Configuration/Builders/SynchronizedChannelBuilder.cs
1,636
C#
using System; using System.Collections.Generic; using Memorandum.Web.Framework.Utilities; using Newtonsoft.Json; namespace Memorandum.Web.Middleware { /// <summary> /// SessionContext object, identifies source of incoming request. Used as datacontainer for attaching any data to /// current session e.g. User /// </summary> internal class SessionContext : Context { private static readonly JsonSerializerSettings JsonSerializerSettings = new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.Auto, ReferenceLoopHandling = ReferenceLoopHandling.Ignore, PreserveReferencesHandling = PreserveReferencesHandling.Objects }; public SessionContext(string key, DateTime expires) { Key = key; Expires = expires; } public bool CookieExist { get; set; } public string Key { get; private set; } public DateTime Expires { get; private set; } public string Serialize() { return JsonConvert.SerializeObject(Data, JsonSerializerSettings); } public void Deserialize(string input) { Data = JsonConvert.DeserializeObject<Dictionary<string, object>>(input, JsonSerializerSettings); } } }
32.357143
121
0.637233
[ "MIT" ]
bshishov/Memorandum.Net
Memorandum.Web/Middleware/SessionContext.cs
1,361
C#
using TopupPortal.Application.Common.Models; using Microsoft.AspNetCore.Identity; using System.Linq; namespace TopupPortal.Infrastructure.Identity { public static class IdentityResultExtensions { public static Result ToApplicationResult(this IdentityResult result) { return result.Succeeded ? Result.Success() : Result.Failure(result.Errors.Select(e => e.Description)); } } }
28.5625
76
0.673961
[ "MIT" ]
gagan2015/cleanarchitectureproto
src/Infrastructure/Identity/IdentityResultExtensions.cs
459
C#
using System; using UnityEngine; using VoxelEngine.Chunks.LightMapping; namespace VoxelEngine.Chunks.MeshGeneration { public readonly struct ChunkUpdateJob { public readonly int Id; public readonly VoxelWorld World; public readonly Chunk Chunk; public readonly Action<ChunkMeshResult> MeshCallback; public readonly Action<ChunkLightResult> LightCallback; public ChunkUpdateJob(int id, VoxelWorld world, Chunk chunk, Action<ChunkMeshResult> meshCallback, Action<ChunkLightResult> lightCallback) { Id = id; World = world; Chunk = chunk; MeshCallback = meshCallback; LightCallback = lightCallback; } } }
34.571429
148
0.681818
[ "MIT" ]
VektorKnight/VoxelEngine
Assets/VoxelEngine/Source/Chunks/MeshGeneration/ChunkUpdateJob.cs
726
C#
// Copyright 2016 Esri. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific // language governing permissions and limitations under the License. using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Mapping; using Esri.ArcGISRuntime.Portal; using Esri.ArcGISRuntime.Security; using Esri.ArcGISRuntime.Symbology; using Esri.ArcGISRuntime.Tasks; using Esri.ArcGISRuntime.Tasks.Offline; using Esri.ArcGISRuntime.UI; using Esri.ArcGISRuntime.UI.Controls; using Foundation; using UIKit; using Xamarin.Auth; namespace ArcGISRuntime.Samples.GenerateOfflineMap { [Register("GenerateOfflineMap")] [ArcGISRuntime.Samples.Shared.Attributes.Sample( "Generate offline map", "Map", "This sample demonstrates how to generate an offline map for a web map in ArcGIS Portal.", "When the app starts, a web map is loaded from ArcGIS Online. The red border shows the extent that of the data that will be downloaded for use offline. Click the `Take map offline` button to start the offline map job (you will be prompted for your ArcGIS Online login). The progress bar will show the job's progress. When complete, the offline map will replace the online map in the map view.")] public class GenerateOfflineMap : UIViewController, IOAuthAuthorizeHandler { // Hold references to UI controls. private MapView _myMapView; private UIActivityIndicatorView _loadingIndicator; private UIBarButtonItem _takeMapOfflineButton; private UILabel _statusLabel; private OAuth2Authenticator _auth; // The job to generate an offline map. private GenerateOfflineMapJob _generateOfflineMapJob; // The extent of the data to take offline. private readonly Envelope _areaOfInterest = new Envelope(-88.1541, 41.7690, -88.1471, 41.7720, SpatialReferences.Wgs84); // The ID for a web map item hosted on the server (water network map of Naperville IL). private const string WebMapId = "acc027394bc84c2fb04d1ed317aac674"; public GenerateOfflineMap() { Title = "Generate offline map"; } private async void Initialize() { try { // Start the loading indicator. _loadingIndicator.StartAnimating(); // Call a function to set up the AuthenticationManager for OAuth. SetOAuthInfo(); // Create the ArcGIS Online portal. ArcGISPortal portal = await ArcGISPortal.CreateAsync(); // Get the Naperville water web map item using its ID. PortalItem webmapItem = await PortalItem.CreateAsync(portal, WebMapId); // Create a map from the web map item. Map onlineMap = new Map(webmapItem); // Display the map in the MapView. _myMapView.Map = onlineMap; // Disable user interactions on the map (no panning or zooming from the initial extent). _myMapView.InteractionOptions = new MapViewInteractionOptions { IsEnabled = false }; // Create a graphics overlay for the extent graphic and apply a renderer. SimpleLineSymbol aoiOutlineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.Red, 3); GraphicsOverlay extentOverlay = new GraphicsOverlay { Renderer = new SimpleRenderer(aoiOutlineSymbol) }; _myMapView.GraphicsOverlays.Add(extentOverlay); // Add a graphic to show the area of interest (extent) that will be taken offline. Graphic aoiGraphic = new Graphic(_areaOfInterest); extentOverlay.Graphics.Add(aoiGraphic); // Hide the map loading progress indicator. _loadingIndicator.StopAnimating(); } catch (Exception ex) { // Show the exception message to the user. UIAlertController messageAlert = UIAlertController.Create("Error", ex.Message, UIAlertControllerStyle.Alert); messageAlert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); PresentViewController(messageAlert, true, null); } } private async void TakeMapOfflineButton_Click(object sender, EventArgs e) { // Show the loading indicator. _loadingIndicator.StartAnimating(); // Create a path for the output mobile map. string tempPath = $"{Path.GetTempPath()}"; string[] outputFolders = Directory.GetDirectories(tempPath, "NapervilleWaterNetwork*"); // Loop through the folder names and delete them. foreach (string dir in outputFolders) { try { // Delete the folder. Directory.Delete(dir, true); } catch (Exception) { // Ignore exceptions (files might be locked, for example). } } // Create a new folder for the output mobile map. string packagePath = Path.Combine(tempPath, @"NapervilleWaterNetwork"); int num = 1; while (Directory.Exists(packagePath)) { packagePath = Path.Combine(tempPath, @"NapervilleWaterNetwork" + num); num++; } // Create the output directory. Directory.CreateDirectory(packagePath); try { // Show the loading overlay while the job is running. _statusLabel.Text = "Taking map offline..."; // Create an offline map task with the current (online) map. OfflineMapTask takeMapOfflineTask = await OfflineMapTask.CreateAsync(_myMapView.Map); // Create the default parameters for the task, pass in the area of interest. GenerateOfflineMapParameters parameters = await takeMapOfflineTask.CreateDefaultGenerateOfflineMapParametersAsync(_areaOfInterest); // Create the job with the parameters and output location. _generateOfflineMapJob = takeMapOfflineTask.GenerateOfflineMap(parameters, packagePath); // Handle the progress changed event for the job. _generateOfflineMapJob.ProgressChanged += OfflineMapJob_ProgressChanged; // Await the job to generate geodatabases, export tile packages, and create the mobile map package. GenerateOfflineMapResult results = await _generateOfflineMapJob.GetResultAsync(); // Check for job failure (writing the output was denied, e.g.). if (_generateOfflineMapJob.Status != JobStatus.Succeeded) { // Report failure to the user. UIAlertController messageAlert = UIAlertController.Create("Error", "Failed to take the map offline.", UIAlertControllerStyle.Alert); messageAlert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); PresentViewController(messageAlert, true, null); } // Check for errors with individual layers. if (results.LayerErrors.Any()) { // Build a string to show all layer errors. System.Text.StringBuilder errorBuilder = new System.Text.StringBuilder(); foreach (KeyValuePair<Layer, Exception> layerError in results.LayerErrors) { errorBuilder.AppendLine(string.Format("{0} : {1}", layerError.Key.Id, layerError.Value.Message)); } // Show layer errors. UIAlertController messageAlert = UIAlertController.Create("Error", errorBuilder.ToString(), UIAlertControllerStyle.Alert); messageAlert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); PresentViewController(messageAlert, true, null); } // Display the offline map. _myMapView.Map = results.OfflineMap; // Apply the original viewpoint for the offline map. _myMapView.SetViewpoint(new Viewpoint(_areaOfInterest)); // Enable map interaction so the user can explore the offline data. _myMapView.InteractionOptions.IsEnabled = true; // Change the title and disable the "Take map offline" button. _statusLabel.Text = "Map is offline"; _takeMapOfflineButton.Enabled = false; } catch (TaskCanceledException) { // Generate offline map task was canceled. UIAlertController messageAlert = UIAlertController.Create("Canceled", "Taking map offline was canceled", UIAlertControllerStyle.Alert); messageAlert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); PresentViewController(messageAlert, true, null); } catch (Exception ex) { // Exception while taking the map offline. UIAlertController messageAlert = UIAlertController.Create("Error", ex.Message, UIAlertControllerStyle.Alert); messageAlert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); PresentViewController(messageAlert, true, null); } finally { // Hide the loading overlay when the job is done. _loadingIndicator.StopAnimating(); } } // Show changes in job progress. private void OfflineMapJob_ProgressChanged(object sender, EventArgs e) { // Get the job. GenerateOfflineMapJob job = sender as GenerateOfflineMapJob; // Dispatch to the UI thread. InvokeOnMainThread(() => { // Show the percent complete and update the progress bar. _statusLabel.Text = $"Taking map offline ({job.Progress}%) ..."; }); } public override void ViewDidLoad() { base.ViewDidLoad(); Initialize(); } public override void LoadView() { // Create the views. View = new UIView {BackgroundColor = UIColor.White}; _myMapView = new MapView(); _myMapView.TranslatesAutoresizingMaskIntoConstraints = false; _takeMapOfflineButton = new UIBarButtonItem(); _takeMapOfflineButton.Title = "Generate offline map"; UIToolbar toolbar = new UIToolbar(); toolbar.TranslatesAutoresizingMaskIntoConstraints = false; toolbar.Items = new[] { new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace), _takeMapOfflineButton, new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace) }; _statusLabel = new UILabel { Text = "Use the button to take the map offline.", AdjustsFontSizeToFitWidth = true, TextAlignment = UITextAlignment.Center, BackgroundColor = UIColor.FromWhiteAlpha(0, .6f), TextColor = UIColor.White, Lines = 1, TranslatesAutoresizingMaskIntoConstraints = false }; _loadingIndicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge); _loadingIndicator.TranslatesAutoresizingMaskIntoConstraints = false; _loadingIndicator.BackgroundColor = UIColor.FromWhiteAlpha(0, .6f); // Add the views. View.AddSubviews(_myMapView, toolbar, _loadingIndicator, _statusLabel); // Lay out the views. NSLayoutConstraint.ActivateConstraints(new[] { _myMapView.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor), _myMapView.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor), _myMapView.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor), _myMapView.BottomAnchor.ConstraintEqualTo(toolbar.TopAnchor), toolbar.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor), toolbar.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor), toolbar.BottomAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.BottomAnchor), _statusLabel.TopAnchor.ConstraintEqualTo(_myMapView.TopAnchor), _statusLabel.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor), _statusLabel.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor), _statusLabel.HeightAnchor.ConstraintEqualTo(40), _loadingIndicator.TopAnchor.ConstraintEqualTo(_statusLabel.BottomAnchor), _loadingIndicator.BottomAnchor.ConstraintEqualTo(View.BottomAnchor), _loadingIndicator.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor), _loadingIndicator.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor) }); } public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); // Subscribe to events. if (_generateOfflineMapJob != null) _generateOfflineMapJob.ProgressChanged += OfflineMapJob_ProgressChanged; _takeMapOfflineButton.Clicked += TakeMapOfflineButton_Click; } public override void ViewDidDisappear(bool animated) { base.ViewDidDisappear(animated); // Unsubscribe from events, per best practice. _generateOfflineMapJob.ProgressChanged -= OfflineMapJob_ProgressChanged; _takeMapOfflineButton.Clicked -= TakeMapOfflineButton_Click; } #region Authentication // Constants for OAuth-related values. // - The URL of the portal to authenticate with (ArcGIS Online). private const string ServerUrl = "https://www.arcgis.com/sharing/rest"; // - The Client ID for an app registered with the server (the ID below is for a public app created by the ArcGIS Runtime team). private const string AppClientId = @"lgAdHkYZYlwwfAhC"; // - A URL for redirecting after a successful authorization (this must be a URL configured with the app). private const string OAuthRedirectUrl = @"my-ags-app://auth"; private void SetOAuthInfo() { // Register the server information with the AuthenticationManager. ServerInfo serverInfo = new ServerInfo { ServerUri = new Uri(ServerUrl), TokenAuthenticationType = TokenAuthenticationType.OAuthImplicit, OAuthClientInfo = new OAuthClientInfo { ClientId = AppClientId, RedirectUri = new Uri(OAuthRedirectUrl) } }; // Register this server with AuthenticationManager. AuthenticationManager.Current.RegisterServer(serverInfo); // Use a function in this class to challenge for credentials. AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(CreateCredentialAsync); // Set the OAuthAuthorizeHandler component (this class) for Android or iOS platforms. AuthenticationManager.Current.OAuthAuthorizeHandler = this; } // ChallengeHandler function that will be called whenever access to a secured resource is attempted. private async Task<Credential> CreateCredentialAsync(CredentialRequestInfo info) { Credential credential = null; try { // IOAuthAuthorizeHandler will challenge the user for OAuth credentials. credential = await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri); } catch (TaskCanceledException) { return credential; } catch (Exception) { // Exception will be reported in calling function. throw; } return credential; } #region IOAuthAuthorizationHandler implementation // Use a TaskCompletionSource to track the completion of the authorization. private TaskCompletionSource<IDictionary<string, string>> _taskCompletionSource; // IOAuthAuthorizeHandler.AuthorizeAsync implementation. public Task<IDictionary<string, string>> AuthorizeAsync(Uri serviceUri, Uri authorizeUri, Uri callbackUri) { // If the TaskCompletionSource is not null, authorization may already be in progress and should be canceled. // Try to cancel any existing authentication process. _taskCompletionSource?.TrySetCanceled(); // Create a task completion source. _taskCompletionSource = new TaskCompletionSource<IDictionary<string, string>>(); // Create a new Xamarin.Auth.OAuth2Authenticator using the information passed in. _auth = new OAuth2Authenticator( clientId: AppClientId, scope: "", authorizeUrl: authorizeUri, redirectUrl: new Uri(OAuthRedirectUrl)) { ShowErrors = false, // Allow the user to cancel the OAuth attempt. AllowCancel = true }; // Define a handler for the OAuth2Authenticator.Completed event. _auth.Completed += (o, authArgs) => { try { // Dismiss the OAuth UI when complete. InvokeOnMainThread(() => { UIApplication.SharedApplication.KeyWindow.RootViewController.DismissViewController(true, null); }); // Check if the user is authenticated. if (authArgs.IsAuthenticated) { // If authorization was successful, get the user's account. Xamarin.Auth.Account authenticatedAccount = authArgs.Account; // Set the result (Credential) for the TaskCompletionSource. _taskCompletionSource.SetResult(authenticatedAccount.Properties); } else { throw new Exception("Unable to authenticate user."); } } catch (Exception ex) { // If authentication failed, set the exception on the TaskCompletionSource. _taskCompletionSource.TrySetException(ex); // Cancel authentication. _auth.OnCancelled(); } }; // If an error was encountered when authenticating, set the exception on the TaskCompletionSource. _auth.Error += (o, errArgs) => { // If the user cancels, the Error event is raised but there is no exception ... best to check first. if (errArgs.Exception != null) { _taskCompletionSource.TrySetException(errArgs.Exception); } else { // Login canceled: dismiss the OAuth login. _taskCompletionSource?.TrySetCanceled(); } // Cancel authentication. _auth.OnCancelled(); _auth = null; }; // Present the OAuth UI (on the app's UI thread) so the user can enter user name and password. InvokeOnMainThread(() => { UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(_auth.GetUI(), true, null); }); // Return completion source task so the caller can await completion. return _taskCompletionSource.Task; } #endregion #endregion } }
44.54334
403
0.61047
[ "Apache-2.0" ]
jf990/arcgis-runtime-samples-dotnet
src/iOS/Xamarin.iOS/Samples/Map/GenerateOfflineMap/GenerateOfflineMap.cs
21,069
C#
using Alfa.Domain.Entities; using System; using System.Collections.Generic; using System.Data.Entity; using System.Data.Entity.ModelConfiguration.Conventions; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Alfa.Infra.Repository { public class Context: DbContext { DbSet<Servico> Servicos { get; set; } public Context(): base("DefaultConnection") { Database.SetInitializer(new MigrateDatabaseToLatestVersion<Context, Alfa.Infra.Repository.Migrations.Configuration>("DefaultConnection")); } protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Conventions.Remove<PluralizingTableNameConvention>(); modelBuilder.Configurations.Add(new ServicoMap()); } } }
29.428571
150
0.713592
[ "MIT" ]
andrecamilo/alfa
Alfa.Data/EF/Context.cs
826
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Collections.Immutable; using System.Diagnostics; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.Emit; namespace Microsoft.CodeAnalysis.CSharp.Emit { /// <summary> /// Represents a reference to a field of a generic type instantiation. /// e.g. /// A{int}.Field /// A{int}.B{string}.C.Field /// </summary> internal sealed class SpecializedFieldReference : TypeMemberReference, Cci.ISpecializedFieldReference { private readonly FieldSymbol _underlyingField; public SpecializedFieldReference(FieldSymbol underlyingField) { Debug.Assert((object)underlyingField != null); _underlyingField = underlyingField; } protected override Symbol UnderlyingSymbol { get { return _underlyingField; } } public override void Dispatch(Cci.MetadataVisitor visitor) { visitor.Visit((Cci.ISpecializedFieldReference)this); } Cci.IFieldReference Cci.ISpecializedFieldReference.UnspecializedVersion { get { Debug.Assert(_underlyingField.OriginalDefinition.IsDefinition); return _underlyingField.OriginalDefinition; } } Cci.ISpecializedFieldReference Cci.IFieldReference.AsSpecializedFieldReference { get { return this; } } Cci.ITypeReference Cci.IFieldReference.GetType(EmitContext context) { TypeWithAnnotations oldType = _underlyingField.TypeWithAnnotations; var customModifiers = oldType.CustomModifiers; var type = ((PEModuleBuilder)context.Module).Translate(oldType.Type, syntaxNodeOpt: (CSharpSyntaxNode)context.SyntaxNodeOpt, diagnostics: context.Diagnostics); if (customModifiers.Length == 0) { return type; } else { return new Cci.ModifiedTypeReference(type, ImmutableArray<Cci.ICustomModifier>.CastUp(customModifiers)); } } Cci.IFieldDefinition Cci.IFieldReference.GetResolvedField(EmitContext context) { return null; } bool Cci.IFieldReference.IsContextualNamedEntity { get { return false; } } } }
30.179775
171
0.613924
[ "MIT" ]
06needhamt/roslyn
src/Compilers/CSharp/Portable/Emitter/Model/SpecializedFieldReference.cs
2,688
C#
using GeneralUpdate.Common.Models; using System.Collections.Generic; namespace GeneralUpdate.Core.Models { public sealed class UpdatePacket : FileBase { /// <summary> /// Update check api address. /// </summary> public string MainUpdateUrl { get; set; } /// <summary> /// Validate update url. /// </summary> public string MainValidateUrl { get; set; } /// <summary> /// 1:ClientApp 2:UpdateApp /// </summary> public int ClientType { get; set; } /// <summary> /// Update check api address. /// </summary> public string UpdateUrl { get; set; } /// <summary> /// Validate update url. /// </summary> public string ValidateUrl { get; set; } /// <summary> /// Need to start the name of the app. /// </summary> public string AppName { get; set; } public string MainAppName { get; set; } /// <summary> /// Update package file format(Defult format is Zip). /// </summary> public string Format { get; set; } /// <summary> /// Whether to force update. /// </summary> public bool IsUpdate { get; set; } /// <summary> /// Update log web address. /// </summary> public string UpdateLogUrl { get; set; } /// <summary> /// Version information that needs to be updated. /// </summary> public List<UpdateVersion> UpdateVersions { get; set; } } }
26.316667
63
0.523749
[ "MIT" ]
jianyuyanyu/AutoUpdater
src/GeneralUpdate.Core/Models/UpdatePacket.cs
1,581
C#
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using Xunit.Sdk; namespace Xunit { /// <summary> /// Exception thrown when an All assertion has one or more items fail an assertion. /// </summary> public class AllException : XunitException { readonly IReadOnlyList<Tuple<int, object, Exception>> errors; readonly int totalItems; /// <summary> /// Creates a new instance of the <see cref="AllException"/> class. /// </summary> /// <param name="totalItems">The total number of items that were in the collection.</param> /// <param name="errors">The list of errors that occurred during the test pass.</param> public AllException(int totalItems, Tuple<int, object, Exception>[] errors) : base("Assert.All() Failure") { this.errors = errors; this.totalItems = totalItems; } /// <summary> /// The errors that occurred during execution of the test. /// </summary> public IReadOnlyList<Exception> Failures { get { return this.errors.Select(t => t.Item3).ToList(); } } /// <inheritdoc/> public override string Message { get { var formattedErrors = this.errors.Select(error => { var indexString = string.Format(CultureInfo.CurrentCulture, "[{0}]: ", error.Item1); var spaces = Environment.NewLine + "".PadRight(indexString.Length); return string.Format(CultureInfo.CurrentCulture, "{0}Item: {1}{2}{3}", indexString, error.Item2?.ToString()?.Replace(Environment.NewLine, spaces), spaces, error.Item3.ToString().Replace(Environment.NewLine, spaces)); }); return string.Format(CultureInfo.CurrentCulture, "{0}: {1} out of {2} items in the collection did not pass.{3}{4}", base.Message, this.errors.Count, this.totalItems, Environment.NewLine, string.Join(Environment.NewLine, formattedErrors)); } } } }
40.222222
110
0.506314
[ "Apache-2.0" ]
ChrML/Bridge.xUn
Bridge.xUnit/Exceptions/AllException.cs
2,536
C#
// OnionFruit API/Tooling Copyright DragonFruit Network // Licensed under the MIT License. Please refer to the LICENSE file at the root of this project for details using System; using System.Collections.Generic; using System.Runtime.Serialization; using Newtonsoft.Json; namespace DragonFruit.OnionFruit.Api.Objects { [Serializable, DataContract] [JsonObject(MemberSerialization.OptIn)] public class TorNodeBandwidthHistory { [DataMember(Name = "fingerprint")] public string Fingerprint { get; set; } [DataMember(Name = "write_history")] public IReadOnlyDictionary<string, TorHistoryGraph> WriteHistory { get; set; } [DataMember(Name = "read_history")] public IReadOnlyDictionary<string, TorHistoryGraph> ReadHistory { get; set; } [DataMember(Name = "overload_ratelimits")] public TorNodeOverloadRateLimit OverloadRateLimits { get; set; } } }
33.321429
107
0.723473
[ "MIT" ]
dragonfruitnetwork/OnionFruit.Status
src/Objects/TorNodeBandwidthHistory.cs
935
C#
namespace IDisposableAnalyzers { using Gu.Roslyn.AnalyzerExtensions; internal class TaskType : QualifiedType { internal readonly QualifiedMethod FromResult; internal readonly QualifiedMethod Run; internal readonly QualifiedMethod RunOfT; internal readonly QualifiedMethod ConfigureAwait; internal readonly QualifiedProperty CompletedTask; internal TaskType() : base("System.Threading.Tasks.Task") { this.FromResult = new QualifiedMethod(this, nameof(this.FromResult)); this.Run = new QualifiedMethod(this, nameof(this.Run)); this.RunOfT = new QualifiedMethod(this, $"{nameof(this.Run)}`1"); this.ConfigureAwait = new QualifiedMethod(this, nameof(this.ConfigureAwait)); this.CompletedTask = new QualifiedProperty(this, nameof(this.CompletedTask)); } } }
37.791667
89
0.675854
[ "MIT" ]
AArnott/IDisposableAnalyzers
IDisposableAnalyzers/Helpers/KnownSymbols/TaskType.cs
907
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class MonoSingleton<T> : MonoBehaviour where T : MonoBehaviour { protected static T instance = null; public static T Instance { get { instance = FindObjectOfType(typeof(T)) as T; if (instance == null) { instance = new GameObject("@" + typeof(T).ToString(), typeof(T)).AddComponent<T>(); DontDestroyOnLoad(instance); } return instance; } } }
28.041667
72
0.473997
[ "Apache-2.0" ]
KENEW/DontSummon
Assets/Script/Manage/MonoSingleton.cs
675
C#
// // webserver.com // Copyright (c) 2009 // by Michael Washington // // redhound.ru // Copyright (c) 2013 // by Roman M. Yagodin // // 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. // // Silk icon set 1.3 by // Mark James // http://www.famfamfam.com/lab/icons/silk/ // Creative Commons Attribution 2.5 License. // [ http://creativecommons.org/licenses/by/2.5/ ] using System; using System.Linq; using System.Collections.Generic; using DotNetNuke.Common; using DotNetNuke.Entities.Users; using System.Web.UI.WebControls; using System.IO; using System.Text; using System.Collections; using DotNetNuke.Services.Exceptions; using DotNetNuke.Security.Roles; using System.Web.UI.HtmlControls; using System.Web.UI; using Microsoft.VisualBasic; using DotNetNuke.Services.Localization; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Actions; namespace R7.HelpDesk { #region ExistingTasks [Serializable] public class ExistingTasks { public int TaskID { get; set; } public string Status { get; set; } public string Priority { get; set; } public DateTime? DueDate { get; set; } public DateTime? CreatedDate { get; set; } public string Assigned { get; set; } public string Description { get; set; } public string Requester { get; set; } public string RequesterName { get; set; } public string Search { get; set; } public int?[] Categories { get; set; } } #endregion #region AssignedRoles public class AssignedRoles { public string AssignedRoleID { get; set; } public string Key { get; set; } } #endregion #region ListPage public class ListPage { public int PageNumber { get; set; } } #endregion public partial class View : PortalModuleBase, IActionable { #region SortExpression public string SortExpression { get { if (ViewState["SortExpression"] == null) { ViewState["SortExpression"] = string.Empty; } return Convert.ToString(ViewState["SortExpression"]); } set { ViewState["SortExpression"] = value; } } #endregion #region SortDirection public string SortDirection { get { if (ViewState["SortDirection"] == null) { ViewState["SortDirection"] = string.Empty; } return Convert.ToString(ViewState["SortDirection"]); } set { ViewState["SortDirection"] = value; } } #endregion #region SearchCriteria public HelpDesk_LastSearch SearchCriteria { get { return GetLastSearchCriteria(); } } #endregion #region CurrentPage public string CurrentPage { get { if (ViewState["CurrentPage"] == null) { ViewState["CurrentPage"] = "1"; } return Convert.ToString(ViewState["CurrentPage"]); } set { ViewState["CurrentPage"] = value; } } #endregion #region LocalizeStatusBinding public string LocalizeStatusBinding(string Value) { // From: http://helpdesk.codeplex.com/workitem/26043 return Localization.GetString(string.Format("ddlStatusAdmin{0}",Value.Replace(" ","")), LocalResourceFile); } #endregion #region LocalizePriorityBinding public string LocalizePriorityBinding(string Value) { // From: http://helpdesk.codeplex.com/workitem/26043 return Localization.GetString(string.Format("ddlPriority{0}", Value.Replace(" ", "")), LocalResourceFile); } #endregion protected override void OnInit (EventArgs e) { base.OnInit (e); lnkAdministratorSettings.NavigateUrl = EditUrl ("AdminSettings"); } protected void Page_Load(object sender, EventArgs e) { try { cmdStartCalendar.NavigateUrl = DotNetNuke.Common.Utilities.Calendar.InvokePopupCal(txtDueDate); if (!Page.IsPostBack) { ShowAdministratorLinkAndFileUpload(); ShowExistingTicketsLink(); txtUserID.Text = UserId.ToString(); DisplayCategoryTree(); if (Request.QueryString["Ticket"] != null) { if (Convert.ToString(Request.QueryString["Ticket"]) == "new") { SetView("New Ticket"); ShowAdministratorLinkAndFileUpload(); } } } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } } #region GetLastSearchCriteria private HelpDesk_LastSearch GetLastSearchCriteria() { HelpDeskDALDataContext objHelpDeskDALDataContext = new HelpDeskDALDataContext(); HelpDesk_LastSearch objHelpDesk_LastSearch = (from HelpDesk_LastSearches in objHelpDeskDALDataContext.HelpDesk_LastSearches where HelpDesk_LastSearches.PortalID == PortalId where HelpDesk_LastSearches.UserID == UserId select HelpDesk_LastSearches).FirstOrDefault(); if (objHelpDesk_LastSearch == null) { HelpDesk_LastSearch InsertHelpDesk_LastSearch = new HelpDesk_LastSearch(); InsertHelpDesk_LastSearch.UserID = UserId; InsertHelpDesk_LastSearch.PortalID = PortalId; objHelpDeskDALDataContext.HelpDesk_LastSearches.InsertOnSubmit(InsertHelpDesk_LastSearch); // Only save is user is logged in if (UserId > -1) { objHelpDeskDALDataContext.SubmitChanges(); } return InsertHelpDesk_LastSearch; } else { return objHelpDesk_LastSearch; } } #endregion #region SaveLastSearchCriteria private void SaveLastSearchCriteria(HelpDesk_LastSearch UpdateHelpDesk_LastSearch) { HelpDeskDALDataContext objHelpDeskDALDataContext = new HelpDeskDALDataContext(); HelpDesk_LastSearch objHelpDesk_LastSearch = (from HelpDesk_LastSearches in objHelpDeskDALDataContext.HelpDesk_LastSearches where HelpDesk_LastSearches.PortalID == PortalId where HelpDesk_LastSearches.UserID == UserId select HelpDesk_LastSearches).FirstOrDefault(); if (objHelpDesk_LastSearch == null) { objHelpDesk_LastSearch = new HelpDesk_LastSearch(); objHelpDesk_LastSearch.UserID = UserId; objHelpDesk_LastSearch.PortalID = PortalId; objHelpDeskDALDataContext.HelpDesk_LastSearches.InsertOnSubmit(objHelpDesk_LastSearch); objHelpDeskDALDataContext.SubmitChanges(); } objHelpDesk_LastSearch.AssignedRoleID = UpdateHelpDesk_LastSearch.AssignedRoleID; objHelpDesk_LastSearch.Categories = UpdateHelpDesk_LastSearch.Categories; objHelpDesk_LastSearch.CreatedDate = UpdateHelpDesk_LastSearch.CreatedDate; objHelpDesk_LastSearch.SearchText = UpdateHelpDesk_LastSearch.SearchText; objHelpDesk_LastSearch.DueDate = UpdateHelpDesk_LastSearch.DueDate; objHelpDesk_LastSearch.Priority = UpdateHelpDesk_LastSearch.Priority; objHelpDesk_LastSearch.Status = UpdateHelpDesk_LastSearch.Status; objHelpDesk_LastSearch.CurrentPage = UpdateHelpDesk_LastSearch.CurrentPage; objHelpDesk_LastSearch.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); objHelpDeskDALDataContext.SubmitChanges(); } #endregion #region ShowExistingTicketsLink private void ShowExistingTicketsLink() { // Show Existing Tickets link if user is logged in if (UserId > -1) { lnkExistingTickets.Visible = true; lvTasks.Visible = true; SetView("Existing Tickets"); } else { lnkExistingTickets.Visible = false; lvTasks.Visible = false; SetView("New Ticket"); } } #endregion #region ShowAdministratorLinkAndFileUpload private void ShowAdministratorLinkAndFileUpload() { // Get Admin Role string strAdminRoleID = GetAdminRole(); string strUploadPermission = GetUploadPermission(); // Show Admin link if user is an Administrator if (UserInfo.IsInRole(strAdminRoleID) || UserInfo.IsInRole("Administrators") || UserInfo.IsSuperUser) { lnkAdministratorSettings.Visible = true; TicketFileUpload.Visible = true; lblAttachFile.Visible = true; // Show the Administrator user selector and Ticket Status selectors pnlAdminUserSelection.Visible = true; pnlAdminUserSelection.GroupingText = Localization.GetString("AdminUserSelectionGrouping.Text", LocalResourceFile); pnlAdminTicketStatus.Visible = true; // Load the Roles dropdown LoadRolesDropDown(); // Display default Admin view DisplayAdminView(); } else { // ** Non Administrators ** lnkAdministratorSettings.Visible = false; // Do not show the Administrator user selector pnlAdminUserSelection.Visible = false; // Only supress Upload if permission is not set to All #region if (strUploadPermission != "All") if (strUploadPermission != "All") { // Is user Logged in? if (UserId > -1) { #region if (strUploadPermission != "Administrator/Registered Users") // Only check this if security is set to "Administrator/Registered Users" if (strUploadPermission != "Administrator/Registered Users") { // If User is not an Administrator so they cannot see upload lblAttachFile.Visible = false; TicketFileUpload.Visible = false; } else { TicketFileUpload.Visible = true; lblAttachFile.Visible = true; } #endregion } else { // If User is not logged in they cannot see upload lblAttachFile.Visible = false; TicketFileUpload.Visible = false; } } else { TicketFileUpload.Visible = true; lblAttachFile.Visible = true; } #endregion } } #endregion #region LoadRolesDropDown private void LoadRolesDropDown() { ddlAssignedAdmin.Items.Clear(); RoleController objRoleController = new RoleController(); HelpDeskDALDataContext objHelpDeskDALDataContext = new HelpDeskDALDataContext(); List<HelpDesk_Role> colHelpDesk_Roles = (from HelpDesk_Roles in objHelpDeskDALDataContext.HelpDesk_Roles where HelpDesk_Roles.PortalID == PortalId select HelpDesk_Roles).ToList(); // Create a ListItemCollection to hold the Roles ListItemCollection colListItemCollection = new ListItemCollection(); // Add the Roles to the List foreach (HelpDesk_Role objHelpDesk_Role in colHelpDesk_Roles) { try { RoleInfo objRoleInfo = objRoleController.GetRole(Convert.ToInt32(objHelpDesk_Role.RoleID), PortalId); ListItem RoleListItem = new ListItem(); RoleListItem.Text = objRoleInfo.RoleName; RoleListItem.Value = objHelpDesk_Role.RoleID.ToString(); ddlAssignedAdmin.Items.Add(RoleListItem); } catch { // Role no longer exists in Portal ListItem RoleListItem = new ListItem(); RoleListItem.Text = Localization.GetString("DeletedRole.Text", LocalResourceFile); RoleListItem.Value = objHelpDesk_Role.RoleID.ToString(); ddlAssignedAdmin.Items.Add(RoleListItem); } } // Add UnAssigned ListItem UnassignedRoleListItem = new ListItem(); UnassignedRoleListItem.Text = Localization.GetString("Unassigned.Text", LocalResourceFile); UnassignedRoleListItem.Value = "-1"; ddlAssignedAdmin.Items.Add(UnassignedRoleListItem); } #endregion #region DisplayCategoryTree private void DisplayCategoryTree() { if (UserInfo.IsInRole(GetAdminRole()) || UserInfo.IsInRole("Administrators") || UserInfo.IsSuperUser) { TagsTree.Visible = true; TagsTree.TagID = -1; TagsTree.DisplayType = "Administrator"; TagsTree.Expand = false; TagsTreeExistingTasks.Visible = true; TagsTreeExistingTasks.TagID = -1; TagsTreeExistingTasks.DisplayType = "Administrator"; TagsTreeExistingTasks.Expand = false; } else { TagsTree.Visible = true; TagsTree.TagID = -1; TagsTree.DisplayType = "Requestor"; TagsTree.Expand = false; TagsTreeExistingTasks.Visible = true; TagsTreeExistingTasks.TagID = -1; TagsTreeExistingTasks.DisplayType = "Requestor"; TagsTreeExistingTasks.Expand = false; } // Only Logged in users can have saved Categories in the Tag tree if ((UserId > -1) && (SearchCriteria.Categories != null)) { if (SearchCriteria.Categories.Trim() != "") { char[] delimiterChars = { ',' }; string[] ArrStrCategories = SearchCriteria.Categories.Split(delimiterChars); // Convert the Categories selected from the Tags tree to an array of integers int?[] ArrIntHelpDesk = Array.ConvertAll<string, int?>(ArrStrCategories, new Converter<string, int?>(ConvertStringToNullableInt)); TagsTreeExistingTasks.SelectedCategories = ArrIntHelpDesk; } } // Set visibility of Tags bool RequestorR7_HelpDesk = (TagsTreeExistingTasks.DisplayType == "Administrator") ? false : true; HelpDeskDALDataContext objHelpDeskDALDataContext = new HelpDeskDALDataContext(); int CountOfHelpDesk = (from WebserverCategories in CategoriesTable.GetCategoriesTable(PortalId, RequestorR7_HelpDesk) where WebserverCategories.PortalID == PortalId where WebserverCategories.Level == 1 select WebserverCategories).Count(); imgTags.Visible = (CountOfHelpDesk > 0); img2Tags.Visible = (CountOfHelpDesk > 0); lblCheckTags.Visible = (CountOfHelpDesk > 0); lblSearchTags.Visible = (CountOfHelpDesk > 0); } #endregion #region GetAdminRole private string GetAdminRole() { List<HelpDesk_Setting> objHelpDesk_Settings = GetSettings(); HelpDesk_Setting objHelpDesk_Setting = objHelpDesk_Settings.Where(x => x.SettingName == "AdminRole").FirstOrDefault(); string strAdminRoleID = "Administrators"; if (objHelpDesk_Setting != null) { strAdminRoleID = objHelpDesk_Setting.SettingValue; } return strAdminRoleID; } #endregion #region GetUploadPermission private string GetUploadPermission() { List<HelpDesk_Setting> objHelpDesk_Settings = GetSettings(); HelpDesk_Setting objHelpDesk_Setting = objHelpDesk_Settings.Where(x => x.SettingName == "UploadPermission").FirstOrDefault(); string strUploadPermission = "All"; if (objHelpDesk_Setting != null) { strUploadPermission = objHelpDesk_Setting.SettingValue; } return strUploadPermission; } #endregion #region GetSettings private List<HelpDesk_Setting> GetSettings() { // Get Settings HelpDeskDALDataContext objHelpDeskDALDataContext = new HelpDeskDALDataContext(); List<HelpDesk_Setting> colHelpDesk_Setting = (from HelpDesk_Settings in objHelpDeskDALDataContext.HelpDesk_Settings where HelpDesk_Settings.PortalID == PortalId select HelpDesk_Settings).ToList(); if (colHelpDesk_Setting.Count == 0) { // Create Default vaules HelpDesk_Setting objHelpDesk_Setting1 = new HelpDesk_Setting(); objHelpDesk_Setting1.PortalID = PortalId; objHelpDesk_Setting1.SettingName = "AdminRole"; objHelpDesk_Setting1.SettingValue = "Administrators"; objHelpDeskDALDataContext.HelpDesk_Settings.InsertOnSubmit(objHelpDesk_Setting1); objHelpDeskDALDataContext.SubmitChanges(); HelpDesk_Setting objHelpDesk_Setting2 = new HelpDesk_Setting(); objHelpDesk_Setting2.PortalID = PortalId; objHelpDesk_Setting2.SettingName = "UploFilesPath"; objHelpDesk_Setting2.SettingValue = Server.MapPath("~/DesktopModules/R7.HelpDesk/R7.HelpDesk/Upload"); objHelpDeskDALDataContext.HelpDesk_Settings.InsertOnSubmit(objHelpDesk_Setting2); objHelpDeskDALDataContext.SubmitChanges(); colHelpDesk_Setting = (from HelpDesk_Settings in objHelpDeskDALDataContext.HelpDesk_Settings where HelpDesk_Settings.PortalID == PortalId select HelpDesk_Settings).ToList(); } // Upload Permission HelpDesk_Setting UploadPermissionHelpDesk_Setting = (from HelpDesk_Settings in objHelpDeskDALDataContext.HelpDesk_Settings where HelpDesk_Settings.PortalID == PortalId where HelpDesk_Settings.SettingName == "UploadPermission" select HelpDesk_Settings).FirstOrDefault(); if (UploadPermissionHelpDesk_Setting != null) { // Add to collection colHelpDesk_Setting.Add(UploadPermissionHelpDesk_Setting); } else { // Add Default value HelpDesk_Setting objHelpDesk_Setting = new HelpDesk_Setting(); objHelpDesk_Setting.SettingName = "UploadPermission"; objHelpDesk_Setting.SettingValue = "All"; objHelpDesk_Setting.PortalID = PortalId; objHelpDeskDALDataContext.HelpDesk_Settings.InsertOnSubmit(objHelpDesk_Setting); objHelpDeskDALDataContext.SubmitChanges(); // Add to collection colHelpDesk_Setting.Add(objHelpDesk_Setting); } return colHelpDesk_Setting; } #endregion #region lnkNewTicket_Click protected void lnkNewTicket_Click(object sender, EventArgs e) { // Clear the form txtName.Text = ""; txtEmail.Text = ""; txtPhone.Text = ""; txtDescription.Text = ""; txtDetails.Text = ""; txtDueDate.Text = ""; ddlPriority.SelectedValue = "Normal"; txtUserID.Text = UserId.ToString(); SetView("New Ticket"); ShowAdministratorLinkAndFileUpload(); } #endregion #region lnkExistingTickets_Click protected void lnkExistingTickets_Click(object sender, EventArgs e) { SetView("Existing Tickets"); } #endregion #region lnkResetSearch_Click protected void lnkResetSearch_Click(object sender, EventArgs e) { HelpDesk_LastSearch ExistingHelpDesk_LastSearch = GetLastSearchCriteria(); ExistingHelpDesk_LastSearch.AssignedRoleID = null; ExistingHelpDesk_LastSearch.Categories = null; ExistingHelpDesk_LastSearch.CreatedDate = null; ExistingHelpDesk_LastSearch.SearchText = null; ExistingHelpDesk_LastSearch.DueDate = null; ExistingHelpDesk_LastSearch.Priority = null; ExistingHelpDesk_LastSearch.Status = null; ExistingHelpDesk_LastSearch.CurrentPage = 1; ExistingHelpDesk_LastSearch.PageSize = 25; ddlPageSize.SelectedValue = "25"; CurrentPage = "1"; SaveLastSearchCriteria(ExistingHelpDesk_LastSearch); Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(), true); } #endregion #region lnlAnonymousContinue_Click protected void lnlAnonymousContinue_Click(object sender, EventArgs e) { Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(), true); } #endregion #region SetView private void SetView(string ViewName) { if (ViewName == "New Ticket") { pnlNewTicket.Visible = true; pnlExistingTickets.Visible = false; pnlConfirmAnonymousUserEntry.Visible = false; imgMagnifier.Visible = false; lnkResetSearch.Visible = false; lnkNewTicket.Font.Bold = true; lnkNewTicket.BackColor = System.Drawing.Color.LightGray; // lnkExistingTickets.Font.Bold = false; // lnkExistingTickets.BackColor = System.Drawing.Color.Transparent; DisplayNewTicketForm(); } if (ViewName == "Existing Tickets") { pnlNewTicket.Visible = false; pnlExistingTickets.Visible = true; pnlConfirmAnonymousUserEntry.Visible = false; imgMagnifier.Visible = true; lnkResetSearch.Visible = true; lnkNewTicket.Font.Bold = false; lnkNewTicket.BackColor = System.Drawing.Color.Transparent; // lnkExistingTickets.Font.Bold = true; // lnkExistingTickets.BackColor = System.Drawing.Color.LightGray; DisplayExistingTickets(SearchCriteria); } } #endregion #region DisplayNewTicketForm private void DisplayNewTicketForm() { // Logged in User if (UserId > -1) { txtName.Visible = false; txtEmail.Visible = false; lblName.Visible = true; lblEmail.Visible = true; // Load values for user lblName.Text = UserInfo.DisplayName; lblEmail.Text = UserInfo.Email; } else { // Not logged in txtName.Visible = true; txtEmail.Visible = true; lblName.Visible = false; lblEmail.Visible = false; } } #endregion #region DisplayAdminView private void DisplayAdminView() { btnClearUser.Visible = false; txtName.Visible = true; txtEmail.Visible = true; lblName.Visible = false; lblEmail.Visible = false; // Admin forms is set for anonymous user be default txtUserID.Text = "-1"; } #endregion // Submit New Ticket #region btnSubmit_Click protected void btnSubmit_Click(object sender, EventArgs e) { int intTaskID = 0; try { if (ValidateNewTicketForm()) { intTaskID = SaveNewTicketForm(); SaveTags(intTaskID); // Display post save view if (txtUserID.Text == "-1") { // User not logged in // Say "Request Submitted" pnlConfirmAnonymousUserEntry.Visible = true; pnlExistingTickets.Visible = false; pnlNewTicket.Visible = false; lnkNewTicket.Font.Bold = false; lnkNewTicket.BackColor = System.Drawing.Color.Transparent; lblConfirmAnonymousUser.Text = String.Format(Localization.GetString("YourTicketNumber.Text", LocalResourceFile), intTaskID.ToString()); } else { // User logged in SetView("Existing Tickets"); } SendEmail(intTaskID.ToString()); } } catch (Exception ex) { lblError.Text = ex.Message;// + "<br />" + ex.StackTrace; } } #endregion #region ValidateNewTicketForm private bool ValidateNewTicketForm() { List<string> ColErrors = new List<string>(); // Only validate Name qand emial if user is not logged in if (txtUserID.Text == "-1") { if (txtName.Text.Trim().Length < 1) { ColErrors.Add(Localization.GetString("NameIsRequired.Text", LocalResourceFile)); } if (txtEmail.Text.Trim().Length < 1) { ColErrors.Add(Localization.GetString("EmailIsRequired.Text", LocalResourceFile)); } } if (txtDescription.Text.Trim().Length < 1) { ColErrors.Add(Localization.GetString("DescriptionIsRequired.Text", LocalResourceFile)); } // Validate the date only if a date was entered if (txtDueDate.Text.Trim().Length > 1) { try { DateTime tmpDate = Convert.ToDateTime(txtDueDate.Text.Trim()); } catch { ColErrors.Add(Localization.GetString("MustUseAValidDate.Text", LocalResourceFile)); } } // Validate file upload if (TicketFileUpload.HasFile) { /* if ( string.Compare(Path.GetExtension(TicketFileUpload.FileName).ToLower(), ".gif", true) != 0 & string.Compare(Path.GetExtension(TicketFileUpload.FileName).ToLower(), ".jpg", true) != 0 & string.Compare(Path.GetExtension(TicketFileUpload.FileName).ToLower(), ".jpeg", true) != 0 & string.Compare(Path.GetExtension(TicketFileUpload.FileName).ToLower(), ".doc", true) != 0 & string.Compare(Path.GetExtension(TicketFileUpload.FileName).ToLower(), ".docx", true) != 0 & string.Compare(Path.GetExtension(TicketFileUpload.FileName).ToLower(), ".xls", true) != 0 & string.Compare(Path.GetExtension(TicketFileUpload.FileName).ToLower(), ".xlsx", true) != 0 & string.Compare(Path.GetExtension(TicketFileUpload.FileName).ToLower(), ".pdf", true) != 0 )*/ if (!Utils.IsFileAllowed(TicketFileUpload.FileName)) { ColErrors.Add(string.Format (Localization.GetString("FileExtensionIsNotAllowed.Text", LocalResourceFile), Path.GetExtension(TicketFileUpload.FileName)) ); } } // Display Validation Errors if (ColErrors.Count > 0) { foreach (string objError in ColErrors) { lblError.Text = lblError.Text + String.Format("* {0}<br />", objError); } } return (ColErrors.Count == 0); } #endregion #region SaveNewTicketForm private int SaveNewTicketForm() { HelpDeskDALDataContext objHelpDeskDALDataContext = new HelpDeskDALDataContext(); // Save Task HelpDesk_Task objHelpDesk_Task = new HelpDesk_Task(); objHelpDesk_Task.Status = "New"; objHelpDesk_Task.CreatedDate = DateTime.Now; objHelpDesk_Task.Description = txtDescription.Text; objHelpDesk_Task.PortalID = PortalId; objHelpDesk_Task.Priority = ddlPriority.SelectedValue; objHelpDesk_Task.RequesterPhone = txtPhone.Text; objHelpDesk_Task.AssignedRoleID = -1; objHelpDesk_Task.TicketPassword = GetRandomPassword(); if (Convert.ToInt32(txtUserID.Text) == -1) { // User not logged in objHelpDesk_Task.RequesterEmail = txtEmail.Text; objHelpDesk_Task.RequesterName = txtName.Text; objHelpDesk_Task.RequesterUserID = -1; } else { // User logged in objHelpDesk_Task.RequesterUserID = Convert.ToInt32(txtUserID.Text); objHelpDesk_Task.RequesterName = //UserController.GetUser(PortalId, Convert.ToInt32(txtUserID.Text), false).DisplayName; UserController.GetUserById(PortalId, Convert.ToInt32(txtUserID.Text)).DisplayName; } if (txtDueDate.Text.Trim().Length > 1) { objHelpDesk_Task.DueDate = Convert.ToDateTime(txtDueDate.Text.Trim()); } // If Admin panel is visible this is an admin // Save the Status and Assignment if (pnlAdminTicketStatus.Visible == true) { objHelpDesk_Task.AssignedRoleID = Convert.ToInt32(ddlAssignedAdmin.SelectedValue); objHelpDesk_Task.Status = ddlStatusAdmin.SelectedValue; } objHelpDeskDALDataContext.HelpDesk_Tasks.InsertOnSubmit(objHelpDesk_Task); objHelpDeskDALDataContext.SubmitChanges(); // Save Task Details HelpDesk_TaskDetail objHelpDesk_TaskDetail = new HelpDesk_TaskDetail(); if ((txtDetails.Text.Trim().Length > 0) || (TicketFileUpload.HasFile)) { objHelpDesk_TaskDetail.TaskID = objHelpDesk_Task.TaskID; objHelpDesk_TaskDetail.Description = txtDetails.Text; objHelpDesk_TaskDetail.DetailType = "Comment-Visible"; objHelpDesk_TaskDetail.InsertDate = DateTime.Now; if (Convert.ToInt32(txtUserID.Text) == -1) { // User not logged in objHelpDesk_TaskDetail.UserID = -1; } else { // User logged in objHelpDesk_TaskDetail.UserID = Convert.ToInt32(txtUserID.Text); } objHelpDeskDALDataContext.HelpDesk_TaskDetails.InsertOnSubmit(objHelpDesk_TaskDetail); objHelpDeskDALDataContext.SubmitChanges(); // Upload the File if (TicketFileUpload.HasFile) { UploadFile(objHelpDesk_TaskDetail.DetailID); // Insert Log Log.InsertLog(objHelpDesk_Task.TaskID, UserId, String.Format(Localization.GetString("UploadedFile.Text", LocalResourceFile), GetUserName(), TicketFileUpload.FileName)); } } // Insert Log Log.InsertLog(objHelpDesk_Task.TaskID, UserId, String.Format(Localization.GetString("CreatedTicket.Text", LocalResourceFile), GetUserName())); return objHelpDesk_Task.TaskID; } #endregion #region SaveTags private void SaveTags(int intTaskID) { HelpDeskDALDataContext objHelpDeskDALDataContext = new HelpDeskDALDataContext(); TreeView objTreeView = (TreeView)TagsTree.FindControl("tvCategories"); if (objTreeView.CheckedNodes.Count > 0) { // Iterate through the CheckedNodes collection foreach (TreeNode node in objTreeView.CheckedNodes) { HelpDesk_TaskCategory objHelpDesk_TaskCategory = new HelpDesk_TaskCategory(); objHelpDesk_TaskCategory.TaskID = intTaskID; objHelpDesk_TaskCategory.CategoryID = Convert.ToInt32(node.Value); objHelpDeskDALDataContext.HelpDesk_TaskCategories.InsertOnSubmit(objHelpDesk_TaskCategory); objHelpDeskDALDataContext.SubmitChanges(); } } } #endregion #region GetRandomPassword public string GetRandomPassword() { StringBuilder builder = new StringBuilder(); Random random = new Random(); int intElements = random.Next(10, 26); for (int i = 0; i < intElements; i++) { int intRandomType = random.Next(0, 2); if (intRandomType == 1) { char ch; ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))); builder.Append(ch); } else { builder.Append(random.Next(0, 9)); } } return builder.ToString(); } #endregion #region GetUserName private string GetUserName() { string strUserName = "Anonymous"; if (UserId > -1) { strUserName = strUserName = UserInfo.DisplayName; } return strUserName; } #endregion #region btnClearUser_Click protected void btnClearUser_Click(object sender, EventArgs e) { DisplayAdminView(); } #endregion // File upload #region UploadFile private void UploadFile(int intDetailID) { HelpDeskDALDataContext objHelpDeskDALDataContext = new HelpDeskDALDataContext(); string strUploFilesPath = (from HelpDesk_Settings in objHelpDeskDALDataContext.HelpDesk_Settings where HelpDesk_Settings.PortalID == PortalId where HelpDesk_Settings.SettingName == "UploFilesPath" select HelpDesk_Settings).FirstOrDefault().SettingValue; EnsureDirectory(new System.IO.DirectoryInfo(strUploFilesPath)); string strfilename = Convert.ToString(intDetailID) + "_" + GetRandomPassword() + Path.GetExtension(TicketFileUpload.FileName).ToLower(); strUploFilesPath = strUploFilesPath + @"\" + strfilename; TicketFileUpload.SaveAs(strUploFilesPath); HelpDesk_Attachment objHelpDesk_Attachment = new HelpDesk_Attachment(); objHelpDesk_Attachment.DetailID = intDetailID; objHelpDesk_Attachment.FileName = strfilename; objHelpDesk_Attachment.OriginalFileName = TicketFileUpload.FileName; objHelpDesk_Attachment.AttachmentPath = strUploFilesPath; objHelpDesk_Attachment.UserID = UserId; objHelpDeskDALDataContext.HelpDesk_Attachments.InsertOnSubmit(objHelpDesk_Attachment); objHelpDeskDALDataContext.SubmitChanges(); } #endregion #region EnsureDirectory public static void EnsureDirectory(System.IO.DirectoryInfo oDirInfo) { if (oDirInfo.Parent != null) EnsureDirectory(oDirInfo.Parent); if (!oDirInfo.Exists) { oDirInfo.Create(); } } #endregion // Admin User Search #region gvCurrentProcessor_SelectedIndexChanged protected void btnSearchUser_Click(object sender, EventArgs e) { if (txtSearchForUser.Text.Trim().Length != 0) { ArrayList Users; int TotalRecords = 0; if (ddlSearchForUserType.SelectedValue == "Email") { Users = UserController.GetUsersByEmail(PortalId, txtSearchForUser.Text + "%", 0, 5, ref TotalRecords); } else { String propertyName = ddlSearchForUserType.SelectedItem.Value; Users = UserController.GetUsersByProfileProperty(PortalId, propertyName, txtSearchForUser.Text + "%", 0, 5, ref TotalRecords); } if (Users.Count > 0) { lblCurrentProcessorNotFound.Visible = false; gvCurrentProcessor.Visible = true; gvCurrentProcessor.DataSource = Users; gvCurrentProcessor.DataBind(); } else { lblCurrentProcessorNotFound.Text = Localization.GetString("UserIsNotFound.Text", LocalResourceFile); lblCurrentProcessorNotFound.Visible = true; gvCurrentProcessor.Visible = false; } } } #endregion #region gvCurrentProcessor_SelectedIndexChanged protected void gvCurrentProcessor_SelectedIndexChanged(object sender, EventArgs e) { GridView GridView = (GridView)sender; GridViewRow GridViewRowAdd = (GridViewRow)GridView.SelectedRow; LinkButton LinkButtonAdd = (LinkButton)GridViewRowAdd.FindControl("linkbutton1"); UserInfo objUserInfo = new UserInfo(); objUserInfo = //UserController.GetUser(PortalId, Convert.ToInt16(LinkButtonAdd.CommandArgument), false); UserController.GetUserById(PortalId, Convert.ToInt16(LinkButtonAdd.CommandArgument)); txtName.Visible = false; txtEmail.Visible = false; lblName.Visible = true; lblEmail.Visible = true; lblName.Text = objUserInfo.DisplayName; lblEmail.Text = objUserInfo.Email; txtUserID.Text = LinkButtonAdd.CommandArgument; txtSearchForUser.Text = ""; gvCurrentProcessor.Visible = false; btnClearUser.Visible = true; } #endregion // Email #region SendEmail private void SendEmail(string TaskID) { try { HelpDeskDALDataContext objHelpDeskDALDataContext = new HelpDeskDALDataContext(); HelpDesk_Task objHelpDesk_Tasks = (from HelpDesk_Tasks in objHelpDeskDALDataContext.HelpDesk_Tasks where HelpDesk_Tasks.TaskID == Convert.ToInt32(TaskID) select HelpDesk_Tasks).FirstOrDefault(); string strPasswordLinkUrl = Utils.FixURLLink(DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "EditTask", "mid=" + ModuleId.ToString(), String.Format(@"&TaskID={0}&TP={1}", TaskID, objHelpDesk_Tasks.TicketPassword)), PortalSettings.PortalAlias.HTTPAlias); string strLinkUrl = Utils.FixURLLink(DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "EditTask", "mid=" + ModuleId.ToString(), String.Format(@"&TaskID={0}", TaskID)), PortalSettings.PortalAlias.HTTPAlias); string strSubject = String.Format(Localization.GetString("NewHelpDeskTicketCreated.Text", LocalResourceFile), TaskID); string strBody = ""; if (Convert.ToInt32(txtUserID.Text) != UserId || UserId == -1) { if (UserId == -1) { // Anonymous user has created a ticket strBody = String.Format(Localization.GetString("ANewHelpDeskTicket.Text", LocalResourceFile), TaskID); ; } else { // Admin has created a Ticket on behalf of another user strBody = String.Format(Localization.GetString("HasCreatedANewHelpDeskTicket.Text", LocalResourceFile), UserInfo.DisplayName, TaskID, PortalSettings.PortalAlias.HTTPAlias); ; } strBody = strBody + Environment.NewLine; strBody = strBody + String.Format(Localization.GetString("YouMaySeeStatusHere.Text", LocalResourceFile), strPasswordLinkUrl); string strEmail = txtEmail.Text; // If userId is not -1 then get the Email if (Convert.ToInt32(txtUserID.Text) > -1) { strEmail = //UserController.GetUser(PortalId, Convert.ToInt32(txtUserID.Text), false).Email UserController.GetUserById(PortalId, Convert.ToInt32(txtUserID.Text)).Email; } DotNetNuke.Services.Mail.Mail.SendMail(PortalSettings.Email, strEmail, "", strSubject, strBody, "", "HTML", "", "", "", ""); // Get Admin Role string strAdminRoleID = GetAdminRole(); // User is an Administrator if (UserInfo.IsInRole(strAdminRoleID) || UserInfo.IsInRole("Administrators") || UserInfo.IsSuperUser) { // If Ticket is assigned to any group other than unassigned notify them if (Convert.ToInt32(ddlAssignedAdmin.SelectedValue) > -1) { NotifyAssignedGroup(TaskID); } } else { // This is not an Admin so Notify the Admins strSubject = String.Format(Localization.GetString("NewHelpDeskTicketCreatedAt.Text", LocalResourceFile), TaskID, PortalSettings.PortalAlias.HTTPAlias); strBody = String.Format(Localization.GetString("ANewHelpDeskTicketCreated.Text", LocalResourceFile), TaskID, txtDescription.Text); strBody = strBody + Environment.NewLine; strBody = strBody + String.Format(Localization.GetString("YouMaySeeStatusHere.Text", LocalResourceFile), strLinkUrl); // Get all users in the Admin Role RoleController objRoleController = new RoleController(); ArrayList colAdminUsers = objRoleController.GetUsersByRoleName(PortalId, GetAdminRole()); foreach (UserInfo objUserInfo in colAdminUsers) { DotNetNuke.Services.Mail.Mail.SendMail(PortalSettings.Email, objUserInfo.Email, "", strSubject, strBody, "", "HTML", "", "", "", ""); } } } else { // A normal ticket has been created strSubject = String.Format(Localization.GetString("NewHelpDeskTicketCreatedAt.Text", LocalResourceFile), TaskID, PortalSettings.PortalAlias.HTTPAlias); strBody = String.Format(Localization.GetString("ANewHelpDeskTicketCreated.Text", LocalResourceFile), TaskID, txtDescription.Text); strBody = strBody + Environment.NewLine; strBody = strBody + String.Format(Localization.GetString("YouMaySeeStatusHere.Text", LocalResourceFile), strLinkUrl); // Get all users in the Admin Role RoleController objRoleController = new RoleController(); ArrayList colAdminUsers = objRoleController.GetUsersByRoleName(PortalId, GetAdminRole()); foreach (UserInfo objUserInfo in colAdminUsers) { DotNetNuke.Services.Mail.Mail.SendMail(PortalSettings.Email, objUserInfo.Email, "", strSubject, strBody, "", "HTML", "", "", "", ""); } } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } } #endregion #region NotifyAssignedGroup private void NotifyAssignedGroup(string TaskID) { RoleController objRoleController = new RoleController(); string strAssignedRole = String.Format("{0}", objRoleController.GetRole(Convert.ToInt32(ddlAssignedAdmin.SelectedValue), PortalId).RoleName); string strSubject = String.Format(Localization.GetString("HelpDeskTicketAtHasBeenAssigned.Text", LocalResourceFile), TaskID, PortalSettings.PortalAlias.HTTPAlias, strAssignedRole); string strBody = String.Format(Localization.GetString("ANewHelpDeskTicketHasBeenAssigned.Text", LocalResourceFile), TaskID, txtDescription.Text); strBody = strBody + Environment.NewLine; strBody = strBody + String.Format(Localization.GetString("YouMaySeeStatusHere.Text", LocalResourceFile), DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "EditTask", "mid=" + ModuleId.ToString(), String.Format(@"&TaskID={0}", TaskID))); // Get all users in the AssignedRole Role ArrayList colAssignedRoleUsers = objRoleController.GetUsersByRoleName(PortalId, strAssignedRole); foreach (UserInfo objUserInfo in colAssignedRoleUsers) { DotNetNuke.Services.Mail.Mail.SendMail(PortalSettings.Email, objUserInfo.Email, "", strSubject, strBody, "", "HTML", "", "", "", ""); } Log.InsertLog(Convert.ToInt32(TaskID), UserId, String.Format(Localization.GetString("AssignedTicketTo.Text", LocalResourceFile), UserInfo.DisplayName, strAssignedRole)); } #endregion // Existing Tickets #region DisplayExistingTickets private void DisplayExistingTickets(HelpDesk_LastSearch objLastSearch) { string[] UsersRoles = UserInfo.Roles; List<int> UsersRoleIDs = new List<int>(); string strSearchText = (objLastSearch.SearchText == null) ? "" : objLastSearch.SearchText; HelpDeskDALDataContext objHelpDeskDALDataContext = new HelpDeskDALDataContext(); IQueryable<ExistingTasks> result = from HelpDesk_Tasks in objHelpDeskDALDataContext.HelpDesk_Tasks where HelpDesk_Tasks.PortalID == PortalId orderby HelpDesk_Tasks.CreatedDate descending select new ExistingTasks { TaskID = HelpDesk_Tasks.TaskID, Status = HelpDesk_Tasks.Status, Priority = HelpDesk_Tasks.Priority, DueDate = HelpDesk_Tasks.DueDate, CreatedDate = HelpDesk_Tasks.CreatedDate, Assigned = HelpDesk_Tasks.AssignedRoleID.ToString(), Description = HelpDesk_Tasks.Description, Requester = HelpDesk_Tasks.RequesterUserID.ToString(), RequesterName = HelpDesk_Tasks.RequesterName }; #region Only show users the records they should see // Only show users the records they should see if (!(UserInfo.IsInRole(GetAdminRole()) || UserInfo.IsInRole("Administrators") || UserInfo.IsSuperUser)) { RoleController objRoleController = new RoleController(); foreach (RoleInfo objRoleInfo in objRoleController.GetUserRoles(UserInfo, true)) { UsersRoleIDs.Add(objRoleInfo.RoleID); } result = from UsersRecords in result where Convert.ToInt32(UsersRecords.Requester) == UserId || UsersRoleIDs.Contains(Convert.ToInt32(UsersRecords.Assigned)) select UsersRecords; } #endregion #region Filter Status // Filter Status if (objLastSearch.Status != null) { result = from Status in result where Status.Status == objLastSearch.Status select Status; } #endregion #region Filter Priority // Filter Priority if (objLastSearch.Priority != null) { result = from Priority in result where Priority.Priority == objLastSearch.Priority select Priority; } #endregion #region Filter Assigned // Filter Assigned if (objLastSearch.AssignedRoleID.HasValue) { if (!(objLastSearch.AssignedRoleID == -2)) { result = from Assigned in result where Assigned.Assigned == objLastSearch.AssignedRoleID.ToString() select Assigned; } } #endregion #region Filter DueDate // Filter DueDate if (objLastSearch.DueDate.HasValue) { result = from objDueDate in result where objDueDate.DueDate > objLastSearch.DueDate select objDueDate; } #endregion #region Filter CreatedDate // Filter CreatedDate if (objLastSearch.CreatedDate.HasValue) { result = from CreatedDate in result where CreatedDate.CreatedDate > objLastSearch.CreatedDate select CreatedDate; } #endregion #region Filter TextBox (Search) // Filter TextBox if (strSearchText.Trim().Length > 0) { result = (from Search in result join details in objHelpDeskDALDataContext.HelpDesk_TaskDetails on Search.TaskID equals details.TaskID into joined from leftjoin in joined.DefaultIfEmpty() where Search.Description.Contains(strSearchText) || Search.RequesterName.Contains(strSearchText) || Search.TaskID.ToString().Contains(strSearchText) || leftjoin.Description.Contains(strSearchText) select Search).Distinct(); } #endregion // Convert the results to a list because the query to filter the tags // must be made after the preceeding query results have been pulled from the database List<ExistingTasks> FinalResult = result.Distinct().ToList(); #region Filter Tags // Filter Tags if (objLastSearch.Categories != null) { char[] delimiterChars = { ',' }; string[] ArrStrCategories = objLastSearch.Categories.Split(delimiterChars); // Convert the Categories selected from the Tags tree to an array of integers int[] ArrIntHelpDesk = Array.ConvertAll<string, int>(ArrStrCategories, new Converter<string, int>(ConvertStringToInt)); // Perform a query that does in intersect between all the R7.HelpDesk selected and all the categories that each TaskID has // The number of values that match must equal the number of values that were selected in the Tags tree FinalResult = (from Categories in FinalResult.AsQueryable() where ((from HelpDesk_TaskCategories in objHelpDeskDALDataContext.HelpDesk_TaskCategories where HelpDesk_TaskCategories.TaskID == Categories.TaskID select HelpDesk_TaskCategories.CategoryID).ToArray<int>()).Intersect(ArrIntHelpDesk).Count() == ArrIntHelpDesk.Length select Categories).ToList(); } #endregion #region Sort switch (SortExpression) { case "TaskID": case "TaskID ASC": FinalResult = FinalResult.AsEnumerable().OrderBy(p => p.TaskID).ToList(); break; case "TaskID DESC": FinalResult = FinalResult.AsEnumerable().OrderByDescending(p => p.TaskID).ToList(); break; case "Status": case "Status ASC": FinalResult = FinalResult.AsEnumerable().OrderBy(p => p.Status).ToList(); break; case "Status DESC": FinalResult = FinalResult.AsEnumerable().OrderByDescending(p => p.Status).ToList(); break; case "Priority": case "Priority ASC": FinalResult = FinalResult.AsEnumerable().OrderBy(p => p.Priority).ToList(); break; case "Priority DESC": FinalResult = FinalResult.AsEnumerable().OrderByDescending(p => p.Priority).ToList(); break; case "DueDate": case "DueDate ASC": FinalResult = FinalResult.AsEnumerable().OrderBy(p => p.DueDate).ToList(); break; case "DueDate DESC": FinalResult = FinalResult.AsEnumerable().OrderByDescending(p => p.DueDate).ToList(); break; case "CreatedDate": case "CreatedDate ASC": FinalResult = FinalResult.AsEnumerable().OrderBy(p => p.CreatedDate).ToList(); break; case "CreatedDate DESC": FinalResult = FinalResult.AsEnumerable().OrderByDescending(p => p.CreatedDate).ToList(); break; case "Assigned": case "Assigned ASC": FinalResult = FinalResult.AsEnumerable().OrderBy(p => p.Assigned).ToList(); break; case "Assigned DESC": FinalResult = FinalResult.AsEnumerable().OrderByDescending(p => p.Assigned).ToList(); break; case "Description": case "Description ASC": FinalResult = FinalResult.AsEnumerable().OrderBy(p => p.Description).ToList(); break; case "Description DESC": FinalResult = FinalResult.AsEnumerable().OrderByDescending(p => p.Description).ToList(); break; case "Requester": case "Requester ASC": FinalResult = FinalResult.AsEnumerable().OrderBy(p => p.RequesterName).ToList(); break; case "Requester DESC": FinalResult = FinalResult.AsEnumerable().OrderByDescending(p => p.RequesterName).ToList(); break; } #endregion #region Paging int intPageSize = (objLastSearch.PageSize != null) ? Convert.ToInt32(objLastSearch.PageSize) : Convert.ToInt32(ddlPageSize.SelectedValue); int intCurrentPage = (Convert.ToInt32(objLastSearch.CurrentPage) == 0) ? 1 : Convert.ToInt32(objLastSearch.CurrentPage); //Paging int intTotalPages = 1; int intRecords = FinalResult.Count(); if ((intRecords > 0) && (intRecords > intPageSize)) { intTotalPages = (intRecords / intPageSize); // If there are more records add 1 to page count if (intRecords % intPageSize > 0) { intTotalPages += 1; } // If Current Page is -1 then it is intended to be set to last page if (intCurrentPage == -1) { intCurrentPage = intTotalPages; HelpDesk_LastSearch objHelpDesk_LastSearch = GetLastSearchCriteria(); objHelpDesk_LastSearch.CurrentPage = intCurrentPage; SaveLastSearchCriteria(objHelpDesk_LastSearch); } // Show and hide buttons lnkFirst.Visible = (intCurrentPage > 1); lnkPrevious.Visible = (intCurrentPage > 1); lnkNext.Visible = (intCurrentPage != intTotalPages); lnkLast.Visible = (intCurrentPage != intTotalPages); } #endregion // If the current page is greater than the number of pages // reset to page one and save if (intCurrentPage > intTotalPages) { intCurrentPage = 1; HelpDesk_LastSearch objHelpDesk_LastSearch = GetLastSearchCriteria(); objHelpDesk_LastSearch.CurrentPage = intCurrentPage; SaveLastSearchCriteria(objHelpDesk_LastSearch); lnkPrevious.Visible = true; } // Display Records lvTasks.DataSource = FinalResult.Skip((intCurrentPage - 1) * intPageSize).Take(intPageSize); lvTasks.DataBind(); // Display paging panel pnlPaging.Visible = (intTotalPages > 1); // Set CurrentPage CurrentPage = intCurrentPage.ToString(); #region Page number list List<ListPage> pageList = new List<ListPage>(); int nStartRange = intCurrentPage > 10 ? intCurrentPage - 10 : 1; if (intTotalPages - nStartRange < 19) nStartRange = intTotalPages > 19 ? intTotalPages - 19 : 1; for (int nPage = nStartRange; nPage < nStartRange + 20 && nPage <= intTotalPages; nPage++) pageList.Add(new ListPage { PageNumber = nPage }); PagingDataList.DataSource = pageList; PagingDataList.DataBind(); #endregion } #endregion #region GetCurrentPage private int GetCurrentPage() { return Convert.ToInt32(CurrentPage); } #endregion #region ConvertStringToInt private int ConvertStringToInt(string strParameter) { return Convert.ToInt32(strParameter); } private int? ConvertStringToNullableInt(string strParameter) { return Convert.ToInt32(strParameter); } #endregion #region lvTasks_ItemDataBound protected void lvTasks_ItemDataBound(object sender, ListViewItemEventArgs e) { ListView listView = (ListView)sender; ListViewDataItem objListViewDataItem = (ListViewDataItem)e.Item; // Get instance of fields HyperLink lnkTaskID = (HyperLink)e.Item.FindControl("lnkTaskID"); Label StatusLabel = (Label)e.Item.FindControl("StatusLabel"); Label PriorityLabel = (Label)e.Item.FindControl("PriorityLabel"); Label DueDateLabel = (Label)e.Item.FindControl("DueDateLabel"); Label CreatedDateLabel = (Label)e.Item.FindControl("CreatedDateLabel"); Label AssignedLabel = (Label)e.Item.FindControl("AssignedRoleIDLabel"); Label DescriptionLabel = (Label)e.Item.FindControl("DescriptionLabel"); Label RequesterLabel = (Label)e.Item.FindControl("RequesterUserIDLabel"); Label RequesterNameLabel = (Label)e.Item.FindControl("RequesterNameLabel"); // Get the data ExistingTasks objExistingTasks = (ExistingTasks)objListViewDataItem.DataItem; // Format the TaskID hyperlink lnkTaskID.Text = string.Format("{0}", objExistingTasks.TaskID.ToString()); lnkTaskID.NavigateUrl = EditUrl (TabId, "EditTask", false, "mid=" + ModuleId, "taskid=" + objExistingTasks.TaskID); // Format DueDate if (objExistingTasks.DueDate != null) { DueDateLabel.Text = objExistingTasks.DueDate.Value.ToShortDateString(); if ((objExistingTasks.DueDate < DateTime.Now) && (StatusLabel.Text == "New" || StatusLabel.Text == "Active" || StatusLabel.Text == "On Hold")) { DueDateLabel.BackColor = System.Drawing.Color.Yellow; } } // Format CreatedDate if (objExistingTasks.CreatedDate != null) { DateTime dtCreatedDate = Convert.ToDateTime(objExistingTasks.CreatedDate.Value.ToShortDateString()); DateTime dtNow = Convert.ToDateTime(DateTime.Now.ToShortDateString()); if (dtCreatedDate == dtNow) { CreatedDateLabel.Text = objExistingTasks.CreatedDate.Value.ToLongTimeString(); } else { CreatedDateLabel.Text = objExistingTasks.CreatedDate.Value.ToShortDateString(); } } // Format Requestor if (RequesterLabel.Text != "-1") { try { RequesterNameLabel.Text = //UserController.GetUser(PortalId, Convert.ToInt32(RequesterLabel.Text), false).DisplayName; UserController.GetUserById(PortalId, Convert.ToInt32(RequesterLabel.Text)).DisplayName; } catch { RequesterNameLabel.Text = String.Format("[User Deleted]"); } } if (RequesterNameLabel.Text.Length > 10) { RequesterNameLabel.Text = String.Format("{0} ...", Utils.StringLeft(RequesterNameLabel.Text, 10)); } // Format Description if (DescriptionLabel.Text.Length > 10) { DescriptionLabel.Text = String.Format("{0} ...", Utils.StringLeft(DescriptionLabel.Text, 10)); } // Format Assigned if (AssignedLabel.Text != "-1") { RoleController objRoleController = new RoleController(); try { AssignedLabel.Text = String.Format("{0}", objRoleController.GetRole(Convert.ToInt32(AssignedLabel.Text), PortalId).RoleName); } catch { AssignedLabel.Text = Localization.GetString("DeletedRole.Text", LocalResourceFile); } AssignedLabel.ToolTip = AssignedLabel.Text; if (AssignedLabel.Text.Length > 10) { AssignedLabel.Text = String.Format("{0} ...", Utils.StringLeft(AssignedLabel.Text, 10)); } } else { AssignedLabel.Text = Localization.GetString("Unassigned.Text", LocalResourceFile); } } #endregion #region lvTasks_Sorting protected void lvTasks_Sorting(object sender, ListViewSortEventArgs e) { if (SortDirection == "ASC") { SortDirection = "DESC"; } else { SortDirection = "ASC"; } SortExpression = String.Format("{0} {1}", e.SortExpression, SortDirection); // Check the sort direction to set the image URL accordingly. string imgUrl; if (SortDirection == "ASC") imgUrl = "~/DesktopModules/R7.HelpDesk/R7.HelpDesk/images/dt-arrow-up.png"; else imgUrl = "~/DesktopModules/R7.HelpDesk/R7.HelpDesk/images/dt-arrow-dn.png"; // Check which field is being sorted // to set the visibility of the image controls. Image TaskIDImage = (Image)lvTasks.FindControl("TaskIDImage"); Image StatusImage = (Image)lvTasks.FindControl("StatusImage"); Image PriorityImage = (Image)lvTasks.FindControl("PriorityImage"); Image DueDateImage = (Image)lvTasks.FindControl("DueDateImage"); Image CreatedDateImage = (Image)lvTasks.FindControl("CreatedDateImage"); Image AssignedImage = (Image)lvTasks.FindControl("AssignedImage"); Image DescriptionImage = (Image)lvTasks.FindControl("DescriptionImage"); Image RequesterImage = (Image)lvTasks.FindControl("RequesterImage"); // Set each Image to the proper direction TaskIDImage.ImageUrl = imgUrl; StatusImage.ImageUrl = imgUrl; PriorityImage.ImageUrl = imgUrl; DueDateImage.ImageUrl = imgUrl; CreatedDateImage.ImageUrl = imgUrl; AssignedImage.ImageUrl = imgUrl; DescriptionImage.ImageUrl = imgUrl; RequesterImage.ImageUrl = imgUrl; // Set each Image to false TaskIDImage.Visible = false; StatusImage.Visible = false; PriorityImage.Visible = false; DueDateImage.Visible = false; CreatedDateImage.Visible = false; AssignedImage.Visible = false; DescriptionImage.Visible = false; RequesterImage.Visible = false; switch (e.SortExpression) { case "TaskID": TaskIDImage.Visible = true; break; case "Status": StatusImage.Visible = true; break; case "Priority": PriorityImage.Visible = true; break; case "DueDate": DueDateImage.Visible = true; break; case "CreatedDate": CreatedDateImage.Visible = true; break; case "Assigned": AssignedImage.Visible = true; break; case "Description": DescriptionImage.Visible = true; break; case "Requester": RequesterImage.Visible = true; break; } HelpDesk_LastSearch objHelpDesk_LastSearch = GetValuesFromSearchForm(); // Save Search Criteria SaveLastSearchCriteria(objHelpDesk_LastSearch); // Execute Search DisplayExistingTickets(SearchCriteria); } #endregion #region lvTasks_ItemCommand protected void lvTasks_ItemCommand(object sender, ListViewCommandEventArgs e) { #region Search // Search if (e.CommandName == "Search") { HelpDesk_LastSearch objHelpDesk_LastSearch = GetValuesFromSearchForm(); // Save Search Criteria SaveLastSearchCriteria(objHelpDesk_LastSearch); // Execute Search DisplayExistingTickets(SearchCriteria); } #endregion #region EmptyDataTemplateSearch //EmptyDataTemplateSearch if (e.CommandName == "EmptyDataTemplateSearch") { TextBox txtSearch = (TextBox)e.Item.FindControl("txtSearch"); DropDownList ddlStatus = (DropDownList)e.Item.FindControl("ddlStatus"); DropDownList ddlPriority = (DropDownList)e.Item.FindControl("ddlPriority"); DropDownList ddlAssigned = (DropDownList)e.Item.FindControl("ddlAssigned"); TextBox txtDue = (TextBox)e.Item.FindControl("txtDue"); TextBox txtCreated = (TextBox)e.Item.FindControl("txtCreated"); // Use an ExistingTasks object to pass the values to the Search method HelpDesk_LastSearch objHelpDesk_LastSearch = new HelpDesk_LastSearch(); objHelpDesk_LastSearch.SearchText = (txtSearch.Text.Trim().Length == 0) ? null : txtSearch.Text.Trim(); objHelpDesk_LastSearch.Status = (ddlStatus.SelectedValue == "All") ? null : ddlStatus.SelectedValue; objHelpDesk_LastSearch.AssignedRoleID = (ddlAssigned.SelectedValue == "-2") ? null : (int?)Convert.ToInt32(ddlAssigned.SelectedValue); objHelpDesk_LastSearch.Priority = (ddlPriority.SelectedValue == "All") ? null : ddlPriority.SelectedValue; // Created Date if (txtCreated.Text.Trim().Length > 4) { try { DateTime dtCreated = Convert.ToDateTime(txtCreated.Text.Trim()); objHelpDesk_LastSearch.CreatedDate = dtCreated.AddDays(-1); } catch { txtCreated.Text = ""; } } else { txtCreated.Text = ""; } // Due Date if (txtDue.Text.Trim().Length > 4) { try { DateTime dtDue = Convert.ToDateTime(txtDue.Text.Trim()); objHelpDesk_LastSearch.DueDate = dtDue.AddDays(-1); } catch { txtDue.Text = ""; } } else { txtDue.Text = ""; } // Get Category Tags string strCategories = GetTagsTreeExistingTasks(); if (strCategories.Length > 1) { objHelpDesk_LastSearch.Categories = strCategories; } // Current Page objHelpDesk_LastSearch.CurrentPage = GetCurrentPage(); // Page Size objHelpDesk_LastSearch.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); // Save Search Criteria SaveLastSearchCriteria(objHelpDesk_LastSearch); // Execute Search DisplayExistingTickets(SearchCriteria); } #endregion } #endregion // Set controls to the Last Search criteria #region lvTasks_DataBound protected void lvTasks_DataBound(object sender, EventArgs e) { if (SearchCriteria != null) { TextBox txtSearch = new TextBox(); DropDownList ddlStatus = new DropDownList(); DropDownList ddlPriority = new DropDownList(); DropDownList ddlAssigned = new DropDownList(); TextBox txtDue = new TextBox(); TextBox txtCreated = new TextBox(); // Get an instance to the Search controls if (lvTasks.Items.Count == 0) { // Empty Data Template ListViewItem Ctrl0 = (ListViewItem)lvTasks.FindControl("Ctrl0"); HtmlTable EmptyDataTemplateTable = (HtmlTable)Ctrl0.FindControl("EmptyDataTemplateTable"); txtSearch = (TextBox)EmptyDataTemplateTable.FindControl("txtSearch"); ddlStatus = (DropDownList)EmptyDataTemplateTable.FindControl("ddlStatus"); ddlPriority = (DropDownList)EmptyDataTemplateTable.FindControl("ddlPriority"); txtDue = (TextBox)EmptyDataTemplateTable.FindControl("txtDue"); txtCreated = (TextBox)EmptyDataTemplateTable.FindControl("txtCreated"); ddlAssigned = (DropDownList)EmptyDataTemplateTable.FindControl("ddlAssigned"); } else { // Normal results template txtSearch = (TextBox)lvTasks.FindControl("txtSearch"); ddlStatus = (DropDownList)lvTasks.FindControl("ddlStatus"); ddlPriority = (DropDownList)lvTasks.FindControl("ddlPriority"); txtDue = (TextBox)lvTasks.FindControl("txtDue"); txtCreated = (TextBox)lvTasks.FindControl("txtCreated"); ddlAssigned = (DropDownList)lvTasks.FindControl("ddlAssigned"); } HelpDesk_LastSearch objHelpDesk_LastSearch = (HelpDesk_LastSearch)SearchCriteria; if (objHelpDesk_LastSearch.SearchText != null) { txtSearch.Text = objHelpDesk_LastSearch.SearchText; } if (objHelpDesk_LastSearch.Status != null) { ddlStatus.SelectedValue = objHelpDesk_LastSearch.Status; } if (objHelpDesk_LastSearch.Priority != null) { ddlPriority.SelectedValue = objHelpDesk_LastSearch.Priority; } if (objHelpDesk_LastSearch.DueDate != null) { txtDue.Text = objHelpDesk_LastSearch.DueDate.Value.AddDays(1).ToShortDateString(); } if (objHelpDesk_LastSearch.CreatedDate != null) { txtCreated.Text = objHelpDesk_LastSearch.CreatedDate.Value.AddDays(1).ToShortDateString(); } // Page Size if (objHelpDesk_LastSearch.PageSize != null) { ddlPageSize.SelectedValue = objHelpDesk_LastSearch.PageSize.ToString(); } // Load Dropdown ddlAssigned.Items.Clear(); RoleController objRoleController = new RoleController(); HelpDeskDALDataContext objHelpDeskDALDataContext = new HelpDeskDALDataContext(); List<HelpDesk_Role> colHelpDesk_Roles = (from HelpDesk_Roles in objHelpDeskDALDataContext.HelpDesk_Roles where HelpDesk_Roles.PortalID == PortalId select HelpDesk_Roles).ToList(); // Create a ListItemCollection to hold the Roles ListItemCollection colListItemCollection = new ListItemCollection(); // Add All ListItem AllRoleListItem = new ListItem(); AllRoleListItem.Text = Localization.GetString("ddlAssignedAll.Text", LocalResourceFile); AllRoleListItem.Value = "-2"; if (objHelpDesk_LastSearch.AssignedRoleID != null) { if (objHelpDesk_LastSearch.AssignedRoleID == -2) { AllRoleListItem.Selected = true; } } ddlAssigned.Items.Add(AllRoleListItem); // Add the Roles to the List foreach (HelpDesk_Role objHelpDesk_Role in colHelpDesk_Roles) { try { RoleInfo objRoleInfo = objRoleController.GetRole(Convert.ToInt32(objHelpDesk_Role.RoleID), PortalId); ListItem RoleListItem = new ListItem(); RoleListItem.Text = objRoleInfo.RoleName; RoleListItem.Value = objHelpDesk_Role.RoleID.ToString(); if (objHelpDesk_LastSearch.AssignedRoleID != null) { if (objHelpDesk_Role.RoleID == objHelpDesk_LastSearch.AssignedRoleID) { RoleListItem.Selected = true; } } ddlAssigned.Items.Add(RoleListItem); } catch { // Role no longer exists in Portal ListItem RoleListItem = new ListItem(); RoleListItem.Text = Localization.GetString("DeletedRole.Text", LocalResourceFile); RoleListItem.Value = objHelpDesk_Role.RoleID.ToString(); ddlAssigned.Items.Add(RoleListItem); } } // Add UnAssigned ListItem UnassignedRoleListItem = new ListItem(); UnassignedRoleListItem.Text = Localization.GetString("Unassigned.Text", LocalResourceFile); UnassignedRoleListItem.Value = "-1"; if (objHelpDesk_LastSearch.AssignedRoleID != null) { if (objHelpDesk_LastSearch.AssignedRoleID == -1) { UnassignedRoleListItem.Selected = true; } } ddlAssigned.Items.Add(UnassignedRoleListItem); } } #endregion #region GetValuesFromSearchForm private HelpDesk_LastSearch GetValuesFromSearchForm() { TextBox txtSearch = (TextBox)lvTasks.FindControl("txtSearch"); DropDownList ddlStatus = (DropDownList)lvTasks.FindControl("ddlStatus"); DropDownList ddlPriority = (DropDownList)lvTasks.FindControl("ddlPriority"); DropDownList ddlAssigned = (DropDownList)lvTasks.FindControl("ddlAssigned"); TextBox txtDue = (TextBox)lvTasks.FindControl("txtDue"); TextBox txtCreated = (TextBox)lvTasks.FindControl("txtCreated"); // Use an ExistingTasks object to pass the values to the Search method HelpDesk_LastSearch objHelpDesk_LastSearch = new HelpDesk_LastSearch(); objHelpDesk_LastSearch.SearchText = (txtSearch.Text.Trim().Length == 0) ? null : txtSearch.Text.Trim(); objHelpDesk_LastSearch.Status = (ddlStatus.SelectedValue == "All") ? null : ddlStatus.SelectedValue; objHelpDesk_LastSearch.AssignedRoleID = (ddlAssigned.SelectedValue == "-2") ? null : (int?)Convert.ToInt32(ddlAssigned.SelectedValue); objHelpDesk_LastSearch.Priority = (ddlPriority.SelectedValue == "All") ? null : ddlPriority.SelectedValue; // Created Date if (txtCreated.Text.Trim().Length > 4) { try { DateTime dtCreated = Convert.ToDateTime(txtCreated.Text.Trim()); objHelpDesk_LastSearch.CreatedDate = dtCreated.AddDays(-1); } catch { txtCreated.Text = ""; } } else { txtCreated.Text = ""; } // Due Date if (txtDue.Text.Trim().Length > 4) { try { DateTime dtDue = Convert.ToDateTime(txtDue.Text.Trim()); objHelpDesk_LastSearch.DueDate = dtDue.AddDays(-1); } catch { txtDue.Text = ""; } } else { txtDue.Text = ""; } // Get Category Tags string strCategories = GetTagsTreeExistingTasks(); if (strCategories.Length > 0) { objHelpDesk_LastSearch.Categories = strCategories; } // Current Page objHelpDesk_LastSearch.CurrentPage = GetCurrentPage(); // Page Size objHelpDesk_LastSearch.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); return objHelpDesk_LastSearch; } #endregion #region GetTagsTreeExistingTasks private string GetTagsTreeExistingTasks() { List<string> colSelectedCategories = new List<string>(); try { TreeView objTreeView = (TreeView)TagsTreeExistingTasks.FindControl("tvCategories"); if (objTreeView.CheckedNodes.Count > 0) { // Iterate through the CheckedNodes collection foreach (TreeNode node in objTreeView.CheckedNodes) { colSelectedCategories.Add(node.Value); } } string[] arrSelectedCategories = colSelectedCategories.ToArray<string>(); string strSelectedCategories = String.Join(",", arrSelectedCategories); return Utils.StringLeft (strSelectedCategories, 2000); } catch { return ""; } } #endregion // Datasource for Assigned Role drop down #region LDSAssignedRoleID_Selecting protected void LDSAssignedRoleID_Selecting(object sender, LinqDataSourceSelectEventArgs e) { List<AssignedRoles> resultcolAssignedRoles = new List<AssignedRoles>(); HelpDeskDALDataContext objHelpDeskDALDataContext = new HelpDeskDALDataContext(); List<AssignedRoles> colAssignedRoles = (from HelpDesk_Tasks in objHelpDeskDALDataContext.HelpDesk_Tasks where HelpDesk_Tasks.AssignedRoleID > -1 group HelpDesk_Tasks by HelpDesk_Tasks.AssignedRoleID into AssignedRole select new AssignedRoles { AssignedRoleID = GetRolebyID(AssignedRole.Key), Key = AssignedRole.Key.ToString() }).ToList(); AssignedRoles objAssignedRolesAll = new AssignedRoles(); objAssignedRolesAll.AssignedRoleID = "All"; objAssignedRolesAll.Key = "-2"; resultcolAssignedRoles.Add(objAssignedRolesAll); AssignedRoles objAssignedRolesUnassigned = new AssignedRoles(); objAssignedRolesUnassigned.AssignedRoleID = "Unassigned"; objAssignedRolesUnassigned.Key = "-1"; resultcolAssignedRoles.Add(objAssignedRolesUnassigned); resultcolAssignedRoles.AddRange(colAssignedRoles); e.Result = resultcolAssignedRoles; } #endregion #region GetRolebyID private string GetRolebyID(int RoleID) { string strRoleName = "Unassigned"; if (RoleID > -1) { RoleController objRoleController = new RoleController(); strRoleName = objRoleController.GetRole(RoleID, PortalId).RoleName; } return strRoleName; } #endregion #region IActionable implementation public DotNetNuke.Entities.Modules.Actions.ModuleActionCollection ModuleActions { get { // create a new action to add an item, this will be added // to the controls dropdown menu var actions = new ModuleActionCollection (); actions.Add ( GetNextActionID (), LocalizeString ("AdminSettings.Action"), ModuleActionType.ModuleSettings, "", "", EditUrl ("AdminSettings"), false, DotNetNuke.Security.SecurityAccessLevel.Edit, true, false ); return actions; } } #endregion // Paging #region lnkNext_Click protected void lnkNext_Click(object sender, EventArgs e) { HelpDesk_LastSearch objHelpDesk_LastSearch = GetLastSearchCriteria(); int intCurrentPage = Convert.ToInt32(objHelpDesk_LastSearch.CurrentPage ?? 1); intCurrentPage++; objHelpDesk_LastSearch.CurrentPage = intCurrentPage; SaveLastSearchCriteria(objHelpDesk_LastSearch); DisplayExistingTickets(SearchCriteria); } #endregion #region lnkPrevious_Click protected void lnkPrevious_Click(object sender, EventArgs e) { HelpDesk_LastSearch objHelpDesk_LastSearch = GetLastSearchCriteria(); int intCurrentPage = Convert.ToInt32(objHelpDesk_LastSearch.CurrentPage ?? 2); intCurrentPage--; objHelpDesk_LastSearch.CurrentPage = intCurrentPage; SaveLastSearchCriteria(objHelpDesk_LastSearch); DisplayExistingTickets(SearchCriteria); } #endregion #region lnkFirst_Click protected void lnkFirst_Click(object sender, EventArgs e) { HelpDesk_LastSearch objHelpDesk_LastSearch = GetLastSearchCriteria(); int intCurrentPage = Convert.ToInt32(objHelpDesk_LastSearch.CurrentPage ?? 2); intCurrentPage = 1; objHelpDesk_LastSearch.CurrentPage = intCurrentPage; SaveLastSearchCriteria(objHelpDesk_LastSearch); DisplayExistingTickets(SearchCriteria); } #endregion #region lnkLast_Click protected void lnkLast_Click(object sender, EventArgs e) { HelpDesk_LastSearch objHelpDesk_LastSearch = GetLastSearchCriteria(); int intCurrentPage = Convert.ToInt32(objHelpDesk_LastSearch.CurrentPage ?? 1); intCurrentPage = -1; objHelpDesk_LastSearch.CurrentPage = intCurrentPage; SaveLastSearchCriteria(objHelpDesk_LastSearch); DisplayExistingTickets(SearchCriteria); } #endregion #region ddlPageSize_SelectedIndexChanged protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) { HelpDesk_LastSearch objHelpDesk_LastSearch = GetLastSearchCriteria(); objHelpDesk_LastSearch.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); SaveLastSearchCriteria(objHelpDesk_LastSearch); DisplayExistingTickets(SearchCriteria); } #endregion #region lnkPage_Click protected void lnkPage_Click(object sender, EventArgs e) { LinkButton lnkButton = sender as LinkButton; CurrentPage = lnkButton.CommandArgument; HelpDesk_LastSearch objHelpDesk_LastSearch = GetLastSearchCriteria(); objHelpDesk_LastSearch.CurrentPage = Convert.ToInt32(lnkButton.CommandArgument); SaveLastSearchCriteria(objHelpDesk_LastSearch); DisplayExistingTickets(SearchCriteria); } #endregion #region PagingDataList_ItemDataBound protected void PagingDataList_ItemDataBound(object sender, DataListItemEventArgs e) { LinkButton pageLink = e.Item.FindControl("lnkPage") as LinkButton; if (Convert.ToInt32(pageLink.CommandArgument) == GetCurrentPage()) pageLink.Font.Underline = false; else pageLink.Font.Underline = true; } #endregion } }
43.229379
293
0.542508
[ "MIT" ]
roman-yagodin/R7.HelpDesk
R7.HelpDesk/View.ascx.cs
93,289
C#
using System; using System.Collections.Generic; namespace Songbook.Theory { public class Note : IEquatable<Note> { private static readonly List<string> _chromaticSharpScale = new List<string> { "A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#" }; private static readonly List<string> _chromaticFlatScale = new List<string> { "A", "Bb", "B", "C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab" }; private static readonly Dictionary<string, Note> _notes = new Dictionary<string, Note> { { "A", new Note("A") }, { "A#", new Note("A#", "Bb") }, { "Bb", new Note("Bb", "A#") }, { "B", new Note("B") }, { "C", new Note("C") }, { "C#", new Note("C#", "Db") }, { "Db", new Note("Db", "C#") }, { "D", new Note("D") }, { "D#", new Note("D#", "Eb") }, { "Eb", new Note("Eb", "D#") }, { "E", new Note("E") }, { "F", new Note("F") }, { "F#", new Note("F#", "Gb") }, { "Gb", new Note("Gb", "F#") }, { "G", new Note("G") }, { "G#", new Note("G#", "Ab") }, { "Ab", new Note("Ab", "G#") } }; private Note(string name, string enharmonicName = null) { Name = name; EnharmonicName = enharmonicName ?? name; } public string Name { get; private set; } public string EnharmonicName { get; private set; } public Note Transpose(int semitoneOffset) { var scale = _chromaticSharpScale; var index = scale.IndexOf(Name); if (index == -1) { scale = _chromaticFlatScale; index = scale.IndexOf(Name); } index += semitoneOffset; if (index >= scale.Count) index -= scale.Count; else if (index < 0) index += scale.Count; return Note.FromName(scale[index]); } public override bool Equals(object obj) { return Equals(obj as Note); } public bool Equals(Note other) { if (other == null) return false; return Name == other.Name; } public override int GetHashCode() { return Name.GetHashCode(); } public override string ToString() { return Name; } public static Note FromName(string name) { Note note; if (_notes.TryGetValue(name, out note)) return note; return null; } public static bool operator ==(Note a, Note b) { if (object.ReferenceEquals(a, b)) return true; if (object.ReferenceEquals(a, null) || object.ReferenceEquals(b, null)) return false; return a.Equals(b); } public static bool operator !=(Note a, Note b) { return !(a == b); } } }
28.342342
153
0.440242
[ "Apache-2.0" ]
craiggwilson/songbook
src/Songbook.Theory/Theory/Note.cs
3,148
C#
using Microsoft.AspNetCore.Mvc.Rendering; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace Multiblog.OAuth.Controllers { public class RegisterUserViewModel { // credentials [Required] [MaxLength(100)] public string Username { get; set; } [MaxLength(100)] public string Password { get; set; } // claims [Required] [MaxLength(100)] public string Firstname { get; set; } [Required] [MaxLength(100)] public string Lastname { get; set; } [Required] [MaxLength(249)] public string Email { get; set; } public string ProfileImage { get; set; } [Required] [MaxLength(2)] public string Country { get; set; } public SelectList CountryCodes { get; set; } = new SelectList( new[] { new { Id = "SE", Value = "Sweden" }, new { Id = "BE", Value = "Belgium" }, new { Id = "US", Value = "United States of America" }, new { Id = "IN", Value = "India" }, }, "Id", "Value"); public string ReturnUrl { get; set; } public string Provider { get; set; } public string ProviderUserId { get; set; } public bool IsProvisioningFromExternal { get { return (Provider != null); } } } }
24.615385
74
0.51125
[ "Apache-2.0" ]
fredrikstrandin/Miniblog.Core
src/Multiblog.OAuth/Controllers/RegisterUser/RegisterUserViewModel.cs
1,602
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the iot-2015-05-28.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.IoT.Model; using Amazon.IoT.Model.Internal.MarshallTransformations; using Amazon.IoT.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.IoT { /// <summary> /// Implementation for accessing IoT /// /// AWS IoT /// <para> /// AWS IoT provides secure, bi-directional communication between Internet-connected devices /// (such as sensors, actuators, embedded devices, or smart appliances) and the AWS cloud. /// You can discover your custom IoT-Data endpoint to communicate with, configure rules /// for data processing and integration with other services, organize resources associated /// with each device (Registry), configure logging, and create and manage policies and /// credentials to authenticate devices. /// </para> /// /// <para> /// The service endpoints that expose this API are listed in <a href="https://docs.aws.amazon.com/general/latest/gr/iot-core.html">AWS /// IoT Core Endpoints and Quotas</a>. You must use the endpoint for the region that has /// the resources you want to access. /// </para> /// /// <para> /// The service name used by <a href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html">AWS /// Signature Version 4</a> to sign the request is: <i>execute-api</i>. /// </para> /// /// <para> /// For more information about how AWS IoT works, see the <a href="https://docs.aws.amazon.com/iot/latest/developerguide/aws-iot-how-it-works.html">Developer /// Guide</a>. /// </para> /// /// <para> /// For information about how to use the credentials provider for AWS IoT, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/authorizing-direct-aws.html">Authorizing /// Direct Calls to AWS Services</a>. /// </para> /// </summary> public partial class AmazonIoTClient : AmazonServiceClient, IAmazonIoT { private static IServiceMetadata serviceMetadata = new AmazonIoTMetadata(); private IIoTPaginatorFactory _paginators; /// <summary> /// Paginators for the service /// </summary> public IIoTPaginatorFactory Paginators { get { if (this._paginators == null) { this._paginators = new IoTPaginatorFactory(this); } return this._paginators; } } #region Constructors /// <summary> /// Constructs AmazonIoTClient 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 AmazonIoTClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonIoTConfig()) { } /// <summary> /// Constructs AmazonIoTClient 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 AmazonIoTClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonIoTConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonIoTClient 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 AmazonIoTClient Configuration Object</param> public AmazonIoTClient(AmazonIoTConfig config) : base(FallbackCredentialsFactory.GetCredentials(), config) { } /// <summary> /// Constructs AmazonIoTClient with AWS Credentials /// </summary> /// <param name="credentials">AWS Credentials</param> public AmazonIoTClient(AWSCredentials credentials) : this(credentials, new AmazonIoTConfig()) { } /// <summary> /// Constructs AmazonIoTClient with AWS Credentials /// </summary> /// <param name="credentials">AWS Credentials</param> /// <param name="region">The region to connect.</param> public AmazonIoTClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonIoTConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonIoTClient with AWS Credentials and an /// AmazonIoTClient Configuration object. /// </summary> /// <param name="credentials">AWS Credentials</param> /// <param name="clientConfig">The AmazonIoTClient Configuration Object</param> public AmazonIoTClient(AWSCredentials credentials, AmazonIoTConfig clientConfig) : base(credentials, clientConfig) { } /// <summary> /// Constructs AmazonIoTClient 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 AmazonIoTClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonIoTConfig()) { } /// <summary> /// Constructs AmazonIoTClient 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 AmazonIoTClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonIoTConfig() {RegionEndpoint=region}) { } /// <summary> /// Constructs AmazonIoTClient with AWS Access Key ID, AWS Secret Key and an /// AmazonIoTClient Configuration object. /// </summary> /// <param name="awsAccessKeyId">AWS Access Key ID</param> /// <param name="awsSecretAccessKey">AWS Secret Access Key</param> /// <param name="clientConfig">The AmazonIoTClient Configuration Object</param> public AmazonIoTClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonIoTConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// <summary> /// Constructs AmazonIoTClient 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 AmazonIoTClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonIoTConfig()) { } /// <summary> /// Constructs AmazonIoTClient 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 AmazonIoTClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonIoTConfig{RegionEndpoint = region}) { } /// <summary> /// Constructs AmazonIoTClient with AWS Access Key ID, AWS Secret Key and an /// AmazonIoTClient 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 AmazonIoTClient Configuration Object</param> public AmazonIoTClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonIoTConfig 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 AcceptCertificateTransfer /// <summary> /// Accepts a pending certificate transfer. The default state of the certificate is INACTIVE. /// /// /// <para> /// To check for pending certificate transfers, call <a>ListCertificates</a> to enumerate /// your certificates. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AcceptCertificateTransfer service method.</param> /// /// <returns>The response from the AcceptCertificateTransfer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferAlreadyCompletedException"> /// You can't revert the certificate transfer because the transfer is already complete. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AcceptCertificateTransfer">REST API Reference for AcceptCertificateTransfer Operation</seealso> public virtual AcceptCertificateTransferResponse AcceptCertificateTransfer(AcceptCertificateTransferRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AcceptCertificateTransferRequestMarshaller.Instance; options.ResponseUnmarshaller = AcceptCertificateTransferResponseUnmarshaller.Instance; return Invoke<AcceptCertificateTransferResponse>(request, options); } /// <summary> /// Accepts a pending certificate transfer. The default state of the certificate is INACTIVE. /// /// /// <para> /// To check for pending certificate transfers, call <a>ListCertificates</a> to enumerate /// your certificates. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AcceptCertificateTransfer 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 AcceptCertificateTransfer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferAlreadyCompletedException"> /// You can't revert the certificate transfer because the transfer is already complete. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AcceptCertificateTransfer">REST API Reference for AcceptCertificateTransfer Operation</seealso> public virtual Task<AcceptCertificateTransferResponse> AcceptCertificateTransferAsync(AcceptCertificateTransferRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AcceptCertificateTransferRequestMarshaller.Instance; options.ResponseUnmarshaller = AcceptCertificateTransferResponseUnmarshaller.Instance; return InvokeAsync<AcceptCertificateTransferResponse>(request, options, cancellationToken); } #endregion #region AddThingToBillingGroup /// <summary> /// Adds a thing to a billing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AddThingToBillingGroup service method.</param> /// /// <returns>The response from the AddThingToBillingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AddThingToBillingGroup">REST API Reference for AddThingToBillingGroup Operation</seealso> public virtual AddThingToBillingGroupResponse AddThingToBillingGroup(AddThingToBillingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AddThingToBillingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = AddThingToBillingGroupResponseUnmarshaller.Instance; return Invoke<AddThingToBillingGroupResponse>(request, options); } /// <summary> /// Adds a thing to a billing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AddThingToBillingGroup 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 AddThingToBillingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AddThingToBillingGroup">REST API Reference for AddThingToBillingGroup Operation</seealso> public virtual Task<AddThingToBillingGroupResponse> AddThingToBillingGroupAsync(AddThingToBillingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AddThingToBillingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = AddThingToBillingGroupResponseUnmarshaller.Instance; return InvokeAsync<AddThingToBillingGroupResponse>(request, options, cancellationToken); } #endregion #region AddThingToThingGroup /// <summary> /// Adds a thing to a thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AddThingToThingGroup service method.</param> /// /// <returns>The response from the AddThingToThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AddThingToThingGroup">REST API Reference for AddThingToThingGroup Operation</seealso> public virtual AddThingToThingGroupResponse AddThingToThingGroup(AddThingToThingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AddThingToThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = AddThingToThingGroupResponseUnmarshaller.Instance; return Invoke<AddThingToThingGroupResponse>(request, options); } /// <summary> /// Adds a thing to a thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AddThingToThingGroup 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 AddThingToThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AddThingToThingGroup">REST API Reference for AddThingToThingGroup Operation</seealso> public virtual Task<AddThingToThingGroupResponse> AddThingToThingGroupAsync(AddThingToThingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AddThingToThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = AddThingToThingGroupResponseUnmarshaller.Instance; return InvokeAsync<AddThingToThingGroupResponse>(request, options, cancellationToken); } #endregion #region AssociateTargetsWithJob /// <summary> /// Associates a group with a continuous job. The following criteria must be met: /// /// <ul> <li> /// <para> /// The job must have been created with the <code>targetSelection</code> field set to /// "CONTINUOUS". /// </para> /// </li> <li> /// <para> /// The job status must currently be "IN_PROGRESS". /// </para> /// </li> <li> /// <para> /// The total number of targets associated with a job must not exceed 100. /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AssociateTargetsWithJob service method.</param> /// /// <returns>The response from the AssociateTargetsWithJob service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AssociateTargetsWithJob">REST API Reference for AssociateTargetsWithJob Operation</seealso> public virtual AssociateTargetsWithJobResponse AssociateTargetsWithJob(AssociateTargetsWithJobRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateTargetsWithJobRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateTargetsWithJobResponseUnmarshaller.Instance; return Invoke<AssociateTargetsWithJobResponse>(request, options); } /// <summary> /// Associates a group with a continuous job. The following criteria must be met: /// /// <ul> <li> /// <para> /// The job must have been created with the <code>targetSelection</code> field set to /// "CONTINUOUS". /// </para> /// </li> <li> /// <para> /// The job status must currently be "IN_PROGRESS". /// </para> /// </li> <li> /// <para> /// The total number of targets associated with a job must not exceed 100. /// </para> /// </li> </ul> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AssociateTargetsWithJob 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 AssociateTargetsWithJob service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AssociateTargetsWithJob">REST API Reference for AssociateTargetsWithJob Operation</seealso> public virtual Task<AssociateTargetsWithJobResponse> AssociateTargetsWithJobAsync(AssociateTargetsWithJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AssociateTargetsWithJobRequestMarshaller.Instance; options.ResponseUnmarshaller = AssociateTargetsWithJobResponseUnmarshaller.Instance; return InvokeAsync<AssociateTargetsWithJobResponse>(request, options, cancellationToken); } #endregion #region AttachPolicy /// <summary> /// Attaches a policy to the specified target. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AttachPolicy service method.</param> /// /// <returns>The response from the AttachPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AttachPolicy">REST API Reference for AttachPolicy Operation</seealso> public virtual AttachPolicyResponse AttachPolicy(AttachPolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AttachPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = AttachPolicyResponseUnmarshaller.Instance; return Invoke<AttachPolicyResponse>(request, options); } /// <summary> /// Attaches a policy to the specified target. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AttachPolicy 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 AttachPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AttachPolicy">REST API Reference for AttachPolicy Operation</seealso> public virtual Task<AttachPolicyResponse> AttachPolicyAsync(AttachPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AttachPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = AttachPolicyResponseUnmarshaller.Instance; return InvokeAsync<AttachPolicyResponse>(request, options, cancellationToken); } #endregion #region AttachPrincipalPolicy /// <summary> /// Attaches the specified policy to the specified principal (certificate or other credential). /// /// /// <para> /// <b>Note:</b> This API is deprecated. Please use <a>AttachPolicy</a> instead. /// </para> /// </summary> /// <param name="policyName">The policy name.</param> /// <param name="principal">The principal, which can be a certificate ARN (as returned from the CreateCertificate operation) or an Amazon Cognito ID.</param> /// /// <returns>The response from the AttachPrincipalPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AttachPrincipalPolicy">REST API Reference for AttachPrincipalPolicy Operation</seealso> [Obsolete("Deprecated in favor of AttachPolicy.")] public virtual AttachPrincipalPolicyResponse AttachPrincipalPolicy(string policyName, string principal) { var request = new AttachPrincipalPolicyRequest(); request.PolicyName = policyName; request.Principal = principal; return AttachPrincipalPolicy(request); } /// <summary> /// Attaches the specified policy to the specified principal (certificate or other credential). /// /// /// <para> /// <b>Note:</b> This API is deprecated. Please use <a>AttachPolicy</a> instead. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AttachPrincipalPolicy service method.</param> /// /// <returns>The response from the AttachPrincipalPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AttachPrincipalPolicy">REST API Reference for AttachPrincipalPolicy Operation</seealso> [Obsolete("Deprecated in favor of AttachPolicy.")] public virtual AttachPrincipalPolicyResponse AttachPrincipalPolicy(AttachPrincipalPolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AttachPrincipalPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = AttachPrincipalPolicyResponseUnmarshaller.Instance; return Invoke<AttachPrincipalPolicyResponse>(request, options); } /// <summary> /// Attaches the specified policy to the specified principal (certificate or other credential). /// /// /// <para> /// <b>Note:</b> This API is deprecated. Please use <a>AttachPolicy</a> instead. /// </para> /// </summary> /// <param name="policyName">The policy name.</param> /// <param name="principal">The principal, which can be a certificate ARN (as returned from the CreateCertificate operation) or an Amazon Cognito ID.</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 AttachPrincipalPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AttachPrincipalPolicy">REST API Reference for AttachPrincipalPolicy Operation</seealso> [Obsolete("Deprecated in favor of AttachPolicy.")] public virtual Task<AttachPrincipalPolicyResponse> AttachPrincipalPolicyAsync(string policyName, string principal, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new AttachPrincipalPolicyRequest(); request.PolicyName = policyName; request.Principal = principal; return AttachPrincipalPolicyAsync(request, cancellationToken); } /// <summary> /// Attaches the specified policy to the specified principal (certificate or other credential). /// /// /// <para> /// <b>Note:</b> This API is deprecated. Please use <a>AttachPolicy</a> instead. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the AttachPrincipalPolicy 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 AttachPrincipalPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AttachPrincipalPolicy">REST API Reference for AttachPrincipalPolicy Operation</seealso> [Obsolete("Deprecated in favor of AttachPolicy.")] public virtual Task<AttachPrincipalPolicyResponse> AttachPrincipalPolicyAsync(AttachPrincipalPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AttachPrincipalPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = AttachPrincipalPolicyResponseUnmarshaller.Instance; return InvokeAsync<AttachPrincipalPolicyResponse>(request, options, cancellationToken); } #endregion #region AttachSecurityProfile /// <summary> /// Associates a Device Defender security profile with a thing group or this account. /// Each thing group or account can have up to five security profiles associated with /// it. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AttachSecurityProfile service method.</param> /// /// <returns>The response from the AttachSecurityProfile service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AttachSecurityProfile">REST API Reference for AttachSecurityProfile Operation</seealso> public virtual AttachSecurityProfileResponse AttachSecurityProfile(AttachSecurityProfileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AttachSecurityProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = AttachSecurityProfileResponseUnmarshaller.Instance; return Invoke<AttachSecurityProfileResponse>(request, options); } /// <summary> /// Associates a Device Defender security profile with a thing group or this account. /// Each thing group or account can have up to five security profiles associated with /// it. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AttachSecurityProfile 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 AttachSecurityProfile service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AttachSecurityProfile">REST API Reference for AttachSecurityProfile Operation</seealso> public virtual Task<AttachSecurityProfileResponse> AttachSecurityProfileAsync(AttachSecurityProfileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AttachSecurityProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = AttachSecurityProfileResponseUnmarshaller.Instance; return InvokeAsync<AttachSecurityProfileResponse>(request, options, cancellationToken); } #endregion #region AttachThingPrincipal /// <summary> /// Attaches the specified principal to the specified thing. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// </summary> /// <param name="thingName">The name of the thing.</param> /// <param name="principal">The principal, which can be a certificate ARN (as returned from the CreateCertificate operation) or an Amazon Cognito ID.</param> /// /// <returns>The response from the AttachThingPrincipal service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AttachThingPrincipal">REST API Reference for AttachThingPrincipal Operation</seealso> public virtual AttachThingPrincipalResponse AttachThingPrincipal(string thingName, string principal) { var request = new AttachThingPrincipalRequest(); request.ThingName = thingName; request.Principal = principal; return AttachThingPrincipal(request); } /// <summary> /// Attaches the specified principal to the specified thing. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AttachThingPrincipal service method.</param> /// /// <returns>The response from the AttachThingPrincipal service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AttachThingPrincipal">REST API Reference for AttachThingPrincipal Operation</seealso> public virtual AttachThingPrincipalResponse AttachThingPrincipal(AttachThingPrincipalRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = AttachThingPrincipalRequestMarshaller.Instance; options.ResponseUnmarshaller = AttachThingPrincipalResponseUnmarshaller.Instance; return Invoke<AttachThingPrincipalResponse>(request, options); } /// <summary> /// Attaches the specified principal to the specified thing. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// </summary> /// <param name="thingName">The name of the thing.</param> /// <param name="principal">The principal, which can be a certificate ARN (as returned from the CreateCertificate operation) or an Amazon Cognito ID.</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 AttachThingPrincipal service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AttachThingPrincipal">REST API Reference for AttachThingPrincipal Operation</seealso> public virtual Task<AttachThingPrincipalResponse> AttachThingPrincipalAsync(string thingName, string principal, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new AttachThingPrincipalRequest(); request.ThingName = thingName; request.Principal = principal; return AttachThingPrincipalAsync(request, cancellationToken); } /// <summary> /// Attaches the specified principal to the specified thing. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// </summary> /// <param name="request">Container for the necessary parameters to execute the AttachThingPrincipal 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 AttachThingPrincipal service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/AttachThingPrincipal">REST API Reference for AttachThingPrincipal Operation</seealso> public virtual Task<AttachThingPrincipalResponse> AttachThingPrincipalAsync(AttachThingPrincipalRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = AttachThingPrincipalRequestMarshaller.Instance; options.ResponseUnmarshaller = AttachThingPrincipalResponseUnmarshaller.Instance; return InvokeAsync<AttachThingPrincipalResponse>(request, options, cancellationToken); } #endregion #region CancelAuditMitigationActionsTask /// <summary> /// Cancels a mitigation action task that is in progress. If the task is not in progress, /// an InvalidRequestException occurs. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CancelAuditMitigationActionsTask service method.</param> /// /// <returns>The response from the CancelAuditMitigationActionsTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CancelAuditMitigationActionsTask">REST API Reference for CancelAuditMitigationActionsTask Operation</seealso> public virtual CancelAuditMitigationActionsTaskResponse CancelAuditMitigationActionsTask(CancelAuditMitigationActionsTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CancelAuditMitigationActionsTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = CancelAuditMitigationActionsTaskResponseUnmarshaller.Instance; return Invoke<CancelAuditMitigationActionsTaskResponse>(request, options); } /// <summary> /// Cancels a mitigation action task that is in progress. If the task is not in progress, /// an InvalidRequestException occurs. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CancelAuditMitigationActionsTask 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 CancelAuditMitigationActionsTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CancelAuditMitigationActionsTask">REST API Reference for CancelAuditMitigationActionsTask Operation</seealso> public virtual Task<CancelAuditMitigationActionsTaskResponse> CancelAuditMitigationActionsTaskAsync(CancelAuditMitigationActionsTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CancelAuditMitigationActionsTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = CancelAuditMitigationActionsTaskResponseUnmarshaller.Instance; return InvokeAsync<CancelAuditMitigationActionsTaskResponse>(request, options, cancellationToken); } #endregion #region CancelAuditTask /// <summary> /// Cancels an audit that is in progress. The audit can be either scheduled or on-demand. /// If the audit is not in progress, an "InvalidRequestException" occurs. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CancelAuditTask service method.</param> /// /// <returns>The response from the CancelAuditTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CancelAuditTask">REST API Reference for CancelAuditTask Operation</seealso> public virtual CancelAuditTaskResponse CancelAuditTask(CancelAuditTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CancelAuditTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = CancelAuditTaskResponseUnmarshaller.Instance; return Invoke<CancelAuditTaskResponse>(request, options); } /// <summary> /// Cancels an audit that is in progress. The audit can be either scheduled or on-demand. /// If the audit is not in progress, an "InvalidRequestException" occurs. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CancelAuditTask 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 CancelAuditTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CancelAuditTask">REST API Reference for CancelAuditTask Operation</seealso> public virtual Task<CancelAuditTaskResponse> CancelAuditTaskAsync(CancelAuditTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CancelAuditTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = CancelAuditTaskResponseUnmarshaller.Instance; return InvokeAsync<CancelAuditTaskResponse>(request, options, cancellationToken); } #endregion #region CancelCertificateTransfer /// <summary> /// Cancels a pending transfer for the specified certificate. /// /// /// <para> /// <b>Note</b> Only the transfer source account can use this operation to cancel a transfer. /// (Transfer destinations can use <a>RejectCertificateTransfer</a> instead.) After transfer, /// AWS IoT returns the certificate to the source account in the INACTIVE state. After /// the destination account has accepted the transfer, the transfer cannot be cancelled. /// </para> /// /// <para> /// After a certificate transfer is cancelled, the status of the certificate changes from /// PENDING_TRANSFER to INACTIVE. /// </para> /// </summary> /// <param name="certificateId">The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</param> /// /// <returns>The response from the CancelCertificateTransfer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferAlreadyCompletedException"> /// You can't revert the certificate transfer because the transfer is already complete. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CancelCertificateTransfer">REST API Reference for CancelCertificateTransfer Operation</seealso> public virtual CancelCertificateTransferResponse CancelCertificateTransfer(string certificateId) { var request = new CancelCertificateTransferRequest(); request.CertificateId = certificateId; return CancelCertificateTransfer(request); } /// <summary> /// Cancels a pending transfer for the specified certificate. /// /// /// <para> /// <b>Note</b> Only the transfer source account can use this operation to cancel a transfer. /// (Transfer destinations can use <a>RejectCertificateTransfer</a> instead.) After transfer, /// AWS IoT returns the certificate to the source account in the INACTIVE state. After /// the destination account has accepted the transfer, the transfer cannot be cancelled. /// </para> /// /// <para> /// After a certificate transfer is cancelled, the status of the certificate changes from /// PENDING_TRANSFER to INACTIVE. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CancelCertificateTransfer service method.</param> /// /// <returns>The response from the CancelCertificateTransfer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferAlreadyCompletedException"> /// You can't revert the certificate transfer because the transfer is already complete. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CancelCertificateTransfer">REST API Reference for CancelCertificateTransfer Operation</seealso> public virtual CancelCertificateTransferResponse CancelCertificateTransfer(CancelCertificateTransferRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CancelCertificateTransferRequestMarshaller.Instance; options.ResponseUnmarshaller = CancelCertificateTransferResponseUnmarshaller.Instance; return Invoke<CancelCertificateTransferResponse>(request, options); } /// <summary> /// Cancels a pending transfer for the specified certificate. /// /// /// <para> /// <b>Note</b> Only the transfer source account can use this operation to cancel a transfer. /// (Transfer destinations can use <a>RejectCertificateTransfer</a> instead.) After transfer, /// AWS IoT returns the certificate to the source account in the INACTIVE state. After /// the destination account has accepted the transfer, the transfer cannot be cancelled. /// </para> /// /// <para> /// After a certificate transfer is cancelled, the status of the certificate changes from /// PENDING_TRANSFER to INACTIVE. /// </para> /// </summary> /// <param name="certificateId">The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</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 CancelCertificateTransfer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferAlreadyCompletedException"> /// You can't revert the certificate transfer because the transfer is already complete. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CancelCertificateTransfer">REST API Reference for CancelCertificateTransfer Operation</seealso> public virtual Task<CancelCertificateTransferResponse> CancelCertificateTransferAsync(string certificateId, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new CancelCertificateTransferRequest(); request.CertificateId = certificateId; return CancelCertificateTransferAsync(request, cancellationToken); } /// <summary> /// Cancels a pending transfer for the specified certificate. /// /// /// <para> /// <b>Note</b> Only the transfer source account can use this operation to cancel a transfer. /// (Transfer destinations can use <a>RejectCertificateTransfer</a> instead.) After transfer, /// AWS IoT returns the certificate to the source account in the INACTIVE state. After /// the destination account has accepted the transfer, the transfer cannot be cancelled. /// </para> /// /// <para> /// After a certificate transfer is cancelled, the status of the certificate changes from /// PENDING_TRANSFER to INACTIVE. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CancelCertificateTransfer 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 CancelCertificateTransfer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferAlreadyCompletedException"> /// You can't revert the certificate transfer because the transfer is already complete. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CancelCertificateTransfer">REST API Reference for CancelCertificateTransfer Operation</seealso> public virtual Task<CancelCertificateTransferResponse> CancelCertificateTransferAsync(CancelCertificateTransferRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CancelCertificateTransferRequestMarshaller.Instance; options.ResponseUnmarshaller = CancelCertificateTransferResponseUnmarshaller.Instance; return InvokeAsync<CancelCertificateTransferResponse>(request, options, cancellationToken); } #endregion #region CancelJob /// <summary> /// Cancels a job. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CancelJob service method.</param> /// /// <returns>The response from the CancelJob service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CancelJob">REST API Reference for CancelJob Operation</seealso> public virtual CancelJobResponse CancelJob(CancelJobRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CancelJobRequestMarshaller.Instance; options.ResponseUnmarshaller = CancelJobResponseUnmarshaller.Instance; return Invoke<CancelJobResponse>(request, options); } /// <summary> /// Cancels a job. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CancelJob 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 CancelJob service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CancelJob">REST API Reference for CancelJob Operation</seealso> public virtual Task<CancelJobResponse> CancelJobAsync(CancelJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CancelJobRequestMarshaller.Instance; options.ResponseUnmarshaller = CancelJobResponseUnmarshaller.Instance; return InvokeAsync<CancelJobResponse>(request, options, cancellationToken); } #endregion #region CancelJobExecution /// <summary> /// Cancels the execution of a job for a given thing. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CancelJobExecution service method.</param> /// /// <returns>The response from the CancelJobExecution service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidStateTransitionException"> /// An attempt was made to change to an invalid state, for example by deleting a job or /// a job execution which is "IN_PROGRESS" without setting the <code>force</code> parameter. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CancelJobExecution">REST API Reference for CancelJobExecution Operation</seealso> public virtual CancelJobExecutionResponse CancelJobExecution(CancelJobExecutionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CancelJobExecutionRequestMarshaller.Instance; options.ResponseUnmarshaller = CancelJobExecutionResponseUnmarshaller.Instance; return Invoke<CancelJobExecutionResponse>(request, options); } /// <summary> /// Cancels the execution of a job for a given thing. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CancelJobExecution 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 CancelJobExecution service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidStateTransitionException"> /// An attempt was made to change to an invalid state, for example by deleting a job or /// a job execution which is "IN_PROGRESS" without setting the <code>force</code> parameter. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CancelJobExecution">REST API Reference for CancelJobExecution Operation</seealso> public virtual Task<CancelJobExecutionResponse> CancelJobExecutionAsync(CancelJobExecutionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CancelJobExecutionRequestMarshaller.Instance; options.ResponseUnmarshaller = CancelJobExecutionResponseUnmarshaller.Instance; return InvokeAsync<CancelJobExecutionResponse>(request, options, cancellationToken); } #endregion #region ClearDefaultAuthorizer /// <summary> /// Clears the default authorizer. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ClearDefaultAuthorizer service method.</param> /// /// <returns>The response from the ClearDefaultAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ClearDefaultAuthorizer">REST API Reference for ClearDefaultAuthorizer Operation</seealso> public virtual ClearDefaultAuthorizerResponse ClearDefaultAuthorizer(ClearDefaultAuthorizerRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ClearDefaultAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = ClearDefaultAuthorizerResponseUnmarshaller.Instance; return Invoke<ClearDefaultAuthorizerResponse>(request, options); } /// <summary> /// Clears the default authorizer. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ClearDefaultAuthorizer 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 ClearDefaultAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ClearDefaultAuthorizer">REST API Reference for ClearDefaultAuthorizer Operation</seealso> public virtual Task<ClearDefaultAuthorizerResponse> ClearDefaultAuthorizerAsync(ClearDefaultAuthorizerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ClearDefaultAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = ClearDefaultAuthorizerResponseUnmarshaller.Instance; return InvokeAsync<ClearDefaultAuthorizerResponse>(request, options, cancellationToken); } #endregion #region ConfirmTopicRuleDestination /// <summary> /// Confirms a topic rule destination. When you create a rule requiring a destination, /// AWS IoT sends a confirmation message to the endpoint or base address you specify. /// The message includes a token which you pass back when calling <code>ConfirmTopicRuleDestination</code> /// to confirm that you own or have access to the endpoint. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ConfirmTopicRuleDestination service method.</param> /// /// <returns>The response from the ConfirmTopicRuleDestination service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ConfirmTopicRuleDestination">REST API Reference for ConfirmTopicRuleDestination Operation</seealso> public virtual ConfirmTopicRuleDestinationResponse ConfirmTopicRuleDestination(ConfirmTopicRuleDestinationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ConfirmTopicRuleDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = ConfirmTopicRuleDestinationResponseUnmarshaller.Instance; return Invoke<ConfirmTopicRuleDestinationResponse>(request, options); } /// <summary> /// Confirms a topic rule destination. When you create a rule requiring a destination, /// AWS IoT sends a confirmation message to the endpoint or base address you specify. /// The message includes a token which you pass back when calling <code>ConfirmTopicRuleDestination</code> /// to confirm that you own or have access to the endpoint. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ConfirmTopicRuleDestination 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 ConfirmTopicRuleDestination service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ConfirmTopicRuleDestination">REST API Reference for ConfirmTopicRuleDestination Operation</seealso> public virtual Task<ConfirmTopicRuleDestinationResponse> ConfirmTopicRuleDestinationAsync(ConfirmTopicRuleDestinationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ConfirmTopicRuleDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = ConfirmTopicRuleDestinationResponseUnmarshaller.Instance; return InvokeAsync<ConfirmTopicRuleDestinationResponse>(request, options, cancellationToken); } #endregion #region CreateAuditSuppression /// <summary> /// Creates a Device Defender audit suppression. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateAuditSuppression service method.</param> /// /// <returns>The response from the CreateAuditSuppression service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateAuditSuppression">REST API Reference for CreateAuditSuppression Operation</seealso> public virtual CreateAuditSuppressionResponse CreateAuditSuppression(CreateAuditSuppressionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateAuditSuppressionRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateAuditSuppressionResponseUnmarshaller.Instance; return Invoke<CreateAuditSuppressionResponse>(request, options); } /// <summary> /// Creates a Device Defender audit suppression. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateAuditSuppression 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 CreateAuditSuppression service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateAuditSuppression">REST API Reference for CreateAuditSuppression Operation</seealso> public virtual Task<CreateAuditSuppressionResponse> CreateAuditSuppressionAsync(CreateAuditSuppressionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateAuditSuppressionRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateAuditSuppressionResponseUnmarshaller.Instance; return InvokeAsync<CreateAuditSuppressionResponse>(request, options, cancellationToken); } #endregion #region CreateAuthorizer /// <summary> /// Creates an authorizer. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateAuthorizer service method.</param> /// /// <returns>The response from the CreateAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateAuthorizer">REST API Reference for CreateAuthorizer Operation</seealso> public virtual CreateAuthorizerResponse CreateAuthorizer(CreateAuthorizerRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateAuthorizerResponseUnmarshaller.Instance; return Invoke<CreateAuthorizerResponse>(request, options); } /// <summary> /// Creates an authorizer. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateAuthorizer 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 CreateAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateAuthorizer">REST API Reference for CreateAuthorizer Operation</seealso> public virtual Task<CreateAuthorizerResponse> CreateAuthorizerAsync(CreateAuthorizerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateAuthorizerResponseUnmarshaller.Instance; return InvokeAsync<CreateAuthorizerResponse>(request, options, cancellationToken); } #endregion #region CreateBillingGroup /// <summary> /// Creates a billing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateBillingGroup service method.</param> /// /// <returns>The response from the CreateBillingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateBillingGroup">REST API Reference for CreateBillingGroup Operation</seealso> public virtual CreateBillingGroupResponse CreateBillingGroup(CreateBillingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateBillingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateBillingGroupResponseUnmarshaller.Instance; return Invoke<CreateBillingGroupResponse>(request, options); } /// <summary> /// Creates a billing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateBillingGroup 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 CreateBillingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateBillingGroup">REST API Reference for CreateBillingGroup Operation</seealso> public virtual Task<CreateBillingGroupResponse> CreateBillingGroupAsync(CreateBillingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateBillingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateBillingGroupResponseUnmarshaller.Instance; return InvokeAsync<CreateBillingGroupResponse>(request, options, cancellationToken); } #endregion #region CreateCertificateFromCsr /// <summary> /// Creates an X.509 certificate using the specified certificate signing request. /// /// /// <para> /// <b>Note:</b> The CSR must include a public key that is either an RSA key with a length /// of at least 2048 bits or an ECC key from NIST P-256 or NIST P-384 curves. /// </para> /// /// <para> /// <b>Note:</b> Reusing the same certificate signing request (CSR) results in a distinct /// certificate. /// </para> /// /// <para> /// You can create multiple certificates in a batch by creating a directory, copying multiple /// .csr files into that directory, and then specifying that directory on the command /// line. The following commands show how to create a batch of certificates given a batch /// of CSRs. /// </para> /// /// <para> /// Assuming a set of CSRs are located inside of the directory my-csr-directory: /// </para> /// /// <para> /// On Linux and OS X, the command is: /// </para> /// /// <para> /// $ ls my-csr-directory/ | xargs -I {} aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/{} /// </para> /// /// <para> /// This command lists all of the CSRs in my-csr-directory and pipes each CSR file name /// to the aws iot create-certificate-from-csr AWS CLI command to create a certificate /// for the corresponding CSR. /// </para> /// /// <para> /// The aws iot create-certificate-from-csr part of the command can also be run in parallel /// to speed up the certificate creation process: /// </para> /// /// <para> /// $ ls my-csr-directory/ | xargs -P 10 -I {} aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/{} /// </para> /// /// <para> /// On Windows PowerShell, the command to create certificates for all CSRs in my-csr-directory /// is: /// </para> /// /// <para> /// &gt; ls -Name my-csr-directory | %{aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/$_} /// </para> /// /// <para> /// On a Windows command prompt, the command to create certificates for all CSRs in my-csr-directory /// is: /// </para> /// /// <para> /// &gt; forfiles /p my-csr-directory /c "cmd /c aws iot create-certificate-from-csr --certificate-signing-request /// file://@path" /// </para> /// </summary> /// <param name="certificateSigningRequest">The certificate signing request (CSR).</param> /// /// <returns>The response from the CreateCertificateFromCsr service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateCertificateFromCsr">REST API Reference for CreateCertificateFromCsr Operation</seealso> public virtual CreateCertificateFromCsrResponse CreateCertificateFromCsr(string certificateSigningRequest) { var request = new CreateCertificateFromCsrRequest(); request.CertificateSigningRequest = certificateSigningRequest; return CreateCertificateFromCsr(request); } /// <summary> /// Creates an X.509 certificate using the specified certificate signing request. /// /// /// <para> /// <b>Note:</b> The CSR must include a public key that is either an RSA key with a length /// of at least 2048 bits or an ECC key from NIST P-256 or NIST P-384 curves. /// </para> /// /// <para> /// <b>Note:</b> Reusing the same certificate signing request (CSR) results in a distinct /// certificate. /// </para> /// /// <para> /// You can create multiple certificates in a batch by creating a directory, copying multiple /// .csr files into that directory, and then specifying that directory on the command /// line. The following commands show how to create a batch of certificates given a batch /// of CSRs. /// </para> /// /// <para> /// Assuming a set of CSRs are located inside of the directory my-csr-directory: /// </para> /// /// <para> /// On Linux and OS X, the command is: /// </para> /// /// <para> /// $ ls my-csr-directory/ | xargs -I {} aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/{} /// </para> /// /// <para> /// This command lists all of the CSRs in my-csr-directory and pipes each CSR file name /// to the aws iot create-certificate-from-csr AWS CLI command to create a certificate /// for the corresponding CSR. /// </para> /// /// <para> /// The aws iot create-certificate-from-csr part of the command can also be run in parallel /// to speed up the certificate creation process: /// </para> /// /// <para> /// $ ls my-csr-directory/ | xargs -P 10 -I {} aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/{} /// </para> /// /// <para> /// On Windows PowerShell, the command to create certificates for all CSRs in my-csr-directory /// is: /// </para> /// /// <para> /// &gt; ls -Name my-csr-directory | %{aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/$_} /// </para> /// /// <para> /// On a Windows command prompt, the command to create certificates for all CSRs in my-csr-directory /// is: /// </para> /// /// <para> /// &gt; forfiles /p my-csr-directory /c "cmd /c aws iot create-certificate-from-csr --certificate-signing-request /// file://@path" /// </para> /// </summary> /// <param name="certificateSigningRequest">The certificate signing request (CSR).</param> /// <param name="setAsActive">Specifies whether the certificate is active.</param> /// /// <returns>The response from the CreateCertificateFromCsr service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateCertificateFromCsr">REST API Reference for CreateCertificateFromCsr Operation</seealso> public virtual CreateCertificateFromCsrResponse CreateCertificateFromCsr(string certificateSigningRequest, bool setAsActive) { var request = new CreateCertificateFromCsrRequest(); request.CertificateSigningRequest = certificateSigningRequest; request.SetAsActive = setAsActive; return CreateCertificateFromCsr(request); } /// <summary> /// Creates an X.509 certificate using the specified certificate signing request. /// /// /// <para> /// <b>Note:</b> The CSR must include a public key that is either an RSA key with a length /// of at least 2048 bits or an ECC key from NIST P-256 or NIST P-384 curves. /// </para> /// /// <para> /// <b>Note:</b> Reusing the same certificate signing request (CSR) results in a distinct /// certificate. /// </para> /// /// <para> /// You can create multiple certificates in a batch by creating a directory, copying multiple /// .csr files into that directory, and then specifying that directory on the command /// line. The following commands show how to create a batch of certificates given a batch /// of CSRs. /// </para> /// /// <para> /// Assuming a set of CSRs are located inside of the directory my-csr-directory: /// </para> /// /// <para> /// On Linux and OS X, the command is: /// </para> /// /// <para> /// $ ls my-csr-directory/ | xargs -I {} aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/{} /// </para> /// /// <para> /// This command lists all of the CSRs in my-csr-directory and pipes each CSR file name /// to the aws iot create-certificate-from-csr AWS CLI command to create a certificate /// for the corresponding CSR. /// </para> /// /// <para> /// The aws iot create-certificate-from-csr part of the command can also be run in parallel /// to speed up the certificate creation process: /// </para> /// /// <para> /// $ ls my-csr-directory/ | xargs -P 10 -I {} aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/{} /// </para> /// /// <para> /// On Windows PowerShell, the command to create certificates for all CSRs in my-csr-directory /// is: /// </para> /// /// <para> /// &gt; ls -Name my-csr-directory | %{aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/$_} /// </para> /// /// <para> /// On a Windows command prompt, the command to create certificates for all CSRs in my-csr-directory /// is: /// </para> /// /// <para> /// &gt; forfiles /p my-csr-directory /c "cmd /c aws iot create-certificate-from-csr --certificate-signing-request /// file://@path" /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateCertificateFromCsr service method.</param> /// /// <returns>The response from the CreateCertificateFromCsr service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateCertificateFromCsr">REST API Reference for CreateCertificateFromCsr Operation</seealso> public virtual CreateCertificateFromCsrResponse CreateCertificateFromCsr(CreateCertificateFromCsrRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateCertificateFromCsrRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateCertificateFromCsrResponseUnmarshaller.Instance; return Invoke<CreateCertificateFromCsrResponse>(request, options); } /// <summary> /// Creates an X.509 certificate using the specified certificate signing request. /// /// /// <para> /// <b>Note:</b> The CSR must include a public key that is either an RSA key with a length /// of at least 2048 bits or an ECC key from NIST P-256 or NIST P-384 curves. /// </para> /// /// <para> /// <b>Note:</b> Reusing the same certificate signing request (CSR) results in a distinct /// certificate. /// </para> /// /// <para> /// You can create multiple certificates in a batch by creating a directory, copying multiple /// .csr files into that directory, and then specifying that directory on the command /// line. The following commands show how to create a batch of certificates given a batch /// of CSRs. /// </para> /// /// <para> /// Assuming a set of CSRs are located inside of the directory my-csr-directory: /// </para> /// /// <para> /// On Linux and OS X, the command is: /// </para> /// /// <para> /// $ ls my-csr-directory/ | xargs -I {} aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/{} /// </para> /// /// <para> /// This command lists all of the CSRs in my-csr-directory and pipes each CSR file name /// to the aws iot create-certificate-from-csr AWS CLI command to create a certificate /// for the corresponding CSR. /// </para> /// /// <para> /// The aws iot create-certificate-from-csr part of the command can also be run in parallel /// to speed up the certificate creation process: /// </para> /// /// <para> /// $ ls my-csr-directory/ | xargs -P 10 -I {} aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/{} /// </para> /// /// <para> /// On Windows PowerShell, the command to create certificates for all CSRs in my-csr-directory /// is: /// </para> /// /// <para> /// &gt; ls -Name my-csr-directory | %{aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/$_} /// </para> /// /// <para> /// On a Windows command prompt, the command to create certificates for all CSRs in my-csr-directory /// is: /// </para> /// /// <para> /// &gt; forfiles /p my-csr-directory /c "cmd /c aws iot create-certificate-from-csr --certificate-signing-request /// file://@path" /// </para> /// </summary> /// <param name="certificateSigningRequest">The certificate signing request (CSR).</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 CreateCertificateFromCsr service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateCertificateFromCsr">REST API Reference for CreateCertificateFromCsr Operation</seealso> public virtual Task<CreateCertificateFromCsrResponse> CreateCertificateFromCsrAsync(string certificateSigningRequest, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new CreateCertificateFromCsrRequest(); request.CertificateSigningRequest = certificateSigningRequest; return CreateCertificateFromCsrAsync(request, cancellationToken); } /// <summary> /// Creates an X.509 certificate using the specified certificate signing request. /// /// /// <para> /// <b>Note:</b> The CSR must include a public key that is either an RSA key with a length /// of at least 2048 bits or an ECC key from NIST P-256 or NIST P-384 curves. /// </para> /// /// <para> /// <b>Note:</b> Reusing the same certificate signing request (CSR) results in a distinct /// certificate. /// </para> /// /// <para> /// You can create multiple certificates in a batch by creating a directory, copying multiple /// .csr files into that directory, and then specifying that directory on the command /// line. The following commands show how to create a batch of certificates given a batch /// of CSRs. /// </para> /// /// <para> /// Assuming a set of CSRs are located inside of the directory my-csr-directory: /// </para> /// /// <para> /// On Linux and OS X, the command is: /// </para> /// /// <para> /// $ ls my-csr-directory/ | xargs -I {} aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/{} /// </para> /// /// <para> /// This command lists all of the CSRs in my-csr-directory and pipes each CSR file name /// to the aws iot create-certificate-from-csr AWS CLI command to create a certificate /// for the corresponding CSR. /// </para> /// /// <para> /// The aws iot create-certificate-from-csr part of the command can also be run in parallel /// to speed up the certificate creation process: /// </para> /// /// <para> /// $ ls my-csr-directory/ | xargs -P 10 -I {} aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/{} /// </para> /// /// <para> /// On Windows PowerShell, the command to create certificates for all CSRs in my-csr-directory /// is: /// </para> /// /// <para> /// &gt; ls -Name my-csr-directory | %{aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/$_} /// </para> /// /// <para> /// On a Windows command prompt, the command to create certificates for all CSRs in my-csr-directory /// is: /// </para> /// /// <para> /// &gt; forfiles /p my-csr-directory /c "cmd /c aws iot create-certificate-from-csr --certificate-signing-request /// file://@path" /// </para> /// </summary> /// <param name="certificateSigningRequest">The certificate signing request (CSR).</param> /// <param name="setAsActive">Specifies whether the certificate is active.</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 CreateCertificateFromCsr service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateCertificateFromCsr">REST API Reference for CreateCertificateFromCsr Operation</seealso> public virtual Task<CreateCertificateFromCsrResponse> CreateCertificateFromCsrAsync(string certificateSigningRequest, bool setAsActive, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new CreateCertificateFromCsrRequest(); request.CertificateSigningRequest = certificateSigningRequest; request.SetAsActive = setAsActive; return CreateCertificateFromCsrAsync(request, cancellationToken); } /// <summary> /// Creates an X.509 certificate using the specified certificate signing request. /// /// /// <para> /// <b>Note:</b> The CSR must include a public key that is either an RSA key with a length /// of at least 2048 bits or an ECC key from NIST P-256 or NIST P-384 curves. /// </para> /// /// <para> /// <b>Note:</b> Reusing the same certificate signing request (CSR) results in a distinct /// certificate. /// </para> /// /// <para> /// You can create multiple certificates in a batch by creating a directory, copying multiple /// .csr files into that directory, and then specifying that directory on the command /// line. The following commands show how to create a batch of certificates given a batch /// of CSRs. /// </para> /// /// <para> /// Assuming a set of CSRs are located inside of the directory my-csr-directory: /// </para> /// /// <para> /// On Linux and OS X, the command is: /// </para> /// /// <para> /// $ ls my-csr-directory/ | xargs -I {} aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/{} /// </para> /// /// <para> /// This command lists all of the CSRs in my-csr-directory and pipes each CSR file name /// to the aws iot create-certificate-from-csr AWS CLI command to create a certificate /// for the corresponding CSR. /// </para> /// /// <para> /// The aws iot create-certificate-from-csr part of the command can also be run in parallel /// to speed up the certificate creation process: /// </para> /// /// <para> /// $ ls my-csr-directory/ | xargs -P 10 -I {} aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/{} /// </para> /// /// <para> /// On Windows PowerShell, the command to create certificates for all CSRs in my-csr-directory /// is: /// </para> /// /// <para> /// &gt; ls -Name my-csr-directory | %{aws iot create-certificate-from-csr --certificate-signing-request /// file://my-csr-directory/$_} /// </para> /// /// <para> /// On a Windows command prompt, the command to create certificates for all CSRs in my-csr-directory /// is: /// </para> /// /// <para> /// &gt; forfiles /p my-csr-directory /c "cmd /c aws iot create-certificate-from-csr --certificate-signing-request /// file://@path" /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateCertificateFromCsr 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 CreateCertificateFromCsr service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateCertificateFromCsr">REST API Reference for CreateCertificateFromCsr Operation</seealso> public virtual Task<CreateCertificateFromCsrResponse> CreateCertificateFromCsrAsync(CreateCertificateFromCsrRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateCertificateFromCsrRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateCertificateFromCsrResponseUnmarshaller.Instance; return InvokeAsync<CreateCertificateFromCsrResponse>(request, options, cancellationToken); } #endregion #region CreateDimension /// <summary> /// Create a dimension that you can use to limit the scope of a metric used in a security /// profile for AWS IoT Device Defender. For example, using a <code>TOPIC_FILTER</code> /// dimension, you can narrow down the scope of the metric only to MQTT topics whose name /// match the pattern specified in the dimension. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateDimension service method.</param> /// /// <returns>The response from the CreateDimension service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateDimension">REST API Reference for CreateDimension Operation</seealso> public virtual CreateDimensionResponse CreateDimension(CreateDimensionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateDimensionRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateDimensionResponseUnmarshaller.Instance; return Invoke<CreateDimensionResponse>(request, options); } /// <summary> /// Create a dimension that you can use to limit the scope of a metric used in a security /// profile for AWS IoT Device Defender. For example, using a <code>TOPIC_FILTER</code> /// dimension, you can narrow down the scope of the metric only to MQTT topics whose name /// match the pattern specified in the dimension. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateDimension 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 CreateDimension service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateDimension">REST API Reference for CreateDimension Operation</seealso> public virtual Task<CreateDimensionResponse> CreateDimensionAsync(CreateDimensionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateDimensionRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateDimensionResponseUnmarshaller.Instance; return InvokeAsync<CreateDimensionResponse>(request, options, cancellationToken); } #endregion #region CreateDomainConfiguration /// <summary> /// Creates a domain configuration. /// /// <note> /// <para> /// The domain configuration feature is in public preview and is subject to change. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateDomainConfiguration service method.</param> /// /// <returns>The response from the CreateDomainConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateValidationException"> /// The certificate is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateDomainConfiguration">REST API Reference for CreateDomainConfiguration Operation</seealso> public virtual CreateDomainConfigurationResponse CreateDomainConfiguration(CreateDomainConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateDomainConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateDomainConfigurationResponseUnmarshaller.Instance; return Invoke<CreateDomainConfigurationResponse>(request, options); } /// <summary> /// Creates a domain configuration. /// /// <note> /// <para> /// The domain configuration feature is in public preview and is subject to change. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateDomainConfiguration 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 CreateDomainConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateValidationException"> /// The certificate is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateDomainConfiguration">REST API Reference for CreateDomainConfiguration Operation</seealso> public virtual Task<CreateDomainConfigurationResponse> CreateDomainConfigurationAsync(CreateDomainConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateDomainConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateDomainConfigurationResponseUnmarshaller.Instance; return InvokeAsync<CreateDomainConfigurationResponse>(request, options, cancellationToken); } #endregion #region CreateDynamicThingGroup /// <summary> /// Creates a dynamic thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateDynamicThingGroup service method.</param> /// /// <returns>The response from the CreateDynamicThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidQueryException"> /// The query is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateDynamicThingGroup">REST API Reference for CreateDynamicThingGroup Operation</seealso> public virtual CreateDynamicThingGroupResponse CreateDynamicThingGroup(CreateDynamicThingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateDynamicThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateDynamicThingGroupResponseUnmarshaller.Instance; return Invoke<CreateDynamicThingGroupResponse>(request, options); } /// <summary> /// Creates a dynamic thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateDynamicThingGroup 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 CreateDynamicThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidQueryException"> /// The query is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateDynamicThingGroup">REST API Reference for CreateDynamicThingGroup Operation</seealso> public virtual Task<CreateDynamicThingGroupResponse> CreateDynamicThingGroupAsync(CreateDynamicThingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateDynamicThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateDynamicThingGroupResponseUnmarshaller.Instance; return InvokeAsync<CreateDynamicThingGroupResponse>(request, options, cancellationToken); } #endregion #region CreateJob /// <summary> /// Creates a job. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateJob service method.</param> /// /// <returns>The response from the CreateJob service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateJob">REST API Reference for CreateJob Operation</seealso> public virtual CreateJobResponse CreateJob(CreateJobRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateJobRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateJobResponseUnmarshaller.Instance; return Invoke<CreateJobResponse>(request, options); } /// <summary> /// Creates a job. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateJob service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateJob service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateJob">REST API Reference for CreateJob Operation</seealso> public virtual Task<CreateJobResponse> CreateJobAsync(CreateJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateJobRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateJobResponseUnmarshaller.Instance; return InvokeAsync<CreateJobResponse>(request, options, cancellationToken); } #endregion #region CreateKeysAndCertificate /// <summary> /// Creates a 2048-bit RSA key pair and issues an X.509 certificate using the issued public /// key. You can also call <code>CreateKeysAndCertificate</code> over MQTT from a device, /// for more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#provision-mqtt-api">Provisioning /// MQTT API</a>. /// /// /// <para> /// <b>Note</b> This is the only time AWS IoT issues the private key for this certificate, /// so it is important to keep it in a secure location. /// </para> /// </summary> /// /// <returns>The response from the CreateKeysAndCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateKeysAndCertificate">REST API Reference for CreateKeysAndCertificate Operation</seealso> public virtual CreateKeysAndCertificateResponse CreateKeysAndCertificate() { var request = new CreateKeysAndCertificateRequest(); return CreateKeysAndCertificate(request); } /// <summary> /// Creates a 2048-bit RSA key pair and issues an X.509 certificate using the issued public /// key. You can also call <code>CreateKeysAndCertificate</code> over MQTT from a device, /// for more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#provision-mqtt-api">Provisioning /// MQTT API</a>. /// /// /// <para> /// <b>Note</b> This is the only time AWS IoT issues the private key for this certificate, /// so it is important to keep it in a secure location. /// </para> /// </summary> /// <param name="setAsActive">Specifies whether the certificate is active.</param> /// /// <returns>The response from the CreateKeysAndCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateKeysAndCertificate">REST API Reference for CreateKeysAndCertificate Operation</seealso> public virtual CreateKeysAndCertificateResponse CreateKeysAndCertificate(bool setAsActive) { var request = new CreateKeysAndCertificateRequest(); request.SetAsActive = setAsActive; return CreateKeysAndCertificate(request); } /// <summary> /// Creates a 2048-bit RSA key pair and issues an X.509 certificate using the issued public /// key. You can also call <code>CreateKeysAndCertificate</code> over MQTT from a device, /// for more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#provision-mqtt-api">Provisioning /// MQTT API</a>. /// /// /// <para> /// <b>Note</b> This is the only time AWS IoT issues the private key for this certificate, /// so it is important to keep it in a secure location. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateKeysAndCertificate service method.</param> /// /// <returns>The response from the CreateKeysAndCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateKeysAndCertificate">REST API Reference for CreateKeysAndCertificate Operation</seealso> public virtual CreateKeysAndCertificateResponse CreateKeysAndCertificate(CreateKeysAndCertificateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateKeysAndCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateKeysAndCertificateResponseUnmarshaller.Instance; return Invoke<CreateKeysAndCertificateResponse>(request, options); } /// <summary> /// Creates a 2048-bit RSA key pair and issues an X.509 certificate using the issued public /// key. You can also call <code>CreateKeysAndCertificate</code> over MQTT from a device, /// for more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#provision-mqtt-api">Provisioning /// MQTT API</a>. /// /// /// <para> /// <b>Note</b> This is the only time AWS IoT issues the private key for this certificate, /// so it is important to keep it in a secure location. /// </para> /// </summary> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateKeysAndCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateKeysAndCertificate">REST API Reference for CreateKeysAndCertificate Operation</seealso> public virtual Task<CreateKeysAndCertificateResponse> CreateKeysAndCertificateAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new CreateKeysAndCertificateRequest(); return CreateKeysAndCertificateAsync(request, cancellationToken); } /// <summary> /// Creates a 2048-bit RSA key pair and issues an X.509 certificate using the issued public /// key. You can also call <code>CreateKeysAndCertificate</code> over MQTT from a device, /// for more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#provision-mqtt-api">Provisioning /// MQTT API</a>. /// /// /// <para> /// <b>Note</b> This is the only time AWS IoT issues the private key for this certificate, /// so it is important to keep it in a secure location. /// </para> /// </summary> /// <param name="setAsActive">Specifies whether the certificate is active.</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 CreateKeysAndCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateKeysAndCertificate">REST API Reference for CreateKeysAndCertificate Operation</seealso> public virtual Task<CreateKeysAndCertificateResponse> CreateKeysAndCertificateAsync(bool setAsActive, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new CreateKeysAndCertificateRequest(); request.SetAsActive = setAsActive; return CreateKeysAndCertificateAsync(request, cancellationToken); } /// <summary> /// Creates a 2048-bit RSA key pair and issues an X.509 certificate using the issued public /// key. You can also call <code>CreateKeysAndCertificate</code> over MQTT from a device, /// for more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#provision-mqtt-api">Provisioning /// MQTT API</a>. /// /// /// <para> /// <b>Note</b> This is the only time AWS IoT issues the private key for this certificate, /// so it is important to keep it in a secure location. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateKeysAndCertificate 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 CreateKeysAndCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateKeysAndCertificate">REST API Reference for CreateKeysAndCertificate Operation</seealso> public virtual Task<CreateKeysAndCertificateResponse> CreateKeysAndCertificateAsync(CreateKeysAndCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateKeysAndCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateKeysAndCertificateResponseUnmarshaller.Instance; return InvokeAsync<CreateKeysAndCertificateResponse>(request, options, cancellationToken); } #endregion #region CreateMitigationAction /// <summary> /// Defines an action that can be applied to audit findings by using StartAuditMitigationActionsTask. /// Only certain types of mitigation actions can be applied to specific check names. For /// more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/device-defender-mitigation-actions.html">Mitigation /// actions</a>. Each mitigation action can apply only one type of change. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateMitigationAction service method.</param> /// /// <returns>The response from the CreateMitigationAction service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateMitigationAction">REST API Reference for CreateMitigationAction Operation</seealso> public virtual CreateMitigationActionResponse CreateMitigationAction(CreateMitigationActionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateMitigationActionRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateMitigationActionResponseUnmarshaller.Instance; return Invoke<CreateMitigationActionResponse>(request, options); } /// <summary> /// Defines an action that can be applied to audit findings by using StartAuditMitigationActionsTask. /// Only certain types of mitigation actions can be applied to specific check names. For /// more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/device-defender-mitigation-actions.html">Mitigation /// actions</a>. Each mitigation action can apply only one type of change. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateMitigationAction 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 CreateMitigationAction service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateMitigationAction">REST API Reference for CreateMitigationAction Operation</seealso> public virtual Task<CreateMitigationActionResponse> CreateMitigationActionAsync(CreateMitigationActionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateMitigationActionRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateMitigationActionResponseUnmarshaller.Instance; return InvokeAsync<CreateMitigationActionResponse>(request, options, cancellationToken); } #endregion #region CreateOTAUpdate /// <summary> /// Creates an AWS IoT OTAUpdate on a target group of things or groups. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateOTAUpdate service method.</param> /// /// <returns>The response from the CreateOTAUpdate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateOTAUpdate">REST API Reference for CreateOTAUpdate Operation</seealso> public virtual CreateOTAUpdateResponse CreateOTAUpdate(CreateOTAUpdateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateOTAUpdateRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateOTAUpdateResponseUnmarshaller.Instance; return Invoke<CreateOTAUpdateResponse>(request, options); } /// <summary> /// Creates an AWS IoT OTAUpdate on a target group of things or groups. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateOTAUpdate 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 CreateOTAUpdate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateOTAUpdate">REST API Reference for CreateOTAUpdate Operation</seealso> public virtual Task<CreateOTAUpdateResponse> CreateOTAUpdateAsync(CreateOTAUpdateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateOTAUpdateRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateOTAUpdateResponseUnmarshaller.Instance; return InvokeAsync<CreateOTAUpdateResponse>(request, options, cancellationToken); } #endregion #region CreatePolicy /// <summary> /// Creates an AWS IoT policy. /// /// /// <para> /// The created policy is the default version for the policy. This operation creates a /// policy version with a version identifier of <b>1</b> and sets <b>1</b> as the policy's /// default version. /// </para> /// </summary> /// <param name="policyName">The policy name.</param> /// <param name="policyDocument">The JSON document that describes the policy. <b>policyDocument</b> must have a minimum length of 1, with a maximum length of 2048, excluding whitespace.</param> /// /// <returns>The response from the CreatePolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.MalformedPolicyException"> /// The policy documentation is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreatePolicy">REST API Reference for CreatePolicy Operation</seealso> public virtual CreatePolicyResponse CreatePolicy(string policyName, string policyDocument) { var request = new CreatePolicyRequest(); request.PolicyName = policyName; request.PolicyDocument = policyDocument; return CreatePolicy(request); } /// <summary> /// Creates an AWS IoT policy. /// /// /// <para> /// The created policy is the default version for the policy. This operation creates a /// policy version with a version identifier of <b>1</b> and sets <b>1</b> as the policy's /// default version. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreatePolicy service method.</param> /// /// <returns>The response from the CreatePolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.MalformedPolicyException"> /// The policy documentation is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreatePolicy">REST API Reference for CreatePolicy Operation</seealso> public virtual CreatePolicyResponse CreatePolicy(CreatePolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreatePolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = CreatePolicyResponseUnmarshaller.Instance; return Invoke<CreatePolicyResponse>(request, options); } /// <summary> /// Creates an AWS IoT policy. /// /// /// <para> /// The created policy is the default version for the policy. This operation creates a /// policy version with a version identifier of <b>1</b> and sets <b>1</b> as the policy's /// default version. /// </para> /// </summary> /// <param name="policyName">The policy name.</param> /// <param name="policyDocument">The JSON document that describes the policy. <b>policyDocument</b> must have a minimum length of 1, with a maximum length of 2048, excluding whitespace.</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 CreatePolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.MalformedPolicyException"> /// The policy documentation is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreatePolicy">REST API Reference for CreatePolicy Operation</seealso> public virtual Task<CreatePolicyResponse> CreatePolicyAsync(string policyName, string policyDocument, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new CreatePolicyRequest(); request.PolicyName = policyName; request.PolicyDocument = policyDocument; return CreatePolicyAsync(request, cancellationToken); } /// <summary> /// Creates an AWS IoT policy. /// /// /// <para> /// The created policy is the default version for the policy. This operation creates a /// policy version with a version identifier of <b>1</b> and sets <b>1</b> as the policy's /// default version. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreatePolicy 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 CreatePolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.MalformedPolicyException"> /// The policy documentation is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreatePolicy">REST API Reference for CreatePolicy Operation</seealso> public virtual Task<CreatePolicyResponse> CreatePolicyAsync(CreatePolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreatePolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = CreatePolicyResponseUnmarshaller.Instance; return InvokeAsync<CreatePolicyResponse>(request, options, cancellationToken); } #endregion #region CreatePolicyVersion /// <summary> /// Creates a new version of the specified AWS IoT policy. To update a policy, create /// a new policy version. A managed policy can have up to five versions. If the policy /// has five versions, you must use <a>DeletePolicyVersion</a> to delete an existing version /// before you create a new one. /// /// /// <para> /// Optionally, you can set the new version as the policy's default version. The default /// version is the operative version (that is, the version that is in effect for the certificates /// to which the policy is attached). /// </para> /// </summary> /// <param name="policyName">The policy name.</param> /// <param name="policyDocument">The JSON document that describes the policy. Minimum length of 1. Maximum length of 2048, excluding whitespace.</param> /// /// <returns>The response from the CreatePolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.MalformedPolicyException"> /// The policy documentation is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionsLimitExceededException"> /// The number of policy versions exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreatePolicyVersion">REST API Reference for CreatePolicyVersion Operation</seealso> public virtual CreatePolicyVersionResponse CreatePolicyVersion(string policyName, string policyDocument) { var request = new CreatePolicyVersionRequest(); request.PolicyName = policyName; request.PolicyDocument = policyDocument; return CreatePolicyVersion(request); } /// <summary> /// Creates a new version of the specified AWS IoT policy. To update a policy, create /// a new policy version. A managed policy can have up to five versions. If the policy /// has five versions, you must use <a>DeletePolicyVersion</a> to delete an existing version /// before you create a new one. /// /// /// <para> /// Optionally, you can set the new version as the policy's default version. The default /// version is the operative version (that is, the version that is in effect for the certificates /// to which the policy is attached). /// </para> /// </summary> /// <param name="policyName">The policy name.</param> /// <param name="policyDocument">The JSON document that describes the policy. Minimum length of 1. Maximum length of 2048, excluding whitespace.</param> /// <param name="setAsDefault">Specifies whether the policy version is set as the default. When this parameter is true, the new policy version becomes the operative version (that is, the version that is in effect for the certificates to which the policy is attached).</param> /// /// <returns>The response from the CreatePolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.MalformedPolicyException"> /// The policy documentation is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionsLimitExceededException"> /// The number of policy versions exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreatePolicyVersion">REST API Reference for CreatePolicyVersion Operation</seealso> public virtual CreatePolicyVersionResponse CreatePolicyVersion(string policyName, string policyDocument, bool setAsDefault) { var request = new CreatePolicyVersionRequest(); request.PolicyName = policyName; request.PolicyDocument = policyDocument; request.SetAsDefault = setAsDefault; return CreatePolicyVersion(request); } /// <summary> /// Creates a new version of the specified AWS IoT policy. To update a policy, create /// a new policy version. A managed policy can have up to five versions. If the policy /// has five versions, you must use <a>DeletePolicyVersion</a> to delete an existing version /// before you create a new one. /// /// /// <para> /// Optionally, you can set the new version as the policy's default version. The default /// version is the operative version (that is, the version that is in effect for the certificates /// to which the policy is attached). /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreatePolicyVersion service method.</param> /// /// <returns>The response from the CreatePolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.MalformedPolicyException"> /// The policy documentation is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionsLimitExceededException"> /// The number of policy versions exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreatePolicyVersion">REST API Reference for CreatePolicyVersion Operation</seealso> public virtual CreatePolicyVersionResponse CreatePolicyVersion(CreatePolicyVersionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreatePolicyVersionRequestMarshaller.Instance; options.ResponseUnmarshaller = CreatePolicyVersionResponseUnmarshaller.Instance; return Invoke<CreatePolicyVersionResponse>(request, options); } /// <summary> /// Creates a new version of the specified AWS IoT policy. To update a policy, create /// a new policy version. A managed policy can have up to five versions. If the policy /// has five versions, you must use <a>DeletePolicyVersion</a> to delete an existing version /// before you create a new one. /// /// /// <para> /// Optionally, you can set the new version as the policy's default version. The default /// version is the operative version (that is, the version that is in effect for the certificates /// to which the policy is attached). /// </para> /// </summary> /// <param name="policyName">The policy name.</param> /// <param name="policyDocument">The JSON document that describes the policy. Minimum length of 1. Maximum length of 2048, excluding whitespace.</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 CreatePolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.MalformedPolicyException"> /// The policy documentation is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionsLimitExceededException"> /// The number of policy versions exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreatePolicyVersion">REST API Reference for CreatePolicyVersion Operation</seealso> public virtual Task<CreatePolicyVersionResponse> CreatePolicyVersionAsync(string policyName, string policyDocument, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new CreatePolicyVersionRequest(); request.PolicyName = policyName; request.PolicyDocument = policyDocument; return CreatePolicyVersionAsync(request, cancellationToken); } /// <summary> /// Creates a new version of the specified AWS IoT policy. To update a policy, create /// a new policy version. A managed policy can have up to five versions. If the policy /// has five versions, you must use <a>DeletePolicyVersion</a> to delete an existing version /// before you create a new one. /// /// /// <para> /// Optionally, you can set the new version as the policy's default version. The default /// version is the operative version (that is, the version that is in effect for the certificates /// to which the policy is attached). /// </para> /// </summary> /// <param name="policyName">The policy name.</param> /// <param name="policyDocument">The JSON document that describes the policy. Minimum length of 1. Maximum length of 2048, excluding whitespace.</param> /// <param name="setAsDefault">Specifies whether the policy version is set as the default. When this parameter is true, the new policy version becomes the operative version (that is, the version that is in effect for the certificates to which the policy is attached).</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 CreatePolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.MalformedPolicyException"> /// The policy documentation is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionsLimitExceededException"> /// The number of policy versions exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreatePolicyVersion">REST API Reference for CreatePolicyVersion Operation</seealso> public virtual Task<CreatePolicyVersionResponse> CreatePolicyVersionAsync(string policyName, string policyDocument, bool setAsDefault, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new CreatePolicyVersionRequest(); request.PolicyName = policyName; request.PolicyDocument = policyDocument; request.SetAsDefault = setAsDefault; return CreatePolicyVersionAsync(request, cancellationToken); } /// <summary> /// Creates a new version of the specified AWS IoT policy. To update a policy, create /// a new policy version. A managed policy can have up to five versions. If the policy /// has five versions, you must use <a>DeletePolicyVersion</a> to delete an existing version /// before you create a new one. /// /// /// <para> /// Optionally, you can set the new version as the policy's default version. The default /// version is the operative version (that is, the version that is in effect for the certificates /// to which the policy is attached). /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreatePolicyVersion 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 CreatePolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.MalformedPolicyException"> /// The policy documentation is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionsLimitExceededException"> /// The number of policy versions exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreatePolicyVersion">REST API Reference for CreatePolicyVersion Operation</seealso> public virtual Task<CreatePolicyVersionResponse> CreatePolicyVersionAsync(CreatePolicyVersionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreatePolicyVersionRequestMarshaller.Instance; options.ResponseUnmarshaller = CreatePolicyVersionResponseUnmarshaller.Instance; return InvokeAsync<CreatePolicyVersionResponse>(request, options, cancellationToken); } #endregion #region CreateProvisioningClaim /// <summary> /// Creates a provisioning claim. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateProvisioningClaim service method.</param> /// /// <returns>The response from the CreateProvisioningClaim service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateProvisioningClaim">REST API Reference for CreateProvisioningClaim Operation</seealso> public virtual CreateProvisioningClaimResponse CreateProvisioningClaim(CreateProvisioningClaimRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateProvisioningClaimRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateProvisioningClaimResponseUnmarshaller.Instance; return Invoke<CreateProvisioningClaimResponse>(request, options); } /// <summary> /// Creates a provisioning claim. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateProvisioningClaim 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 CreateProvisioningClaim service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateProvisioningClaim">REST API Reference for CreateProvisioningClaim Operation</seealso> public virtual Task<CreateProvisioningClaimResponse> CreateProvisioningClaimAsync(CreateProvisioningClaimRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateProvisioningClaimRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateProvisioningClaimResponseUnmarshaller.Instance; return InvokeAsync<CreateProvisioningClaimResponse>(request, options, cancellationToken); } #endregion #region CreateProvisioningTemplate /// <summary> /// Creates a fleet provisioning template. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateProvisioningTemplate service method.</param> /// /// <returns>The response from the CreateProvisioningTemplate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateProvisioningTemplate">REST API Reference for CreateProvisioningTemplate Operation</seealso> public virtual CreateProvisioningTemplateResponse CreateProvisioningTemplate(CreateProvisioningTemplateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateProvisioningTemplateRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateProvisioningTemplateResponseUnmarshaller.Instance; return Invoke<CreateProvisioningTemplateResponse>(request, options); } /// <summary> /// Creates a fleet provisioning template. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateProvisioningTemplate 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 CreateProvisioningTemplate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateProvisioningTemplate">REST API Reference for CreateProvisioningTemplate Operation</seealso> public virtual Task<CreateProvisioningTemplateResponse> CreateProvisioningTemplateAsync(CreateProvisioningTemplateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateProvisioningTemplateRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateProvisioningTemplateResponseUnmarshaller.Instance; return InvokeAsync<CreateProvisioningTemplateResponse>(request, options, cancellationToken); } #endregion #region CreateProvisioningTemplateVersion /// <summary> /// Creates a new version of a fleet provisioning template. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateProvisioningTemplateVersion service method.</param> /// /// <returns>The response from the CreateProvisioningTemplateVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionsLimitExceededException"> /// The number of policy versions exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateProvisioningTemplateVersion">REST API Reference for CreateProvisioningTemplateVersion Operation</seealso> public virtual CreateProvisioningTemplateVersionResponse CreateProvisioningTemplateVersion(CreateProvisioningTemplateVersionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateProvisioningTemplateVersionRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateProvisioningTemplateVersionResponseUnmarshaller.Instance; return Invoke<CreateProvisioningTemplateVersionResponse>(request, options); } /// <summary> /// Creates a new version of a fleet provisioning template. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateProvisioningTemplateVersion 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 CreateProvisioningTemplateVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionsLimitExceededException"> /// The number of policy versions exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateProvisioningTemplateVersion">REST API Reference for CreateProvisioningTemplateVersion Operation</seealso> public virtual Task<CreateProvisioningTemplateVersionResponse> CreateProvisioningTemplateVersionAsync(CreateProvisioningTemplateVersionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateProvisioningTemplateVersionRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateProvisioningTemplateVersionResponseUnmarshaller.Instance; return InvokeAsync<CreateProvisioningTemplateVersionResponse>(request, options, cancellationToken); } #endregion #region CreateRoleAlias /// <summary> /// Creates a role alias. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateRoleAlias service method.</param> /// /// <returns>The response from the CreateRoleAlias service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateRoleAlias">REST API Reference for CreateRoleAlias Operation</seealso> public virtual CreateRoleAliasResponse CreateRoleAlias(CreateRoleAliasRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateRoleAliasRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateRoleAliasResponseUnmarshaller.Instance; return Invoke<CreateRoleAliasResponse>(request, options); } /// <summary> /// Creates a role alias. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateRoleAlias 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 CreateRoleAlias service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateRoleAlias">REST API Reference for CreateRoleAlias Operation</seealso> public virtual Task<CreateRoleAliasResponse> CreateRoleAliasAsync(CreateRoleAliasRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateRoleAliasRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateRoleAliasResponseUnmarshaller.Instance; return InvokeAsync<CreateRoleAliasResponse>(request, options, cancellationToken); } #endregion #region CreateScheduledAudit /// <summary> /// Creates a scheduled audit that is run at a specified time interval. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateScheduledAudit service method.</param> /// /// <returns>The response from the CreateScheduledAudit service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateScheduledAudit">REST API Reference for CreateScheduledAudit Operation</seealso> public virtual CreateScheduledAuditResponse CreateScheduledAudit(CreateScheduledAuditRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateScheduledAuditRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateScheduledAuditResponseUnmarshaller.Instance; return Invoke<CreateScheduledAuditResponse>(request, options); } /// <summary> /// Creates a scheduled audit that is run at a specified time interval. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateScheduledAudit 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 CreateScheduledAudit service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateScheduledAudit">REST API Reference for CreateScheduledAudit Operation</seealso> public virtual Task<CreateScheduledAuditResponse> CreateScheduledAuditAsync(CreateScheduledAuditRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateScheduledAuditRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateScheduledAuditResponseUnmarshaller.Instance; return InvokeAsync<CreateScheduledAuditResponse>(request, options, cancellationToken); } #endregion #region CreateSecurityProfile /// <summary> /// Creates a Device Defender security profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateSecurityProfile service method.</param> /// /// <returns>The response from the CreateSecurityProfile service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateSecurityProfile">REST API Reference for CreateSecurityProfile Operation</seealso> public virtual CreateSecurityProfileResponse CreateSecurityProfile(CreateSecurityProfileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateSecurityProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateSecurityProfileResponseUnmarshaller.Instance; return Invoke<CreateSecurityProfileResponse>(request, options); } /// <summary> /// Creates a Device Defender security profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateSecurityProfile 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 CreateSecurityProfile service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateSecurityProfile">REST API Reference for CreateSecurityProfile Operation</seealso> public virtual Task<CreateSecurityProfileResponse> CreateSecurityProfileAsync(CreateSecurityProfileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateSecurityProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateSecurityProfileResponseUnmarshaller.Instance; return InvokeAsync<CreateSecurityProfileResponse>(request, options, cancellationToken); } #endregion #region CreateStream /// <summary> /// Creates a stream for delivering one or more large files in chunks over MQTT. A stream /// transports data bytes in chunks or blocks packaged as MQTT messages from a source /// like S3. You can have one or more files associated with a stream. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateStream service method.</param> /// /// <returns>The response from the CreateStream service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateStream">REST API Reference for CreateStream Operation</seealso> public virtual CreateStreamResponse CreateStream(CreateStreamRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateStreamRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateStreamResponseUnmarshaller.Instance; return Invoke<CreateStreamResponse>(request, options); } /// <summary> /// Creates a stream for delivering one or more large files in chunks over MQTT. A stream /// transports data bytes in chunks or blocks packaged as MQTT messages from a source /// like S3. You can have one or more files associated with a stream. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateStream 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 CreateStream service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateStream">REST API Reference for CreateStream Operation</seealso> public virtual Task<CreateStreamResponse> CreateStreamAsync(CreateStreamRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateStreamRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateStreamResponseUnmarshaller.Instance; return InvokeAsync<CreateStreamResponse>(request, options, cancellationToken); } #endregion #region CreateThing /// <summary> /// Creates a thing record in the registry. If this call is made multiple times using /// the same thing name and configuration, the call will succeed. If this call is made /// with the same thing name but different configuration a <code>ResourceAlreadyExistsException</code> /// is thrown. /// /// <note> /// <para> /// This is a control plane operation. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-authorization.html">Authorization</a> /// for information about authorizing control plane actions. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateThing service method.</param> /// /// <returns>The response from the CreateThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateThing">REST API Reference for CreateThing Operation</seealso> public virtual CreateThingResponse CreateThing(CreateThingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateThingRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateThingResponseUnmarshaller.Instance; return Invoke<CreateThingResponse>(request, options); } /// <summary> /// Creates a thing record in the registry. If this call is made multiple times using /// the same thing name and configuration, the call will succeed. If this call is made /// with the same thing name but different configuration a <code>ResourceAlreadyExistsException</code> /// is thrown. /// /// <note> /// <para> /// This is a control plane operation. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-authorization.html">Authorization</a> /// for information about authorizing control plane actions. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateThing 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 CreateThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateThing">REST API Reference for CreateThing Operation</seealso> public virtual Task<CreateThingResponse> CreateThingAsync(CreateThingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateThingRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateThingResponseUnmarshaller.Instance; return InvokeAsync<CreateThingResponse>(request, options, cancellationToken); } #endregion #region CreateThingGroup /// <summary> /// Create a thing group. /// /// <note> /// <para> /// This is a control plane operation. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-authorization.html">Authorization</a> /// for information about authorizing control plane actions. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateThingGroup service method.</param> /// /// <returns>The response from the CreateThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateThingGroup">REST API Reference for CreateThingGroup Operation</seealso> public virtual CreateThingGroupResponse CreateThingGroup(CreateThingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateThingGroupResponseUnmarshaller.Instance; return Invoke<CreateThingGroupResponse>(request, options); } /// <summary> /// Create a thing group. /// /// <note> /// <para> /// This is a control plane operation. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-authorization.html">Authorization</a> /// for information about authorizing control plane actions. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateThingGroup 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 CreateThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateThingGroup">REST API Reference for CreateThingGroup Operation</seealso> public virtual Task<CreateThingGroupResponse> CreateThingGroupAsync(CreateThingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateThingGroupResponseUnmarshaller.Instance; return InvokeAsync<CreateThingGroupResponse>(request, options, cancellationToken); } #endregion #region CreateThingType /// <summary> /// Creates a new thing type. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateThingType service method.</param> /// /// <returns>The response from the CreateThingType service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateThingType">REST API Reference for CreateThingType Operation</seealso> public virtual CreateThingTypeResponse CreateThingType(CreateThingTypeRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateThingTypeRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateThingTypeResponseUnmarshaller.Instance; return Invoke<CreateThingTypeResponse>(request, options); } /// <summary> /// Creates a new thing type. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateThingType 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 CreateThingType service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateThingType">REST API Reference for CreateThingType Operation</seealso> public virtual Task<CreateThingTypeResponse> CreateThingTypeAsync(CreateThingTypeRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateThingTypeRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateThingTypeResponseUnmarshaller.Instance; return InvokeAsync<CreateThingTypeResponse>(request, options, cancellationToken); } #endregion #region CreateTopicRule /// <summary> /// Creates a rule. Creating rules is an administrator-level action. Any user who has /// permission to create rules will be able to access data processed by the rule. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateTopicRule service method.</param> /// /// <returns>The response from the CreateTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.SqlParseException"> /// The Rule-SQL expression can't be parsed correctly. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateTopicRule">REST API Reference for CreateTopicRule Operation</seealso> public virtual CreateTopicRuleResponse CreateTopicRule(CreateTopicRuleRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateTopicRuleRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateTopicRuleResponseUnmarshaller.Instance; return Invoke<CreateTopicRuleResponse>(request, options); } /// <summary> /// Creates a rule. Creating rules is an administrator-level action. Any user who has /// permission to create rules will be able to access data processed by the rule. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateTopicRule 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 CreateTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.SqlParseException"> /// The Rule-SQL expression can't be parsed correctly. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateTopicRule">REST API Reference for CreateTopicRule Operation</seealso> public virtual Task<CreateTopicRuleResponse> CreateTopicRuleAsync(CreateTopicRuleRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateTopicRuleRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateTopicRuleResponseUnmarshaller.Instance; return InvokeAsync<CreateTopicRuleResponse>(request, options, cancellationToken); } #endregion #region CreateTopicRuleDestination /// <summary> /// Creates a topic rule destination. The destination must be confirmed prior to use. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateTopicRuleDestination service method.</param> /// /// <returns>The response from the CreateTopicRuleDestination service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateTopicRuleDestination">REST API Reference for CreateTopicRuleDestination Operation</seealso> public virtual CreateTopicRuleDestinationResponse CreateTopicRuleDestination(CreateTopicRuleDestinationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateTopicRuleDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateTopicRuleDestinationResponseUnmarshaller.Instance; return Invoke<CreateTopicRuleDestinationResponse>(request, options); } /// <summary> /// Creates a topic rule destination. The destination must be confirmed prior to use. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateTopicRuleDestination 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 CreateTopicRuleDestination service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/CreateTopicRuleDestination">REST API Reference for CreateTopicRuleDestination Operation</seealso> public virtual Task<CreateTopicRuleDestinationResponse> CreateTopicRuleDestinationAsync(CreateTopicRuleDestinationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateTopicRuleDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateTopicRuleDestinationResponseUnmarshaller.Instance; return InvokeAsync<CreateTopicRuleDestinationResponse>(request, options, cancellationToken); } #endregion #region DeleteAccountAuditConfiguration /// <summary> /// Restores the default settings for Device Defender audits for this account. Any configuration /// data you entered is deleted and all audit checks are reset to disabled. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteAccountAuditConfiguration service method.</param> /// /// <returns>The response from the DeleteAccountAuditConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteAccountAuditConfiguration">REST API Reference for DeleteAccountAuditConfiguration Operation</seealso> public virtual DeleteAccountAuditConfigurationResponse DeleteAccountAuditConfiguration(DeleteAccountAuditConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteAccountAuditConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteAccountAuditConfigurationResponseUnmarshaller.Instance; return Invoke<DeleteAccountAuditConfigurationResponse>(request, options); } /// <summary> /// Restores the default settings for Device Defender audits for this account. Any configuration /// data you entered is deleted and all audit checks are reset to disabled. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteAccountAuditConfiguration 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 DeleteAccountAuditConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteAccountAuditConfiguration">REST API Reference for DeleteAccountAuditConfiguration Operation</seealso> public virtual Task<DeleteAccountAuditConfigurationResponse> DeleteAccountAuditConfigurationAsync(DeleteAccountAuditConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteAccountAuditConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteAccountAuditConfigurationResponseUnmarshaller.Instance; return InvokeAsync<DeleteAccountAuditConfigurationResponse>(request, options, cancellationToken); } #endregion #region DeleteAuditSuppression /// <summary> /// Deletes a Device Defender audit suppression. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteAuditSuppression service method.</param> /// /// <returns>The response from the DeleteAuditSuppression service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteAuditSuppression">REST API Reference for DeleteAuditSuppression Operation</seealso> public virtual DeleteAuditSuppressionResponse DeleteAuditSuppression(DeleteAuditSuppressionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteAuditSuppressionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteAuditSuppressionResponseUnmarshaller.Instance; return Invoke<DeleteAuditSuppressionResponse>(request, options); } /// <summary> /// Deletes a Device Defender audit suppression. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteAuditSuppression 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 DeleteAuditSuppression service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteAuditSuppression">REST API Reference for DeleteAuditSuppression Operation</seealso> public virtual Task<DeleteAuditSuppressionResponse> DeleteAuditSuppressionAsync(DeleteAuditSuppressionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteAuditSuppressionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteAuditSuppressionResponseUnmarshaller.Instance; return InvokeAsync<DeleteAuditSuppressionResponse>(request, options, cancellationToken); } #endregion #region DeleteAuthorizer /// <summary> /// Deletes an authorizer. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteAuthorizer service method.</param> /// /// <returns>The response from the DeleteAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteAuthorizer">REST API Reference for DeleteAuthorizer Operation</seealso> public virtual DeleteAuthorizerResponse DeleteAuthorizer(DeleteAuthorizerRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteAuthorizerResponseUnmarshaller.Instance; return Invoke<DeleteAuthorizerResponse>(request, options); } /// <summary> /// Deletes an authorizer. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteAuthorizer 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 DeleteAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteAuthorizer">REST API Reference for DeleteAuthorizer Operation</seealso> public virtual Task<DeleteAuthorizerResponse> DeleteAuthorizerAsync(DeleteAuthorizerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteAuthorizerResponseUnmarshaller.Instance; return InvokeAsync<DeleteAuthorizerResponse>(request, options, cancellationToken); } #endregion #region DeleteBillingGroup /// <summary> /// Deletes the billing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteBillingGroup service method.</param> /// /// <returns>The response from the DeleteBillingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteBillingGroup">REST API Reference for DeleteBillingGroup Operation</seealso> public virtual DeleteBillingGroupResponse DeleteBillingGroup(DeleteBillingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteBillingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteBillingGroupResponseUnmarshaller.Instance; return Invoke<DeleteBillingGroupResponse>(request, options); } /// <summary> /// Deletes the billing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteBillingGroup 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 DeleteBillingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteBillingGroup">REST API Reference for DeleteBillingGroup Operation</seealso> public virtual Task<DeleteBillingGroupResponse> DeleteBillingGroupAsync(DeleteBillingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteBillingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteBillingGroupResponseUnmarshaller.Instance; return InvokeAsync<DeleteBillingGroupResponse>(request, options, cancellationToken); } #endregion #region DeleteCACertificate /// <summary> /// Deletes a registered CA certificate. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteCACertificate service method.</param> /// /// <returns>The response from the DeleteCACertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteCACertificate">REST API Reference for DeleteCACertificate Operation</seealso> public virtual DeleteCACertificateResponse DeleteCACertificate(DeleteCACertificateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteCACertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteCACertificateResponseUnmarshaller.Instance; return Invoke<DeleteCACertificateResponse>(request, options); } /// <summary> /// Deletes a registered CA certificate. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteCACertificate 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 DeleteCACertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteCACertificate">REST API Reference for DeleteCACertificate Operation</seealso> public virtual Task<DeleteCACertificateResponse> DeleteCACertificateAsync(DeleteCACertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteCACertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteCACertificateResponseUnmarshaller.Instance; return InvokeAsync<DeleteCACertificateResponse>(request, options, cancellationToken); } #endregion #region DeleteCertificate /// <summary> /// Deletes the specified certificate. /// /// /// <para> /// A certificate cannot be deleted if it has a policy or IoT thing attached to it or /// if its status is set to ACTIVE. To delete a certificate, first use the <a>DetachPrincipalPolicy</a> /// API to detach all policies. Next, use the <a>UpdateCertificate</a> API to set the /// certificate to the INACTIVE status. /// </para> /// </summary> /// <param name="certificateId">The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</param> /// /// <returns>The response from the DeleteCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteCertificate">REST API Reference for DeleteCertificate Operation</seealso> public virtual DeleteCertificateResponse DeleteCertificate(string certificateId) { var request = new DeleteCertificateRequest(); request.CertificateId = certificateId; return DeleteCertificate(request); } /// <summary> /// Deletes the specified certificate. /// /// /// <para> /// A certificate cannot be deleted if it has a policy or IoT thing attached to it or /// if its status is set to ACTIVE. To delete a certificate, first use the <a>DetachPrincipalPolicy</a> /// API to detach all policies. Next, use the <a>UpdateCertificate</a> API to set the /// certificate to the INACTIVE status. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteCertificate service method.</param> /// /// <returns>The response from the DeleteCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteCertificate">REST API Reference for DeleteCertificate Operation</seealso> public virtual DeleteCertificateResponse DeleteCertificate(DeleteCertificateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteCertificateResponseUnmarshaller.Instance; return Invoke<DeleteCertificateResponse>(request, options); } /// <summary> /// Deletes the specified certificate. /// /// /// <para> /// A certificate cannot be deleted if it has a policy or IoT thing attached to it or /// if its status is set to ACTIVE. To delete a certificate, first use the <a>DetachPrincipalPolicy</a> /// API to detach all policies. Next, use the <a>UpdateCertificate</a> API to set the /// certificate to the INACTIVE status. /// </para> /// </summary> /// <param name="certificateId">The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</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 DeleteCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteCertificate">REST API Reference for DeleteCertificate Operation</seealso> public virtual Task<DeleteCertificateResponse> DeleteCertificateAsync(string certificateId, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DeleteCertificateRequest(); request.CertificateId = certificateId; return DeleteCertificateAsync(request, cancellationToken); } /// <summary> /// Deletes the specified certificate. /// /// /// <para> /// A certificate cannot be deleted if it has a policy or IoT thing attached to it or /// if its status is set to ACTIVE. To delete a certificate, first use the <a>DetachPrincipalPolicy</a> /// API to detach all policies. Next, use the <a>UpdateCertificate</a> API to set the /// certificate to the INACTIVE status. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteCertificate 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 DeleteCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteCertificate">REST API Reference for DeleteCertificate Operation</seealso> public virtual Task<DeleteCertificateResponse> DeleteCertificateAsync(DeleteCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteCertificateResponseUnmarshaller.Instance; return InvokeAsync<DeleteCertificateResponse>(request, options, cancellationToken); } #endregion #region DeleteDimension /// <summary> /// Removes the specified dimension from your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteDimension service method.</param> /// /// <returns>The response from the DeleteDimension service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteDimension">REST API Reference for DeleteDimension Operation</seealso> public virtual DeleteDimensionResponse DeleteDimension(DeleteDimensionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteDimensionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteDimensionResponseUnmarshaller.Instance; return Invoke<DeleteDimensionResponse>(request, options); } /// <summary> /// Removes the specified dimension from your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteDimension 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 DeleteDimension service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteDimension">REST API Reference for DeleteDimension Operation</seealso> public virtual Task<DeleteDimensionResponse> DeleteDimensionAsync(DeleteDimensionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteDimensionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteDimensionResponseUnmarshaller.Instance; return InvokeAsync<DeleteDimensionResponse>(request, options, cancellationToken); } #endregion #region DeleteDomainConfiguration /// <summary> /// Deletes the specified domain configuration. /// /// <note> /// <para> /// The domain configuration feature is in public preview and is subject to change. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteDomainConfiguration service method.</param> /// /// <returns>The response from the DeleteDomainConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteDomainConfiguration">REST API Reference for DeleteDomainConfiguration Operation</seealso> public virtual DeleteDomainConfigurationResponse DeleteDomainConfiguration(DeleteDomainConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteDomainConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteDomainConfigurationResponseUnmarshaller.Instance; return Invoke<DeleteDomainConfigurationResponse>(request, options); } /// <summary> /// Deletes the specified domain configuration. /// /// <note> /// <para> /// The domain configuration feature is in public preview and is subject to change. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteDomainConfiguration 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 DeleteDomainConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteDomainConfiguration">REST API Reference for DeleteDomainConfiguration Operation</seealso> public virtual Task<DeleteDomainConfigurationResponse> DeleteDomainConfigurationAsync(DeleteDomainConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteDomainConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteDomainConfigurationResponseUnmarshaller.Instance; return InvokeAsync<DeleteDomainConfigurationResponse>(request, options, cancellationToken); } #endregion #region DeleteDynamicThingGroup /// <summary> /// Deletes a dynamic thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteDynamicThingGroup service method.</param> /// /// <returns>The response from the DeleteDynamicThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteDynamicThingGroup">REST API Reference for DeleteDynamicThingGroup Operation</seealso> public virtual DeleteDynamicThingGroupResponse DeleteDynamicThingGroup(DeleteDynamicThingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteDynamicThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteDynamicThingGroupResponseUnmarshaller.Instance; return Invoke<DeleteDynamicThingGroupResponse>(request, options); } /// <summary> /// Deletes a dynamic thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteDynamicThingGroup 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 DeleteDynamicThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteDynamicThingGroup">REST API Reference for DeleteDynamicThingGroup Operation</seealso> public virtual Task<DeleteDynamicThingGroupResponse> DeleteDynamicThingGroupAsync(DeleteDynamicThingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteDynamicThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteDynamicThingGroupResponseUnmarshaller.Instance; return InvokeAsync<DeleteDynamicThingGroupResponse>(request, options, cancellationToken); } #endregion #region DeleteJob /// <summary> /// Deletes a job and its related job executions. /// /// /// <para> /// Deleting a job may take time, depending on the number of job executions created for /// the job and various other factors. While the job is being deleted, the status of the /// job will be shown as "DELETION_IN_PROGRESS". Attempting to delete or cancel a job /// whose status is already "DELETION_IN_PROGRESS" will result in an error. /// </para> /// /// <para> /// Only 10 jobs may have status "DELETION_IN_PROGRESS" at the same time, or a LimitExceededException /// will occur. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteJob service method.</param> /// /// <returns>The response from the DeleteJob service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidStateTransitionException"> /// An attempt was made to change to an invalid state, for example by deleting a job or /// a job execution which is "IN_PROGRESS" without setting the <code>force</code> parameter. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteJob">REST API Reference for DeleteJob Operation</seealso> public virtual DeleteJobResponse DeleteJob(DeleteJobRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteJobRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteJobResponseUnmarshaller.Instance; return Invoke<DeleteJobResponse>(request, options); } /// <summary> /// Deletes a job and its related job executions. /// /// /// <para> /// Deleting a job may take time, depending on the number of job executions created for /// the job and various other factors. While the job is being deleted, the status of the /// job will be shown as "DELETION_IN_PROGRESS". Attempting to delete or cancel a job /// whose status is already "DELETION_IN_PROGRESS" will result in an error. /// </para> /// /// <para> /// Only 10 jobs may have status "DELETION_IN_PROGRESS" at the same time, or a LimitExceededException /// will occur. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteJob 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 DeleteJob service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidStateTransitionException"> /// An attempt was made to change to an invalid state, for example by deleting a job or /// a job execution which is "IN_PROGRESS" without setting the <code>force</code> parameter. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteJob">REST API Reference for DeleteJob Operation</seealso> public virtual Task<DeleteJobResponse> DeleteJobAsync(DeleteJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteJobRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteJobResponseUnmarshaller.Instance; return InvokeAsync<DeleteJobResponse>(request, options, cancellationToken); } #endregion #region DeleteJobExecution /// <summary> /// Deletes a job execution. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteJobExecution service method.</param> /// /// <returns>The response from the DeleteJobExecution service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidStateTransitionException"> /// An attempt was made to change to an invalid state, for example by deleting a job or /// a job execution which is "IN_PROGRESS" without setting the <code>force</code> parameter. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteJobExecution">REST API Reference for DeleteJobExecution Operation</seealso> public virtual DeleteJobExecutionResponse DeleteJobExecution(DeleteJobExecutionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteJobExecutionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteJobExecutionResponseUnmarshaller.Instance; return Invoke<DeleteJobExecutionResponse>(request, options); } /// <summary> /// Deletes a job execution. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteJobExecution 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 DeleteJobExecution service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidStateTransitionException"> /// An attempt was made to change to an invalid state, for example by deleting a job or /// a job execution which is "IN_PROGRESS" without setting the <code>force</code> parameter. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteJobExecution">REST API Reference for DeleteJobExecution Operation</seealso> public virtual Task<DeleteJobExecutionResponse> DeleteJobExecutionAsync(DeleteJobExecutionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteJobExecutionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteJobExecutionResponseUnmarshaller.Instance; return InvokeAsync<DeleteJobExecutionResponse>(request, options, cancellationToken); } #endregion #region DeleteMitigationAction /// <summary> /// Deletes a defined mitigation action from your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteMitigationAction service method.</param> /// /// <returns>The response from the DeleteMitigationAction service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteMitigationAction">REST API Reference for DeleteMitigationAction Operation</seealso> public virtual DeleteMitigationActionResponse DeleteMitigationAction(DeleteMitigationActionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteMitigationActionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteMitigationActionResponseUnmarshaller.Instance; return Invoke<DeleteMitigationActionResponse>(request, options); } /// <summary> /// Deletes a defined mitigation action from your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteMitigationAction 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 DeleteMitigationAction service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteMitigationAction">REST API Reference for DeleteMitigationAction Operation</seealso> public virtual Task<DeleteMitigationActionResponse> DeleteMitigationActionAsync(DeleteMitigationActionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteMitigationActionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteMitigationActionResponseUnmarshaller.Instance; return InvokeAsync<DeleteMitigationActionResponse>(request, options, cancellationToken); } #endregion #region DeleteOTAUpdate /// <summary> /// Delete an OTA update. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteOTAUpdate service method.</param> /// /// <returns>The response from the DeleteOTAUpdate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteOTAUpdate">REST API Reference for DeleteOTAUpdate Operation</seealso> public virtual DeleteOTAUpdateResponse DeleteOTAUpdate(DeleteOTAUpdateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteOTAUpdateRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteOTAUpdateResponseUnmarshaller.Instance; return Invoke<DeleteOTAUpdateResponse>(request, options); } /// <summary> /// Delete an OTA update. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteOTAUpdate 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 DeleteOTAUpdate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteOTAUpdate">REST API Reference for DeleteOTAUpdate Operation</seealso> public virtual Task<DeleteOTAUpdateResponse> DeleteOTAUpdateAsync(DeleteOTAUpdateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteOTAUpdateRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteOTAUpdateResponseUnmarshaller.Instance; return InvokeAsync<DeleteOTAUpdateResponse>(request, options, cancellationToken); } #endregion #region DeletePolicy /// <summary> /// Deletes the specified policy. /// /// /// <para> /// A policy cannot be deleted if it has non-default versions or it is attached to any /// certificate. /// </para> /// /// <para> /// To delete a policy, use the DeletePolicyVersion API to delete all non-default versions /// of the policy; use the DetachPrincipalPolicy API to detach the policy from any certificate; /// and then use the DeletePolicy API to delete the policy. /// </para> /// /// <para> /// When a policy is deleted using DeletePolicy, its default version is deleted with it. /// </para> /// </summary> /// <param name="policyName">The name of the policy to delete.</param> /// /// <returns>The response from the DeletePolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeletePolicy">REST API Reference for DeletePolicy Operation</seealso> public virtual DeletePolicyResponse DeletePolicy(string policyName) { var request = new DeletePolicyRequest(); request.PolicyName = policyName; return DeletePolicy(request); } /// <summary> /// Deletes the specified policy. /// /// /// <para> /// A policy cannot be deleted if it has non-default versions or it is attached to any /// certificate. /// </para> /// /// <para> /// To delete a policy, use the DeletePolicyVersion API to delete all non-default versions /// of the policy; use the DetachPrincipalPolicy API to detach the policy from any certificate; /// and then use the DeletePolicy API to delete the policy. /// </para> /// /// <para> /// When a policy is deleted using DeletePolicy, its default version is deleted with it. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeletePolicy service method.</param> /// /// <returns>The response from the DeletePolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeletePolicy">REST API Reference for DeletePolicy Operation</seealso> public virtual DeletePolicyResponse DeletePolicy(DeletePolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeletePolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = DeletePolicyResponseUnmarshaller.Instance; return Invoke<DeletePolicyResponse>(request, options); } /// <summary> /// Deletes the specified policy. /// /// /// <para> /// A policy cannot be deleted if it has non-default versions or it is attached to any /// certificate. /// </para> /// /// <para> /// To delete a policy, use the DeletePolicyVersion API to delete all non-default versions /// of the policy; use the DetachPrincipalPolicy API to detach the policy from any certificate; /// and then use the DeletePolicy API to delete the policy. /// </para> /// /// <para> /// When a policy is deleted using DeletePolicy, its default version is deleted with it. /// </para> /// </summary> /// <param name="policyName">The name of the policy to delete.</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 DeletePolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeletePolicy">REST API Reference for DeletePolicy Operation</seealso> public virtual Task<DeletePolicyResponse> DeletePolicyAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DeletePolicyRequest(); request.PolicyName = policyName; return DeletePolicyAsync(request, cancellationToken); } /// <summary> /// Deletes the specified policy. /// /// /// <para> /// A policy cannot be deleted if it has non-default versions or it is attached to any /// certificate. /// </para> /// /// <para> /// To delete a policy, use the DeletePolicyVersion API to delete all non-default versions /// of the policy; use the DetachPrincipalPolicy API to detach the policy from any certificate; /// and then use the DeletePolicy API to delete the policy. /// </para> /// /// <para> /// When a policy is deleted using DeletePolicy, its default version is deleted with it. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeletePolicy 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 DeletePolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeletePolicy">REST API Reference for DeletePolicy Operation</seealso> public virtual Task<DeletePolicyResponse> DeletePolicyAsync(DeletePolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeletePolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = DeletePolicyResponseUnmarshaller.Instance; return InvokeAsync<DeletePolicyResponse>(request, options, cancellationToken); } #endregion #region DeletePolicyVersion /// <summary> /// Deletes the specified version of the specified policy. You cannot delete the default /// version of a policy using this API. To delete the default version of a policy, use /// <a>DeletePolicy</a>. To find out which version of a policy is marked as the default /// version, use ListPolicyVersions. /// </summary> /// <param name="policyName">The name of the policy.</param> /// <param name="policyVersionId">The policy version ID.</param> /// /// <returns>The response from the DeletePolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeletePolicyVersion">REST API Reference for DeletePolicyVersion Operation</seealso> public virtual DeletePolicyVersionResponse DeletePolicyVersion(string policyName, string policyVersionId) { var request = new DeletePolicyVersionRequest(); request.PolicyName = policyName; request.PolicyVersionId = policyVersionId; return DeletePolicyVersion(request); } /// <summary> /// Deletes the specified version of the specified policy. You cannot delete the default /// version of a policy using this API. To delete the default version of a policy, use /// <a>DeletePolicy</a>. To find out which version of a policy is marked as the default /// version, use ListPolicyVersions. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeletePolicyVersion service method.</param> /// /// <returns>The response from the DeletePolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeletePolicyVersion">REST API Reference for DeletePolicyVersion Operation</seealso> public virtual DeletePolicyVersionResponse DeletePolicyVersion(DeletePolicyVersionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeletePolicyVersionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeletePolicyVersionResponseUnmarshaller.Instance; return Invoke<DeletePolicyVersionResponse>(request, options); } /// <summary> /// Deletes the specified version of the specified policy. You cannot delete the default /// version of a policy using this API. To delete the default version of a policy, use /// <a>DeletePolicy</a>. To find out which version of a policy is marked as the default /// version, use ListPolicyVersions. /// </summary> /// <param name="policyName">The name of the policy.</param> /// <param name="policyVersionId">The policy version ID.</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 DeletePolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeletePolicyVersion">REST API Reference for DeletePolicyVersion Operation</seealso> public virtual Task<DeletePolicyVersionResponse> DeletePolicyVersionAsync(string policyName, string policyVersionId, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DeletePolicyVersionRequest(); request.PolicyName = policyName; request.PolicyVersionId = policyVersionId; return DeletePolicyVersionAsync(request, cancellationToken); } /// <summary> /// Deletes the specified version of the specified policy. You cannot delete the default /// version of a policy using this API. To delete the default version of a policy, use /// <a>DeletePolicy</a>. To find out which version of a policy is marked as the default /// version, use ListPolicyVersions. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeletePolicyVersion 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 DeletePolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeletePolicyVersion">REST API Reference for DeletePolicyVersion Operation</seealso> public virtual Task<DeletePolicyVersionResponse> DeletePolicyVersionAsync(DeletePolicyVersionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeletePolicyVersionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeletePolicyVersionResponseUnmarshaller.Instance; return InvokeAsync<DeletePolicyVersionResponse>(request, options, cancellationToken); } #endregion #region DeleteProvisioningTemplate /// <summary> /// Deletes a fleet provisioning template. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteProvisioningTemplate service method.</param> /// /// <returns>The response from the DeleteProvisioningTemplate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteProvisioningTemplate">REST API Reference for DeleteProvisioningTemplate Operation</seealso> public virtual DeleteProvisioningTemplateResponse DeleteProvisioningTemplate(DeleteProvisioningTemplateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteProvisioningTemplateRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteProvisioningTemplateResponseUnmarshaller.Instance; return Invoke<DeleteProvisioningTemplateResponse>(request, options); } /// <summary> /// Deletes a fleet provisioning template. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteProvisioningTemplate 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 DeleteProvisioningTemplate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteProvisioningTemplate">REST API Reference for DeleteProvisioningTemplate Operation</seealso> public virtual Task<DeleteProvisioningTemplateResponse> DeleteProvisioningTemplateAsync(DeleteProvisioningTemplateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteProvisioningTemplateRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteProvisioningTemplateResponseUnmarshaller.Instance; return InvokeAsync<DeleteProvisioningTemplateResponse>(request, options, cancellationToken); } #endregion #region DeleteProvisioningTemplateVersion /// <summary> /// Deletes a fleet provisioning template version. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteProvisioningTemplateVersion service method.</param> /// /// <returns>The response from the DeleteProvisioningTemplateVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteProvisioningTemplateVersion">REST API Reference for DeleteProvisioningTemplateVersion Operation</seealso> public virtual DeleteProvisioningTemplateVersionResponse DeleteProvisioningTemplateVersion(DeleteProvisioningTemplateVersionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteProvisioningTemplateVersionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteProvisioningTemplateVersionResponseUnmarshaller.Instance; return Invoke<DeleteProvisioningTemplateVersionResponse>(request, options); } /// <summary> /// Deletes a fleet provisioning template version. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteProvisioningTemplateVersion 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 DeleteProvisioningTemplateVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteProvisioningTemplateVersion">REST API Reference for DeleteProvisioningTemplateVersion Operation</seealso> public virtual Task<DeleteProvisioningTemplateVersionResponse> DeleteProvisioningTemplateVersionAsync(DeleteProvisioningTemplateVersionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteProvisioningTemplateVersionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteProvisioningTemplateVersionResponseUnmarshaller.Instance; return InvokeAsync<DeleteProvisioningTemplateVersionResponse>(request, options, cancellationToken); } #endregion #region DeleteRegistrationCode /// <summary> /// Deletes a CA certificate registration code. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteRegistrationCode service method.</param> /// /// <returns>The response from the DeleteRegistrationCode service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteRegistrationCode">REST API Reference for DeleteRegistrationCode Operation</seealso> public virtual DeleteRegistrationCodeResponse DeleteRegistrationCode(DeleteRegistrationCodeRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteRegistrationCodeRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteRegistrationCodeResponseUnmarshaller.Instance; return Invoke<DeleteRegistrationCodeResponse>(request, options); } /// <summary> /// Deletes a CA certificate registration code. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteRegistrationCode 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 DeleteRegistrationCode service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteRegistrationCode">REST API Reference for DeleteRegistrationCode Operation</seealso> public virtual Task<DeleteRegistrationCodeResponse> DeleteRegistrationCodeAsync(DeleteRegistrationCodeRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteRegistrationCodeRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteRegistrationCodeResponseUnmarshaller.Instance; return InvokeAsync<DeleteRegistrationCodeResponse>(request, options, cancellationToken); } #endregion #region DeleteRoleAlias /// <summary> /// Deletes a role alias /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteRoleAlias service method.</param> /// /// <returns>The response from the DeleteRoleAlias service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteRoleAlias">REST API Reference for DeleteRoleAlias Operation</seealso> public virtual DeleteRoleAliasResponse DeleteRoleAlias(DeleteRoleAliasRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteRoleAliasRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteRoleAliasResponseUnmarshaller.Instance; return Invoke<DeleteRoleAliasResponse>(request, options); } /// <summary> /// Deletes a role alias /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteRoleAlias 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 DeleteRoleAlias service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteRoleAlias">REST API Reference for DeleteRoleAlias Operation</seealso> public virtual Task<DeleteRoleAliasResponse> DeleteRoleAliasAsync(DeleteRoleAliasRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteRoleAliasRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteRoleAliasResponseUnmarshaller.Instance; return InvokeAsync<DeleteRoleAliasResponse>(request, options, cancellationToken); } #endregion #region DeleteScheduledAudit /// <summary> /// Deletes a scheduled audit. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteScheduledAudit service method.</param> /// /// <returns>The response from the DeleteScheduledAudit service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteScheduledAudit">REST API Reference for DeleteScheduledAudit Operation</seealso> public virtual DeleteScheduledAuditResponse DeleteScheduledAudit(DeleteScheduledAuditRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteScheduledAuditRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteScheduledAuditResponseUnmarshaller.Instance; return Invoke<DeleteScheduledAuditResponse>(request, options); } /// <summary> /// Deletes a scheduled audit. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteScheduledAudit 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 DeleteScheduledAudit service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteScheduledAudit">REST API Reference for DeleteScheduledAudit Operation</seealso> public virtual Task<DeleteScheduledAuditResponse> DeleteScheduledAuditAsync(DeleteScheduledAuditRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteScheduledAuditRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteScheduledAuditResponseUnmarshaller.Instance; return InvokeAsync<DeleteScheduledAuditResponse>(request, options, cancellationToken); } #endregion #region DeleteSecurityProfile /// <summary> /// Deletes a Device Defender security profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteSecurityProfile service method.</param> /// /// <returns>The response from the DeleteSecurityProfile service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteSecurityProfile">REST API Reference for DeleteSecurityProfile Operation</seealso> public virtual DeleteSecurityProfileResponse DeleteSecurityProfile(DeleteSecurityProfileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteSecurityProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteSecurityProfileResponseUnmarshaller.Instance; return Invoke<DeleteSecurityProfileResponse>(request, options); } /// <summary> /// Deletes a Device Defender security profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteSecurityProfile 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 DeleteSecurityProfile service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteSecurityProfile">REST API Reference for DeleteSecurityProfile Operation</seealso> public virtual Task<DeleteSecurityProfileResponse> DeleteSecurityProfileAsync(DeleteSecurityProfileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteSecurityProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteSecurityProfileResponseUnmarshaller.Instance; return InvokeAsync<DeleteSecurityProfileResponse>(request, options, cancellationToken); } #endregion #region DeleteStream /// <summary> /// Deletes a stream. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteStream service method.</param> /// /// <returns>The response from the DeleteStream service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteStream">REST API Reference for DeleteStream Operation</seealso> public virtual DeleteStreamResponse DeleteStream(DeleteStreamRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteStreamRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteStreamResponseUnmarshaller.Instance; return Invoke<DeleteStreamResponse>(request, options); } /// <summary> /// Deletes a stream. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteStream 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 DeleteStream service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.DeleteConflictException"> /// You can't delete the resource because it is attached to one or more resources. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteStream">REST API Reference for DeleteStream Operation</seealso> public virtual Task<DeleteStreamResponse> DeleteStreamAsync(DeleteStreamRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteStreamRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteStreamResponseUnmarshaller.Instance; return InvokeAsync<DeleteStreamResponse>(request, options, cancellationToken); } #endregion #region DeleteThing /// <summary> /// Deletes the specified thing. Returns successfully with no error if the deletion is /// successful or you specify a thing that doesn't exist. /// </summary> /// <param name="thingName">The name of the thing to delete.</param> /// /// <returns>The response from the DeleteThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteThing">REST API Reference for DeleteThing Operation</seealso> public virtual DeleteThingResponse DeleteThing(string thingName) { var request = new DeleteThingRequest(); request.ThingName = thingName; return DeleteThing(request); } /// <summary> /// Deletes the specified thing. Returns successfully with no error if the deletion is /// successful or you specify a thing that doesn't exist. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteThing service method.</param> /// /// <returns>The response from the DeleteThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteThing">REST API Reference for DeleteThing Operation</seealso> public virtual DeleteThingResponse DeleteThing(DeleteThingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteThingRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteThingResponseUnmarshaller.Instance; return Invoke<DeleteThingResponse>(request, options); } /// <summary> /// Deletes the specified thing. Returns successfully with no error if the deletion is /// successful or you specify a thing that doesn't exist. /// </summary> /// <param name="thingName">The name of the thing to delete.</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 DeleteThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteThing">REST API Reference for DeleteThing Operation</seealso> public virtual Task<DeleteThingResponse> DeleteThingAsync(string thingName, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DeleteThingRequest(); request.ThingName = thingName; return DeleteThingAsync(request, cancellationToken); } /// <summary> /// Deletes the specified thing. Returns successfully with no error if the deletion is /// successful or you specify a thing that doesn't exist. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteThing 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 DeleteThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteThing">REST API Reference for DeleteThing Operation</seealso> public virtual Task<DeleteThingResponse> DeleteThingAsync(DeleteThingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteThingRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteThingResponseUnmarshaller.Instance; return InvokeAsync<DeleteThingResponse>(request, options, cancellationToken); } #endregion #region DeleteThingGroup /// <summary> /// Deletes a thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteThingGroup service method.</param> /// /// <returns>The response from the DeleteThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteThingGroup">REST API Reference for DeleteThingGroup Operation</seealso> public virtual DeleteThingGroupResponse DeleteThingGroup(DeleteThingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteThingGroupResponseUnmarshaller.Instance; return Invoke<DeleteThingGroupResponse>(request, options); } /// <summary> /// Deletes a thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteThingGroup 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 DeleteThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteThingGroup">REST API Reference for DeleteThingGroup Operation</seealso> public virtual Task<DeleteThingGroupResponse> DeleteThingGroupAsync(DeleteThingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteThingGroupResponseUnmarshaller.Instance; return InvokeAsync<DeleteThingGroupResponse>(request, options, cancellationToken); } #endregion #region DeleteThingType /// <summary> /// Deletes the specified thing type. You cannot delete a thing type if it has things /// associated with it. To delete a thing type, first mark it as deprecated by calling /// <a>DeprecateThingType</a>, then remove any associated things by calling <a>UpdateThing</a> /// to change the thing type on any associated thing, and finally use <a>DeleteThingType</a> /// to delete the thing type. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteThingType service method.</param> /// /// <returns>The response from the DeleteThingType service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteThingType">REST API Reference for DeleteThingType Operation</seealso> public virtual DeleteThingTypeResponse DeleteThingType(DeleteThingTypeRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteThingTypeRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteThingTypeResponseUnmarshaller.Instance; return Invoke<DeleteThingTypeResponse>(request, options); } /// <summary> /// Deletes the specified thing type. You cannot delete a thing type if it has things /// associated with it. To delete a thing type, first mark it as deprecated by calling /// <a>DeprecateThingType</a>, then remove any associated things by calling <a>UpdateThing</a> /// to change the thing type on any associated thing, and finally use <a>DeleteThingType</a> /// to delete the thing type. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteThingType 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 DeleteThingType service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteThingType">REST API Reference for DeleteThingType Operation</seealso> public virtual Task<DeleteThingTypeResponse> DeleteThingTypeAsync(DeleteThingTypeRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteThingTypeRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteThingTypeResponseUnmarshaller.Instance; return InvokeAsync<DeleteThingTypeResponse>(request, options, cancellationToken); } #endregion #region DeleteTopicRule /// <summary> /// Deletes the rule. /// </summary> /// <param name="ruleName">The name of the rule.</param> /// /// <returns>The response from the DeleteTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteTopicRule">REST API Reference for DeleteTopicRule Operation</seealso> public virtual DeleteTopicRuleResponse DeleteTopicRule(string ruleName) { var request = new DeleteTopicRuleRequest(); request.RuleName = ruleName; return DeleteTopicRule(request); } /// <summary> /// Deletes the rule. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteTopicRule service method.</param> /// /// <returns>The response from the DeleteTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteTopicRule">REST API Reference for DeleteTopicRule Operation</seealso> public virtual DeleteTopicRuleResponse DeleteTopicRule(DeleteTopicRuleRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteTopicRuleRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteTopicRuleResponseUnmarshaller.Instance; return Invoke<DeleteTopicRuleResponse>(request, options); } /// <summary> /// Deletes the rule. /// </summary> /// <param name="ruleName">The name of the rule.</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 DeleteTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteTopicRule">REST API Reference for DeleteTopicRule Operation</seealso> public virtual Task<DeleteTopicRuleResponse> DeleteTopicRuleAsync(string ruleName, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DeleteTopicRuleRequest(); request.RuleName = ruleName; return DeleteTopicRuleAsync(request, cancellationToken); } /// <summary> /// Deletes the rule. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteTopicRule 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 DeleteTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteTopicRule">REST API Reference for DeleteTopicRule Operation</seealso> public virtual Task<DeleteTopicRuleResponse> DeleteTopicRuleAsync(DeleteTopicRuleRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteTopicRuleRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteTopicRuleResponseUnmarshaller.Instance; return InvokeAsync<DeleteTopicRuleResponse>(request, options, cancellationToken); } #endregion #region DeleteTopicRuleDestination /// <summary> /// Deletes a topic rule destination. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteTopicRuleDestination service method.</param> /// /// <returns>The response from the DeleteTopicRuleDestination service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteTopicRuleDestination">REST API Reference for DeleteTopicRuleDestination Operation</seealso> public virtual DeleteTopicRuleDestinationResponse DeleteTopicRuleDestination(DeleteTopicRuleDestinationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteTopicRuleDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteTopicRuleDestinationResponseUnmarshaller.Instance; return Invoke<DeleteTopicRuleDestinationResponse>(request, options); } /// <summary> /// Deletes a topic rule destination. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteTopicRuleDestination 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 DeleteTopicRuleDestination service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteTopicRuleDestination">REST API Reference for DeleteTopicRuleDestination Operation</seealso> public virtual Task<DeleteTopicRuleDestinationResponse> DeleteTopicRuleDestinationAsync(DeleteTopicRuleDestinationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteTopicRuleDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteTopicRuleDestinationResponseUnmarshaller.Instance; return InvokeAsync<DeleteTopicRuleDestinationResponse>(request, options, cancellationToken); } #endregion #region DeleteV2LoggingLevel /// <summary> /// Deletes a logging level. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteV2LoggingLevel service method.</param> /// /// <returns>The response from the DeleteV2LoggingLevel service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteV2LoggingLevel">REST API Reference for DeleteV2LoggingLevel Operation</seealso> public virtual DeleteV2LoggingLevelResponse DeleteV2LoggingLevel(DeleteV2LoggingLevelRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteV2LoggingLevelRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteV2LoggingLevelResponseUnmarshaller.Instance; return Invoke<DeleteV2LoggingLevelResponse>(request, options); } /// <summary> /// Deletes a logging level. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteV2LoggingLevel 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 DeleteV2LoggingLevel service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeleteV2LoggingLevel">REST API Reference for DeleteV2LoggingLevel Operation</seealso> public virtual Task<DeleteV2LoggingLevelResponse> DeleteV2LoggingLevelAsync(DeleteV2LoggingLevelRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteV2LoggingLevelRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteV2LoggingLevelResponseUnmarshaller.Instance; return InvokeAsync<DeleteV2LoggingLevelResponse>(request, options, cancellationToken); } #endregion #region DeprecateThingType /// <summary> /// Deprecates a thing type. You can not associate new things with deprecated thing type. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeprecateThingType service method.</param> /// /// <returns>The response from the DeprecateThingType service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeprecateThingType">REST API Reference for DeprecateThingType Operation</seealso> public virtual DeprecateThingTypeResponse DeprecateThingType(DeprecateThingTypeRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeprecateThingTypeRequestMarshaller.Instance; options.ResponseUnmarshaller = DeprecateThingTypeResponseUnmarshaller.Instance; return Invoke<DeprecateThingTypeResponse>(request, options); } /// <summary> /// Deprecates a thing type. You can not associate new things with deprecated thing type. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeprecateThingType 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 DeprecateThingType service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DeprecateThingType">REST API Reference for DeprecateThingType Operation</seealso> public virtual Task<DeprecateThingTypeResponse> DeprecateThingTypeAsync(DeprecateThingTypeRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeprecateThingTypeRequestMarshaller.Instance; options.ResponseUnmarshaller = DeprecateThingTypeResponseUnmarshaller.Instance; return InvokeAsync<DeprecateThingTypeResponse>(request, options, cancellationToken); } #endregion #region DescribeAccountAuditConfiguration /// <summary> /// Gets information about the Device Defender audit settings for this account. Settings /// include how audit notifications are sent and which audit checks are enabled or disabled. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAccountAuditConfiguration service method.</param> /// /// <returns>The response from the DescribeAccountAuditConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeAccountAuditConfiguration">REST API Reference for DescribeAccountAuditConfiguration Operation</seealso> public virtual DescribeAccountAuditConfigurationResponse DescribeAccountAuditConfiguration(DescribeAccountAuditConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeAccountAuditConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeAccountAuditConfigurationResponseUnmarshaller.Instance; return Invoke<DescribeAccountAuditConfigurationResponse>(request, options); } /// <summary> /// Gets information about the Device Defender audit settings for this account. Settings /// include how audit notifications are sent and which audit checks are enabled or disabled. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAccountAuditConfiguration 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 DescribeAccountAuditConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeAccountAuditConfiguration">REST API Reference for DescribeAccountAuditConfiguration Operation</seealso> public virtual Task<DescribeAccountAuditConfigurationResponse> DescribeAccountAuditConfigurationAsync(DescribeAccountAuditConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeAccountAuditConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeAccountAuditConfigurationResponseUnmarshaller.Instance; return InvokeAsync<DescribeAccountAuditConfigurationResponse>(request, options, cancellationToken); } #endregion #region DescribeAuditFinding /// <summary> /// Gets information about a single audit finding. Properties include the reason for noncompliance, /// the severity of the issue, and when the audit that returned the finding was started. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAuditFinding service method.</param> /// /// <returns>The response from the DescribeAuditFinding service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeAuditFinding">REST API Reference for DescribeAuditFinding Operation</seealso> public virtual DescribeAuditFindingResponse DescribeAuditFinding(DescribeAuditFindingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeAuditFindingRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeAuditFindingResponseUnmarshaller.Instance; return Invoke<DescribeAuditFindingResponse>(request, options); } /// <summary> /// Gets information about a single audit finding. Properties include the reason for noncompliance, /// the severity of the issue, and when the audit that returned the finding was started. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAuditFinding 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 DescribeAuditFinding service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeAuditFinding">REST API Reference for DescribeAuditFinding Operation</seealso> public virtual Task<DescribeAuditFindingResponse> DescribeAuditFindingAsync(DescribeAuditFindingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeAuditFindingRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeAuditFindingResponseUnmarshaller.Instance; return InvokeAsync<DescribeAuditFindingResponse>(request, options, cancellationToken); } #endregion #region DescribeAuditMitigationActionsTask /// <summary> /// Gets information about an audit mitigation task that is used to apply mitigation actions /// to a set of audit findings. Properties include the actions being applied, the audit /// checks to which they're being applied, the task status, and aggregated task statistics. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAuditMitigationActionsTask service method.</param> /// /// <returns>The response from the DescribeAuditMitigationActionsTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeAuditMitigationActionsTask">REST API Reference for DescribeAuditMitigationActionsTask Operation</seealso> public virtual DescribeAuditMitigationActionsTaskResponse DescribeAuditMitigationActionsTask(DescribeAuditMitigationActionsTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeAuditMitigationActionsTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeAuditMitigationActionsTaskResponseUnmarshaller.Instance; return Invoke<DescribeAuditMitigationActionsTaskResponse>(request, options); } /// <summary> /// Gets information about an audit mitigation task that is used to apply mitigation actions /// to a set of audit findings. Properties include the actions being applied, the audit /// checks to which they're being applied, the task status, and aggregated task statistics. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAuditMitigationActionsTask 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 DescribeAuditMitigationActionsTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeAuditMitigationActionsTask">REST API Reference for DescribeAuditMitigationActionsTask Operation</seealso> public virtual Task<DescribeAuditMitigationActionsTaskResponse> DescribeAuditMitigationActionsTaskAsync(DescribeAuditMitigationActionsTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeAuditMitigationActionsTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeAuditMitigationActionsTaskResponseUnmarshaller.Instance; return InvokeAsync<DescribeAuditMitigationActionsTaskResponse>(request, options, cancellationToken); } #endregion #region DescribeAuditSuppression /// <summary> /// Gets information about a Device Defender audit suppression. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAuditSuppression service method.</param> /// /// <returns>The response from the DescribeAuditSuppression service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeAuditSuppression">REST API Reference for DescribeAuditSuppression Operation</seealso> public virtual DescribeAuditSuppressionResponse DescribeAuditSuppression(DescribeAuditSuppressionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeAuditSuppressionRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeAuditSuppressionResponseUnmarshaller.Instance; return Invoke<DescribeAuditSuppressionResponse>(request, options); } /// <summary> /// Gets information about a Device Defender audit suppression. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAuditSuppression 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 DescribeAuditSuppression service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeAuditSuppression">REST API Reference for DescribeAuditSuppression Operation</seealso> public virtual Task<DescribeAuditSuppressionResponse> DescribeAuditSuppressionAsync(DescribeAuditSuppressionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeAuditSuppressionRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeAuditSuppressionResponseUnmarshaller.Instance; return InvokeAsync<DescribeAuditSuppressionResponse>(request, options, cancellationToken); } #endregion #region DescribeAuditTask /// <summary> /// Gets information about a Device Defender audit. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAuditTask service method.</param> /// /// <returns>The response from the DescribeAuditTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeAuditTask">REST API Reference for DescribeAuditTask Operation</seealso> public virtual DescribeAuditTaskResponse DescribeAuditTask(DescribeAuditTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeAuditTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeAuditTaskResponseUnmarshaller.Instance; return Invoke<DescribeAuditTaskResponse>(request, options); } /// <summary> /// Gets information about a Device Defender audit. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAuditTask 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 DescribeAuditTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeAuditTask">REST API Reference for DescribeAuditTask Operation</seealso> public virtual Task<DescribeAuditTaskResponse> DescribeAuditTaskAsync(DescribeAuditTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeAuditTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeAuditTaskResponseUnmarshaller.Instance; return InvokeAsync<DescribeAuditTaskResponse>(request, options, cancellationToken); } #endregion #region DescribeAuthorizer /// <summary> /// Describes an authorizer. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAuthorizer service method.</param> /// /// <returns>The response from the DescribeAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeAuthorizer">REST API Reference for DescribeAuthorizer Operation</seealso> public virtual DescribeAuthorizerResponse DescribeAuthorizer(DescribeAuthorizerRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeAuthorizerResponseUnmarshaller.Instance; return Invoke<DescribeAuthorizerResponse>(request, options); } /// <summary> /// Describes an authorizer. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAuthorizer 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 DescribeAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeAuthorizer">REST API Reference for DescribeAuthorizer Operation</seealso> public virtual Task<DescribeAuthorizerResponse> DescribeAuthorizerAsync(DescribeAuthorizerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeAuthorizerResponseUnmarshaller.Instance; return InvokeAsync<DescribeAuthorizerResponse>(request, options, cancellationToken); } #endregion #region DescribeBillingGroup /// <summary> /// Returns information about a billing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeBillingGroup service method.</param> /// /// <returns>The response from the DescribeBillingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeBillingGroup">REST API Reference for DescribeBillingGroup Operation</seealso> public virtual DescribeBillingGroupResponse DescribeBillingGroup(DescribeBillingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeBillingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeBillingGroupResponseUnmarshaller.Instance; return Invoke<DescribeBillingGroupResponse>(request, options); } /// <summary> /// Returns information about a billing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeBillingGroup 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 DescribeBillingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeBillingGroup">REST API Reference for DescribeBillingGroup Operation</seealso> public virtual Task<DescribeBillingGroupResponse> DescribeBillingGroupAsync(DescribeBillingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeBillingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeBillingGroupResponseUnmarshaller.Instance; return InvokeAsync<DescribeBillingGroupResponse>(request, options, cancellationToken); } #endregion #region DescribeCACertificate /// <summary> /// Describes a registered CA certificate. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeCACertificate service method.</param> /// /// <returns>The response from the DescribeCACertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeCACertificate">REST API Reference for DescribeCACertificate Operation</seealso> public virtual DescribeCACertificateResponse DescribeCACertificate(DescribeCACertificateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeCACertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeCACertificateResponseUnmarshaller.Instance; return Invoke<DescribeCACertificateResponse>(request, options); } /// <summary> /// Describes a registered CA certificate. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeCACertificate 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 DescribeCACertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeCACertificate">REST API Reference for DescribeCACertificate Operation</seealso> public virtual Task<DescribeCACertificateResponse> DescribeCACertificateAsync(DescribeCACertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeCACertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeCACertificateResponseUnmarshaller.Instance; return InvokeAsync<DescribeCACertificateResponse>(request, options, cancellationToken); } #endregion #region DescribeCertificate /// <summary> /// Gets information about the specified certificate. /// </summary> /// <param name="certificateId">The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</param> /// /// <returns>The response from the DescribeCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeCertificate">REST API Reference for DescribeCertificate Operation</seealso> public virtual DescribeCertificateResponse DescribeCertificate(string certificateId) { var request = new DescribeCertificateRequest(); request.CertificateId = certificateId; return DescribeCertificate(request); } /// <summary> /// Gets information about the specified certificate. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeCertificate service method.</param> /// /// <returns>The response from the DescribeCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeCertificate">REST API Reference for DescribeCertificate Operation</seealso> public virtual DescribeCertificateResponse DescribeCertificate(DescribeCertificateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeCertificateResponseUnmarshaller.Instance; return Invoke<DescribeCertificateResponse>(request, options); } /// <summary> /// Gets information about the specified certificate. /// </summary> /// <param name="certificateId">The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</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 DescribeCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeCertificate">REST API Reference for DescribeCertificate Operation</seealso> public virtual Task<DescribeCertificateResponse> DescribeCertificateAsync(string certificateId, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DescribeCertificateRequest(); request.CertificateId = certificateId; return DescribeCertificateAsync(request, cancellationToken); } /// <summary> /// Gets information about the specified certificate. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeCertificate 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 DescribeCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeCertificate">REST API Reference for DescribeCertificate Operation</seealso> public virtual Task<DescribeCertificateResponse> DescribeCertificateAsync(DescribeCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeCertificateResponseUnmarshaller.Instance; return InvokeAsync<DescribeCertificateResponse>(request, options, cancellationToken); } #endregion #region DescribeDefaultAuthorizer /// <summary> /// Describes the default authorizer. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeDefaultAuthorizer service method.</param> /// /// <returns>The response from the DescribeDefaultAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeDefaultAuthorizer">REST API Reference for DescribeDefaultAuthorizer Operation</seealso> public virtual DescribeDefaultAuthorizerResponse DescribeDefaultAuthorizer(DescribeDefaultAuthorizerRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeDefaultAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeDefaultAuthorizerResponseUnmarshaller.Instance; return Invoke<DescribeDefaultAuthorizerResponse>(request, options); } /// <summary> /// Describes the default authorizer. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeDefaultAuthorizer 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 DescribeDefaultAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeDefaultAuthorizer">REST API Reference for DescribeDefaultAuthorizer Operation</seealso> public virtual Task<DescribeDefaultAuthorizerResponse> DescribeDefaultAuthorizerAsync(DescribeDefaultAuthorizerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeDefaultAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeDefaultAuthorizerResponseUnmarshaller.Instance; return InvokeAsync<DescribeDefaultAuthorizerResponse>(request, options, cancellationToken); } #endregion #region DescribeDimension /// <summary> /// Provides details about a dimension that is defined in your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeDimension service method.</param> /// /// <returns>The response from the DescribeDimension service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeDimension">REST API Reference for DescribeDimension Operation</seealso> public virtual DescribeDimensionResponse DescribeDimension(DescribeDimensionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeDimensionRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeDimensionResponseUnmarshaller.Instance; return Invoke<DescribeDimensionResponse>(request, options); } /// <summary> /// Provides details about a dimension that is defined in your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeDimension 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 DescribeDimension service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeDimension">REST API Reference for DescribeDimension Operation</seealso> public virtual Task<DescribeDimensionResponse> DescribeDimensionAsync(DescribeDimensionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeDimensionRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeDimensionResponseUnmarshaller.Instance; return InvokeAsync<DescribeDimensionResponse>(request, options, cancellationToken); } #endregion #region DescribeDomainConfiguration /// <summary> /// Gets summary information about a domain configuration. /// /// <note> /// <para> /// The domain configuration feature is in public preview and is subject to change. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeDomainConfiguration service method.</param> /// /// <returns>The response from the DescribeDomainConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeDomainConfiguration">REST API Reference for DescribeDomainConfiguration Operation</seealso> public virtual DescribeDomainConfigurationResponse DescribeDomainConfiguration(DescribeDomainConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeDomainConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeDomainConfigurationResponseUnmarshaller.Instance; return Invoke<DescribeDomainConfigurationResponse>(request, options); } /// <summary> /// Gets summary information about a domain configuration. /// /// <note> /// <para> /// The domain configuration feature is in public preview and is subject to change. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeDomainConfiguration 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 DescribeDomainConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeDomainConfiguration">REST API Reference for DescribeDomainConfiguration Operation</seealso> public virtual Task<DescribeDomainConfigurationResponse> DescribeDomainConfigurationAsync(DescribeDomainConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeDomainConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeDomainConfigurationResponseUnmarshaller.Instance; return InvokeAsync<DescribeDomainConfigurationResponse>(request, options, cancellationToken); } #endregion #region DescribeEndpoint /// <summary> /// Returns a unique endpoint specific to the AWS account making the call. /// </summary> /// /// <returns>The response from the DescribeEndpoint service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeEndpoint">REST API Reference for DescribeEndpoint Operation</seealso> public virtual DescribeEndpointResponse DescribeEndpoint() { var request = new DescribeEndpointRequest(); return DescribeEndpoint(request); } /// <summary> /// Returns a unique endpoint specific to the AWS account making the call. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeEndpoint service method.</param> /// /// <returns>The response from the DescribeEndpoint service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeEndpoint">REST API Reference for DescribeEndpoint Operation</seealso> public virtual DescribeEndpointResponse DescribeEndpoint(DescribeEndpointRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeEndpointRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeEndpointResponseUnmarshaller.Instance; return Invoke<DescribeEndpointResponse>(request, options); } /// <summary> /// Returns a unique endpoint specific to the AWS account making the call. /// </summary> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DescribeEndpoint service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeEndpoint">REST API Reference for DescribeEndpoint Operation</seealso> public virtual Task<DescribeEndpointResponse> DescribeEndpointAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DescribeEndpointRequest(); return DescribeEndpointAsync(request, cancellationToken); } /// <summary> /// Returns a unique endpoint specific to the AWS account making the call. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeEndpoint 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 DescribeEndpoint service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeEndpoint">REST API Reference for DescribeEndpoint Operation</seealso> public virtual Task<DescribeEndpointResponse> DescribeEndpointAsync(DescribeEndpointRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeEndpointRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeEndpointResponseUnmarshaller.Instance; return InvokeAsync<DescribeEndpointResponse>(request, options, cancellationToken); } #endregion #region DescribeEventConfigurations /// <summary> /// Describes event configurations. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeEventConfigurations service method.</param> /// /// <returns>The response from the DescribeEventConfigurations service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeEventConfigurations">REST API Reference for DescribeEventConfigurations Operation</seealso> public virtual DescribeEventConfigurationsResponse DescribeEventConfigurations(DescribeEventConfigurationsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeEventConfigurationsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeEventConfigurationsResponseUnmarshaller.Instance; return Invoke<DescribeEventConfigurationsResponse>(request, options); } /// <summary> /// Describes event configurations. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeEventConfigurations 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 DescribeEventConfigurations service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeEventConfigurations">REST API Reference for DescribeEventConfigurations Operation</seealso> public virtual Task<DescribeEventConfigurationsResponse> DescribeEventConfigurationsAsync(DescribeEventConfigurationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeEventConfigurationsRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeEventConfigurationsResponseUnmarshaller.Instance; return InvokeAsync<DescribeEventConfigurationsResponse>(request, options, cancellationToken); } #endregion #region DescribeIndex /// <summary> /// Describes a search index. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeIndex service method.</param> /// /// <returns>The response from the DescribeIndex service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeIndex">REST API Reference for DescribeIndex Operation</seealso> public virtual DescribeIndexResponse DescribeIndex(DescribeIndexRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeIndexRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeIndexResponseUnmarshaller.Instance; return Invoke<DescribeIndexResponse>(request, options); } /// <summary> /// Describes a search index. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeIndex 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 DescribeIndex service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeIndex">REST API Reference for DescribeIndex Operation</seealso> public virtual Task<DescribeIndexResponse> DescribeIndexAsync(DescribeIndexRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeIndexRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeIndexResponseUnmarshaller.Instance; return InvokeAsync<DescribeIndexResponse>(request, options, cancellationToken); } #endregion #region DescribeJob /// <summary> /// Describes a job. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeJob service method.</param> /// /// <returns>The response from the DescribeJob service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeJob">REST API Reference for DescribeJob Operation</seealso> public virtual DescribeJobResponse DescribeJob(DescribeJobRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeJobRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeJobResponseUnmarshaller.Instance; return Invoke<DescribeJobResponse>(request, options); } /// <summary> /// Describes a job. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeJob service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DescribeJob service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeJob">REST API Reference for DescribeJob Operation</seealso> public virtual Task<DescribeJobResponse> DescribeJobAsync(DescribeJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeJobRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeJobResponseUnmarshaller.Instance; return InvokeAsync<DescribeJobResponse>(request, options, cancellationToken); } #endregion #region DescribeJobExecution /// <summary> /// Describes a job execution. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeJobExecution service method.</param> /// /// <returns>The response from the DescribeJobExecution service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeJobExecution">REST API Reference for DescribeJobExecution Operation</seealso> public virtual DescribeJobExecutionResponse DescribeJobExecution(DescribeJobExecutionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeJobExecutionRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeJobExecutionResponseUnmarshaller.Instance; return Invoke<DescribeJobExecutionResponse>(request, options); } /// <summary> /// Describes a job execution. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeJobExecution 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 DescribeJobExecution service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeJobExecution">REST API Reference for DescribeJobExecution Operation</seealso> public virtual Task<DescribeJobExecutionResponse> DescribeJobExecutionAsync(DescribeJobExecutionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeJobExecutionRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeJobExecutionResponseUnmarshaller.Instance; return InvokeAsync<DescribeJobExecutionResponse>(request, options, cancellationToken); } #endregion #region DescribeMitigationAction /// <summary> /// Gets information about a mitigation action. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeMitigationAction service method.</param> /// /// <returns>The response from the DescribeMitigationAction service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeMitigationAction">REST API Reference for DescribeMitigationAction Operation</seealso> public virtual DescribeMitigationActionResponse DescribeMitigationAction(DescribeMitigationActionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeMitigationActionRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeMitigationActionResponseUnmarshaller.Instance; return Invoke<DescribeMitigationActionResponse>(request, options); } /// <summary> /// Gets information about a mitigation action. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeMitigationAction 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 DescribeMitigationAction service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeMitigationAction">REST API Reference for DescribeMitigationAction Operation</seealso> public virtual Task<DescribeMitigationActionResponse> DescribeMitigationActionAsync(DescribeMitigationActionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeMitigationActionRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeMitigationActionResponseUnmarshaller.Instance; return InvokeAsync<DescribeMitigationActionResponse>(request, options, cancellationToken); } #endregion #region DescribeProvisioningTemplate /// <summary> /// Returns information about a fleet provisioning template. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeProvisioningTemplate service method.</param> /// /// <returns>The response from the DescribeProvisioningTemplate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeProvisioningTemplate">REST API Reference for DescribeProvisioningTemplate Operation</seealso> public virtual DescribeProvisioningTemplateResponse DescribeProvisioningTemplate(DescribeProvisioningTemplateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeProvisioningTemplateRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeProvisioningTemplateResponseUnmarshaller.Instance; return Invoke<DescribeProvisioningTemplateResponse>(request, options); } /// <summary> /// Returns information about a fleet provisioning template. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeProvisioningTemplate 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 DescribeProvisioningTemplate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeProvisioningTemplate">REST API Reference for DescribeProvisioningTemplate Operation</seealso> public virtual Task<DescribeProvisioningTemplateResponse> DescribeProvisioningTemplateAsync(DescribeProvisioningTemplateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeProvisioningTemplateRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeProvisioningTemplateResponseUnmarshaller.Instance; return InvokeAsync<DescribeProvisioningTemplateResponse>(request, options, cancellationToken); } #endregion #region DescribeProvisioningTemplateVersion /// <summary> /// Returns information about a fleet provisioning template version. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeProvisioningTemplateVersion service method.</param> /// /// <returns>The response from the DescribeProvisioningTemplateVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeProvisioningTemplateVersion">REST API Reference for DescribeProvisioningTemplateVersion Operation</seealso> public virtual DescribeProvisioningTemplateVersionResponse DescribeProvisioningTemplateVersion(DescribeProvisioningTemplateVersionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeProvisioningTemplateVersionRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeProvisioningTemplateVersionResponseUnmarshaller.Instance; return Invoke<DescribeProvisioningTemplateVersionResponse>(request, options); } /// <summary> /// Returns information about a fleet provisioning template version. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeProvisioningTemplateVersion 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 DescribeProvisioningTemplateVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeProvisioningTemplateVersion">REST API Reference for DescribeProvisioningTemplateVersion Operation</seealso> public virtual Task<DescribeProvisioningTemplateVersionResponse> DescribeProvisioningTemplateVersionAsync(DescribeProvisioningTemplateVersionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeProvisioningTemplateVersionRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeProvisioningTemplateVersionResponseUnmarshaller.Instance; return InvokeAsync<DescribeProvisioningTemplateVersionResponse>(request, options, cancellationToken); } #endregion #region DescribeRoleAlias /// <summary> /// Describes a role alias. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeRoleAlias service method.</param> /// /// <returns>The response from the DescribeRoleAlias service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeRoleAlias">REST API Reference for DescribeRoleAlias Operation</seealso> public virtual DescribeRoleAliasResponse DescribeRoleAlias(DescribeRoleAliasRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeRoleAliasRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeRoleAliasResponseUnmarshaller.Instance; return Invoke<DescribeRoleAliasResponse>(request, options); } /// <summary> /// Describes a role alias. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeRoleAlias 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 DescribeRoleAlias service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeRoleAlias">REST API Reference for DescribeRoleAlias Operation</seealso> public virtual Task<DescribeRoleAliasResponse> DescribeRoleAliasAsync(DescribeRoleAliasRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeRoleAliasRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeRoleAliasResponseUnmarshaller.Instance; return InvokeAsync<DescribeRoleAliasResponse>(request, options, cancellationToken); } #endregion #region DescribeScheduledAudit /// <summary> /// Gets information about a scheduled audit. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeScheduledAudit service method.</param> /// /// <returns>The response from the DescribeScheduledAudit service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeScheduledAudit">REST API Reference for DescribeScheduledAudit Operation</seealso> public virtual DescribeScheduledAuditResponse DescribeScheduledAudit(DescribeScheduledAuditRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeScheduledAuditRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeScheduledAuditResponseUnmarshaller.Instance; return Invoke<DescribeScheduledAuditResponse>(request, options); } /// <summary> /// Gets information about a scheduled audit. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeScheduledAudit 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 DescribeScheduledAudit service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeScheduledAudit">REST API Reference for DescribeScheduledAudit Operation</seealso> public virtual Task<DescribeScheduledAuditResponse> DescribeScheduledAuditAsync(DescribeScheduledAuditRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeScheduledAuditRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeScheduledAuditResponseUnmarshaller.Instance; return InvokeAsync<DescribeScheduledAuditResponse>(request, options, cancellationToken); } #endregion #region DescribeSecurityProfile /// <summary> /// Gets information about a Device Defender security profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeSecurityProfile service method.</param> /// /// <returns>The response from the DescribeSecurityProfile service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeSecurityProfile">REST API Reference for DescribeSecurityProfile Operation</seealso> public virtual DescribeSecurityProfileResponse DescribeSecurityProfile(DescribeSecurityProfileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeSecurityProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeSecurityProfileResponseUnmarshaller.Instance; return Invoke<DescribeSecurityProfileResponse>(request, options); } /// <summary> /// Gets information about a Device Defender security profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeSecurityProfile 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 DescribeSecurityProfile service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeSecurityProfile">REST API Reference for DescribeSecurityProfile Operation</seealso> public virtual Task<DescribeSecurityProfileResponse> DescribeSecurityProfileAsync(DescribeSecurityProfileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeSecurityProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeSecurityProfileResponseUnmarshaller.Instance; return InvokeAsync<DescribeSecurityProfileResponse>(request, options, cancellationToken); } #endregion #region DescribeStream /// <summary> /// Gets information about a stream. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeStream service method.</param> /// /// <returns>The response from the DescribeStream service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeStream">REST API Reference for DescribeStream Operation</seealso> public virtual DescribeStreamResponse DescribeStream(DescribeStreamRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeStreamRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeStreamResponseUnmarshaller.Instance; return Invoke<DescribeStreamResponse>(request, options); } /// <summary> /// Gets information about a stream. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeStream 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 DescribeStream service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeStream">REST API Reference for DescribeStream Operation</seealso> public virtual Task<DescribeStreamResponse> DescribeStreamAsync(DescribeStreamRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeStreamRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeStreamResponseUnmarshaller.Instance; return InvokeAsync<DescribeStreamResponse>(request, options, cancellationToken); } #endregion #region DescribeThing /// <summary> /// Gets information about the specified thing. /// </summary> /// <param name="thingName">The name of the thing.</param> /// /// <returns>The response from the DescribeThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeThing">REST API Reference for DescribeThing Operation</seealso> public virtual DescribeThingResponse DescribeThing(string thingName) { var request = new DescribeThingRequest(); request.ThingName = thingName; return DescribeThing(request); } /// <summary> /// Gets information about the specified thing. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeThing service method.</param> /// /// <returns>The response from the DescribeThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeThing">REST API Reference for DescribeThing Operation</seealso> public virtual DescribeThingResponse DescribeThing(DescribeThingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeThingRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeThingResponseUnmarshaller.Instance; return Invoke<DescribeThingResponse>(request, options); } /// <summary> /// Gets information about the specified thing. /// </summary> /// <param name="thingName">The name of the thing.</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 DescribeThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeThing">REST API Reference for DescribeThing Operation</seealso> public virtual Task<DescribeThingResponse> DescribeThingAsync(string thingName, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DescribeThingRequest(); request.ThingName = thingName; return DescribeThingAsync(request, cancellationToken); } /// <summary> /// Gets information about the specified thing. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeThing 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 DescribeThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeThing">REST API Reference for DescribeThing Operation</seealso> public virtual Task<DescribeThingResponse> DescribeThingAsync(DescribeThingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeThingRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeThingResponseUnmarshaller.Instance; return InvokeAsync<DescribeThingResponse>(request, options, cancellationToken); } #endregion #region DescribeThingGroup /// <summary> /// Describe a thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeThingGroup service method.</param> /// /// <returns>The response from the DescribeThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeThingGroup">REST API Reference for DescribeThingGroup Operation</seealso> public virtual DescribeThingGroupResponse DescribeThingGroup(DescribeThingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeThingGroupResponseUnmarshaller.Instance; return Invoke<DescribeThingGroupResponse>(request, options); } /// <summary> /// Describe a thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeThingGroup 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 DescribeThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeThingGroup">REST API Reference for DescribeThingGroup Operation</seealso> public virtual Task<DescribeThingGroupResponse> DescribeThingGroupAsync(DescribeThingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeThingGroupResponseUnmarshaller.Instance; return InvokeAsync<DescribeThingGroupResponse>(request, options, cancellationToken); } #endregion #region DescribeThingRegistrationTask /// <summary> /// Describes a bulk thing provisioning task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeThingRegistrationTask service method.</param> /// /// <returns>The response from the DescribeThingRegistrationTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeThingRegistrationTask">REST API Reference for DescribeThingRegistrationTask Operation</seealso> public virtual DescribeThingRegistrationTaskResponse DescribeThingRegistrationTask(DescribeThingRegistrationTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeThingRegistrationTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeThingRegistrationTaskResponseUnmarshaller.Instance; return Invoke<DescribeThingRegistrationTaskResponse>(request, options); } /// <summary> /// Describes a bulk thing provisioning task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeThingRegistrationTask 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 DescribeThingRegistrationTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeThingRegistrationTask">REST API Reference for DescribeThingRegistrationTask Operation</seealso> public virtual Task<DescribeThingRegistrationTaskResponse> DescribeThingRegistrationTaskAsync(DescribeThingRegistrationTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeThingRegistrationTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeThingRegistrationTaskResponseUnmarshaller.Instance; return InvokeAsync<DescribeThingRegistrationTaskResponse>(request, options, cancellationToken); } #endregion #region DescribeThingType /// <summary> /// Gets information about the specified thing type. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeThingType service method.</param> /// /// <returns>The response from the DescribeThingType service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeThingType">REST API Reference for DescribeThingType Operation</seealso> public virtual DescribeThingTypeResponse DescribeThingType(DescribeThingTypeRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeThingTypeRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeThingTypeResponseUnmarshaller.Instance; return Invoke<DescribeThingTypeResponse>(request, options); } /// <summary> /// Gets information about the specified thing type. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeThingType 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 DescribeThingType service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DescribeThingType">REST API Reference for DescribeThingType Operation</seealso> public virtual Task<DescribeThingTypeResponse> DescribeThingTypeAsync(DescribeThingTypeRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeThingTypeRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeThingTypeResponseUnmarshaller.Instance; return InvokeAsync<DescribeThingTypeResponse>(request, options, cancellationToken); } #endregion #region DetachPolicy /// <summary> /// Detaches a policy from the specified target. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DetachPolicy service method.</param> /// /// <returns>The response from the DetachPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DetachPolicy">REST API Reference for DetachPolicy Operation</seealso> public virtual DetachPolicyResponse DetachPolicy(DetachPolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DetachPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = DetachPolicyResponseUnmarshaller.Instance; return Invoke<DetachPolicyResponse>(request, options); } /// <summary> /// Detaches a policy from the specified target. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DetachPolicy 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 DetachPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DetachPolicy">REST API Reference for DetachPolicy Operation</seealso> public virtual Task<DetachPolicyResponse> DetachPolicyAsync(DetachPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DetachPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = DetachPolicyResponseUnmarshaller.Instance; return InvokeAsync<DetachPolicyResponse>(request, options, cancellationToken); } #endregion #region DetachPrincipalPolicy /// <summary> /// Removes the specified policy from the specified certificate. /// /// /// <para> /// <b>Note:</b> This API is deprecated. Please use <a>DetachPolicy</a> instead. /// </para> /// </summary> /// <param name="policyName">The name of the policy to detach.</param> /// <param name="principal">The principal. Valid principals are CertificateArn (arn:aws:iot:<i>region</i>:<i>accountId</i>:cert/<i>certificateId</i>), thingGroupArn (arn:aws:iot:<i>region</i>:<i>accountId</i>:thinggroup/<i>groupName</i>) and CognitoId (<i>region</i>:<i>id</i>).</param> /// /// <returns>The response from the DetachPrincipalPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DetachPrincipalPolicy">REST API Reference for DetachPrincipalPolicy Operation</seealso> [Obsolete("Deprecated in favor of DetachPolicy.")] public virtual DetachPrincipalPolicyResponse DetachPrincipalPolicy(string policyName, string principal) { var request = new DetachPrincipalPolicyRequest(); request.PolicyName = policyName; request.Principal = principal; return DetachPrincipalPolicy(request); } /// <summary> /// Removes the specified policy from the specified certificate. /// /// /// <para> /// <b>Note:</b> This API is deprecated. Please use <a>DetachPolicy</a> instead. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DetachPrincipalPolicy service method.</param> /// /// <returns>The response from the DetachPrincipalPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DetachPrincipalPolicy">REST API Reference for DetachPrincipalPolicy Operation</seealso> [Obsolete("Deprecated in favor of DetachPolicy.")] public virtual DetachPrincipalPolicyResponse DetachPrincipalPolicy(DetachPrincipalPolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DetachPrincipalPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = DetachPrincipalPolicyResponseUnmarshaller.Instance; return Invoke<DetachPrincipalPolicyResponse>(request, options); } /// <summary> /// Removes the specified policy from the specified certificate. /// /// /// <para> /// <b>Note:</b> This API is deprecated. Please use <a>DetachPolicy</a> instead. /// </para> /// </summary> /// <param name="policyName">The name of the policy to detach.</param> /// <param name="principal">The principal. Valid principals are CertificateArn (arn:aws:iot:<i>region</i>:<i>accountId</i>:cert/<i>certificateId</i>), thingGroupArn (arn:aws:iot:<i>region</i>:<i>accountId</i>:thinggroup/<i>groupName</i>) and CognitoId (<i>region</i>:<i>id</i>).</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 DetachPrincipalPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DetachPrincipalPolicy">REST API Reference for DetachPrincipalPolicy Operation</seealso> [Obsolete("Deprecated in favor of DetachPolicy.")] public virtual Task<DetachPrincipalPolicyResponse> DetachPrincipalPolicyAsync(string policyName, string principal, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DetachPrincipalPolicyRequest(); request.PolicyName = policyName; request.Principal = principal; return DetachPrincipalPolicyAsync(request, cancellationToken); } /// <summary> /// Removes the specified policy from the specified certificate. /// /// /// <para> /// <b>Note:</b> This API is deprecated. Please use <a>DetachPolicy</a> instead. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DetachPrincipalPolicy 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 DetachPrincipalPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DetachPrincipalPolicy">REST API Reference for DetachPrincipalPolicy Operation</seealso> [Obsolete("Deprecated in favor of DetachPolicy.")] public virtual Task<DetachPrincipalPolicyResponse> DetachPrincipalPolicyAsync(DetachPrincipalPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DetachPrincipalPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = DetachPrincipalPolicyResponseUnmarshaller.Instance; return InvokeAsync<DetachPrincipalPolicyResponse>(request, options, cancellationToken); } #endregion #region DetachSecurityProfile /// <summary> /// Disassociates a Device Defender security profile from a thing group or from this account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DetachSecurityProfile service method.</param> /// /// <returns>The response from the DetachSecurityProfile service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DetachSecurityProfile">REST API Reference for DetachSecurityProfile Operation</seealso> public virtual DetachSecurityProfileResponse DetachSecurityProfile(DetachSecurityProfileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DetachSecurityProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = DetachSecurityProfileResponseUnmarshaller.Instance; return Invoke<DetachSecurityProfileResponse>(request, options); } /// <summary> /// Disassociates a Device Defender security profile from a thing group or from this account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DetachSecurityProfile 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 DetachSecurityProfile service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DetachSecurityProfile">REST API Reference for DetachSecurityProfile Operation</seealso> public virtual Task<DetachSecurityProfileResponse> DetachSecurityProfileAsync(DetachSecurityProfileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DetachSecurityProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = DetachSecurityProfileResponseUnmarshaller.Instance; return InvokeAsync<DetachSecurityProfileResponse>(request, options, cancellationToken); } #endregion #region DetachThingPrincipal /// <summary> /// Detaches the specified principal from the specified thing. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// /// <note> /// <para> /// This call is asynchronous. It might take several seconds for the detachment to propagate. /// </para> /// </note> /// </summary> /// <param name="thingName">The name of the thing.</param> /// <param name="principal">If the principal is a certificate, this value must be ARN of the certificate. If the principal is an Amazon Cognito identity, this value must be the ID of the Amazon Cognito identity.</param> /// /// <returns>The response from the DetachThingPrincipal service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DetachThingPrincipal">REST API Reference for DetachThingPrincipal Operation</seealso> public virtual DetachThingPrincipalResponse DetachThingPrincipal(string thingName, string principal) { var request = new DetachThingPrincipalRequest(); request.ThingName = thingName; request.Principal = principal; return DetachThingPrincipal(request); } /// <summary> /// Detaches the specified principal from the specified thing. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// /// <note> /// <para> /// This call is asynchronous. It might take several seconds for the detachment to propagate. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DetachThingPrincipal service method.</param> /// /// <returns>The response from the DetachThingPrincipal service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DetachThingPrincipal">REST API Reference for DetachThingPrincipal Operation</seealso> public virtual DetachThingPrincipalResponse DetachThingPrincipal(DetachThingPrincipalRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DetachThingPrincipalRequestMarshaller.Instance; options.ResponseUnmarshaller = DetachThingPrincipalResponseUnmarshaller.Instance; return Invoke<DetachThingPrincipalResponse>(request, options); } /// <summary> /// Detaches the specified principal from the specified thing. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// /// <note> /// <para> /// This call is asynchronous. It might take several seconds for the detachment to propagate. /// </para> /// </note> /// </summary> /// <param name="thingName">The name of the thing.</param> /// <param name="principal">If the principal is a certificate, this value must be ARN of the certificate. If the principal is an Amazon Cognito identity, this value must be the ID of the Amazon Cognito identity.</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 DetachThingPrincipal service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DetachThingPrincipal">REST API Reference for DetachThingPrincipal Operation</seealso> public virtual Task<DetachThingPrincipalResponse> DetachThingPrincipalAsync(string thingName, string principal, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DetachThingPrincipalRequest(); request.ThingName = thingName; request.Principal = principal; return DetachThingPrincipalAsync(request, cancellationToken); } /// <summary> /// Detaches the specified principal from the specified thing. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// /// <note> /// <para> /// This call is asynchronous. It might take several seconds for the detachment to propagate. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DetachThingPrincipal 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 DetachThingPrincipal service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DetachThingPrincipal">REST API Reference for DetachThingPrincipal Operation</seealso> public virtual Task<DetachThingPrincipalResponse> DetachThingPrincipalAsync(DetachThingPrincipalRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DetachThingPrincipalRequestMarshaller.Instance; options.ResponseUnmarshaller = DetachThingPrincipalResponseUnmarshaller.Instance; return InvokeAsync<DetachThingPrincipalResponse>(request, options, cancellationToken); } #endregion #region DisableTopicRule /// <summary> /// Disables the rule. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DisableTopicRule service method.</param> /// /// <returns>The response from the DisableTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DisableTopicRule">REST API Reference for DisableTopicRule Operation</seealso> public virtual DisableTopicRuleResponse DisableTopicRule(DisableTopicRuleRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DisableTopicRuleRequestMarshaller.Instance; options.ResponseUnmarshaller = DisableTopicRuleResponseUnmarshaller.Instance; return Invoke<DisableTopicRuleResponse>(request, options); } /// <summary> /// Disables the rule. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DisableTopicRule 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 DisableTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/DisableTopicRule">REST API Reference for DisableTopicRule Operation</seealso> public virtual Task<DisableTopicRuleResponse> DisableTopicRuleAsync(DisableTopicRuleRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DisableTopicRuleRequestMarshaller.Instance; options.ResponseUnmarshaller = DisableTopicRuleResponseUnmarshaller.Instance; return InvokeAsync<DisableTopicRuleResponse>(request, options, cancellationToken); } #endregion #region EnableTopicRule /// <summary> /// Enables the rule. /// </summary> /// <param name="request">Container for the necessary parameters to execute the EnableTopicRule service method.</param> /// /// <returns>The response from the EnableTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/EnableTopicRule">REST API Reference for EnableTopicRule Operation</seealso> public virtual EnableTopicRuleResponse EnableTopicRule(EnableTopicRuleRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = EnableTopicRuleRequestMarshaller.Instance; options.ResponseUnmarshaller = EnableTopicRuleResponseUnmarshaller.Instance; return Invoke<EnableTopicRuleResponse>(request, options); } /// <summary> /// Enables the rule. /// </summary> /// <param name="request">Container for the necessary parameters to execute the EnableTopicRule 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 EnableTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/EnableTopicRule">REST API Reference for EnableTopicRule Operation</seealso> public virtual Task<EnableTopicRuleResponse> EnableTopicRuleAsync(EnableTopicRuleRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = EnableTopicRuleRequestMarshaller.Instance; options.ResponseUnmarshaller = EnableTopicRuleResponseUnmarshaller.Instance; return InvokeAsync<EnableTopicRuleResponse>(request, options, cancellationToken); } #endregion #region GetCardinality /// <summary> /// Returns the approximate count of unique values that match the query. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetCardinality service method.</param> /// /// <returns>The response from the GetCardinality service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.IndexNotReadyException"> /// The index is not ready. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidAggregationException"> /// The aggregation is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidQueryException"> /// The query is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetCardinality">REST API Reference for GetCardinality Operation</seealso> public virtual GetCardinalityResponse GetCardinality(GetCardinalityRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetCardinalityRequestMarshaller.Instance; options.ResponseUnmarshaller = GetCardinalityResponseUnmarshaller.Instance; return Invoke<GetCardinalityResponse>(request, options); } /// <summary> /// Returns the approximate count of unique values that match the query. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetCardinality 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 GetCardinality service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.IndexNotReadyException"> /// The index is not ready. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidAggregationException"> /// The aggregation is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidQueryException"> /// The query is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetCardinality">REST API Reference for GetCardinality Operation</seealso> public virtual Task<GetCardinalityResponse> GetCardinalityAsync(GetCardinalityRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetCardinalityRequestMarshaller.Instance; options.ResponseUnmarshaller = GetCardinalityResponseUnmarshaller.Instance; return InvokeAsync<GetCardinalityResponse>(request, options, cancellationToken); } #endregion #region GetEffectivePolicies /// <summary> /// Gets a list of the policies that have an effect on the authorization behavior of the /// specified device when it connects to the AWS IoT device gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetEffectivePolicies service method.</param> /// /// <returns>The response from the GetEffectivePolicies service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetEffectivePolicies">REST API Reference for GetEffectivePolicies Operation</seealso> public virtual GetEffectivePoliciesResponse GetEffectivePolicies(GetEffectivePoliciesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetEffectivePoliciesRequestMarshaller.Instance; options.ResponseUnmarshaller = GetEffectivePoliciesResponseUnmarshaller.Instance; return Invoke<GetEffectivePoliciesResponse>(request, options); } /// <summary> /// Gets a list of the policies that have an effect on the authorization behavior of the /// specified device when it connects to the AWS IoT device gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetEffectivePolicies 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 GetEffectivePolicies service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetEffectivePolicies">REST API Reference for GetEffectivePolicies Operation</seealso> public virtual Task<GetEffectivePoliciesResponse> GetEffectivePoliciesAsync(GetEffectivePoliciesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetEffectivePoliciesRequestMarshaller.Instance; options.ResponseUnmarshaller = GetEffectivePoliciesResponseUnmarshaller.Instance; return InvokeAsync<GetEffectivePoliciesResponse>(request, options, cancellationToken); } #endregion #region GetIndexingConfiguration /// <summary> /// Gets the indexing configuration. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetIndexingConfiguration service method.</param> /// /// <returns>The response from the GetIndexingConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetIndexingConfiguration">REST API Reference for GetIndexingConfiguration Operation</seealso> public virtual GetIndexingConfigurationResponse GetIndexingConfiguration(GetIndexingConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetIndexingConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetIndexingConfigurationResponseUnmarshaller.Instance; return Invoke<GetIndexingConfigurationResponse>(request, options); } /// <summary> /// Gets the indexing configuration. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetIndexingConfiguration 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 GetIndexingConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetIndexingConfiguration">REST API Reference for GetIndexingConfiguration Operation</seealso> public virtual Task<GetIndexingConfigurationResponse> GetIndexingConfigurationAsync(GetIndexingConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetIndexingConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetIndexingConfigurationResponseUnmarshaller.Instance; return InvokeAsync<GetIndexingConfigurationResponse>(request, options, cancellationToken); } #endregion #region GetJobDocument /// <summary> /// Gets a job document. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetJobDocument service method.</param> /// /// <returns>The response from the GetJobDocument service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetJobDocument">REST API Reference for GetJobDocument Operation</seealso> public virtual GetJobDocumentResponse GetJobDocument(GetJobDocumentRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetJobDocumentRequestMarshaller.Instance; options.ResponseUnmarshaller = GetJobDocumentResponseUnmarshaller.Instance; return Invoke<GetJobDocumentResponse>(request, options); } /// <summary> /// Gets a job document. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetJobDocument 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 GetJobDocument service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetJobDocument">REST API Reference for GetJobDocument Operation</seealso> public virtual Task<GetJobDocumentResponse> GetJobDocumentAsync(GetJobDocumentRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetJobDocumentRequestMarshaller.Instance; options.ResponseUnmarshaller = GetJobDocumentResponseUnmarshaller.Instance; return InvokeAsync<GetJobDocumentResponse>(request, options, cancellationToken); } #endregion #region GetLoggingOptions /// <summary> /// Gets the logging options. /// /// /// <para> /// NOTE: use of this command is not recommended. Use <code>GetV2LoggingOptions</code> /// instead. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetLoggingOptions service method.</param> /// /// <returns>The response from the GetLoggingOptions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetLoggingOptions">REST API Reference for GetLoggingOptions Operation</seealso> public virtual GetLoggingOptionsResponse GetLoggingOptions(GetLoggingOptionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetLoggingOptionsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetLoggingOptionsResponseUnmarshaller.Instance; return Invoke<GetLoggingOptionsResponse>(request, options); } /// <summary> /// Gets the logging options. /// /// /// <para> /// NOTE: use of this command is not recommended. Use <code>GetV2LoggingOptions</code> /// instead. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetLoggingOptions 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 GetLoggingOptions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetLoggingOptions">REST API Reference for GetLoggingOptions Operation</seealso> public virtual Task<GetLoggingOptionsResponse> GetLoggingOptionsAsync(GetLoggingOptionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetLoggingOptionsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetLoggingOptionsResponseUnmarshaller.Instance; return InvokeAsync<GetLoggingOptionsResponse>(request, options, cancellationToken); } #endregion #region GetOTAUpdate /// <summary> /// Gets an OTA update. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetOTAUpdate service method.</param> /// /// <returns>The response from the GetOTAUpdate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetOTAUpdate">REST API Reference for GetOTAUpdate Operation</seealso> public virtual GetOTAUpdateResponse GetOTAUpdate(GetOTAUpdateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetOTAUpdateRequestMarshaller.Instance; options.ResponseUnmarshaller = GetOTAUpdateResponseUnmarshaller.Instance; return Invoke<GetOTAUpdateResponse>(request, options); } /// <summary> /// Gets an OTA update. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetOTAUpdate 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 GetOTAUpdate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetOTAUpdate">REST API Reference for GetOTAUpdate Operation</seealso> public virtual Task<GetOTAUpdateResponse> GetOTAUpdateAsync(GetOTAUpdateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetOTAUpdateRequestMarshaller.Instance; options.ResponseUnmarshaller = GetOTAUpdateResponseUnmarshaller.Instance; return InvokeAsync<GetOTAUpdateResponse>(request, options, cancellationToken); } #endregion #region GetPercentiles /// <summary> /// Groups the aggregated values that match the query into percentile groupings. The default /// percentile groupings are: 1,5,25,50,75,95,99, although you can specify your own when /// you call <code>GetPercentiles</code>. This function returns a value for each percentile /// group specified (or the default percentile groupings). The percentile group "1" contains /// the aggregated field value that occurs in approximately one percent of the values /// that match the query. The percentile group "5" contains the aggregated field value /// that occurs in approximately five percent of the values that match the query, and /// so on. The result is an approximation, the more values that match the query, the more /// accurate the percentile values. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetPercentiles service method.</param> /// /// <returns>The response from the GetPercentiles service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.IndexNotReadyException"> /// The index is not ready. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidAggregationException"> /// The aggregation is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidQueryException"> /// The query is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetPercentiles">REST API Reference for GetPercentiles Operation</seealso> public virtual GetPercentilesResponse GetPercentiles(GetPercentilesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetPercentilesRequestMarshaller.Instance; options.ResponseUnmarshaller = GetPercentilesResponseUnmarshaller.Instance; return Invoke<GetPercentilesResponse>(request, options); } /// <summary> /// Groups the aggregated values that match the query into percentile groupings. The default /// percentile groupings are: 1,5,25,50,75,95,99, although you can specify your own when /// you call <code>GetPercentiles</code>. This function returns a value for each percentile /// group specified (or the default percentile groupings). The percentile group "1" contains /// the aggregated field value that occurs in approximately one percent of the values /// that match the query. The percentile group "5" contains the aggregated field value /// that occurs in approximately five percent of the values that match the query, and /// so on. The result is an approximation, the more values that match the query, the more /// accurate the percentile values. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetPercentiles 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 GetPercentiles service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.IndexNotReadyException"> /// The index is not ready. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidAggregationException"> /// The aggregation is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidQueryException"> /// The query is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetPercentiles">REST API Reference for GetPercentiles Operation</seealso> public virtual Task<GetPercentilesResponse> GetPercentilesAsync(GetPercentilesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetPercentilesRequestMarshaller.Instance; options.ResponseUnmarshaller = GetPercentilesResponseUnmarshaller.Instance; return InvokeAsync<GetPercentilesResponse>(request, options, cancellationToken); } #endregion #region GetPolicy /// <summary> /// Gets information about the specified policy with the policy document of the default /// version. /// </summary> /// <param name="policyName">The name of the policy.</param> /// /// <returns>The response from the GetPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetPolicy">REST API Reference for GetPolicy Operation</seealso> public virtual GetPolicyResponse GetPolicy(string policyName) { var request = new GetPolicyRequest(); request.PolicyName = policyName; return GetPolicy(request); } /// <summary> /// Gets information about the specified policy with the policy document of the default /// version. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetPolicy service method.</param> /// /// <returns>The response from the GetPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetPolicy">REST API Reference for GetPolicy Operation</seealso> public virtual GetPolicyResponse GetPolicy(GetPolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = GetPolicyResponseUnmarshaller.Instance; return Invoke<GetPolicyResponse>(request, options); } /// <summary> /// Gets information about the specified policy with the policy document of the default /// version. /// </summary> /// <param name="policyName">The name of the policy.</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 GetPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetPolicy">REST API Reference for GetPolicy Operation</seealso> public virtual Task<GetPolicyResponse> GetPolicyAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new GetPolicyRequest(); request.PolicyName = policyName; return GetPolicyAsync(request, cancellationToken); } /// <summary> /// Gets information about the specified policy with the policy document of the default /// version. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetPolicy 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 GetPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetPolicy">REST API Reference for GetPolicy Operation</seealso> public virtual Task<GetPolicyResponse> GetPolicyAsync(GetPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = GetPolicyResponseUnmarshaller.Instance; return InvokeAsync<GetPolicyResponse>(request, options, cancellationToken); } #endregion #region GetPolicyVersion /// <summary> /// Gets information about the specified policy version. /// </summary> /// <param name="policyName">The name of the policy.</param> /// <param name="policyVersionId">The policy version ID.</param> /// /// <returns>The response from the GetPolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetPolicyVersion">REST API Reference for GetPolicyVersion Operation</seealso> public virtual GetPolicyVersionResponse GetPolicyVersion(string policyName, string policyVersionId) { var request = new GetPolicyVersionRequest(); request.PolicyName = policyName; request.PolicyVersionId = policyVersionId; return GetPolicyVersion(request); } /// <summary> /// Gets information about the specified policy version. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetPolicyVersion service method.</param> /// /// <returns>The response from the GetPolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetPolicyVersion">REST API Reference for GetPolicyVersion Operation</seealso> public virtual GetPolicyVersionResponse GetPolicyVersion(GetPolicyVersionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetPolicyVersionRequestMarshaller.Instance; options.ResponseUnmarshaller = GetPolicyVersionResponseUnmarshaller.Instance; return Invoke<GetPolicyVersionResponse>(request, options); } /// <summary> /// Gets information about the specified policy version. /// </summary> /// <param name="policyName">The name of the policy.</param> /// <param name="policyVersionId">The policy version ID.</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 GetPolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetPolicyVersion">REST API Reference for GetPolicyVersion Operation</seealso> public virtual Task<GetPolicyVersionResponse> GetPolicyVersionAsync(string policyName, string policyVersionId, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new GetPolicyVersionRequest(); request.PolicyName = policyName; request.PolicyVersionId = policyVersionId; return GetPolicyVersionAsync(request, cancellationToken); } /// <summary> /// Gets information about the specified policy version. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetPolicyVersion 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 GetPolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetPolicyVersion">REST API Reference for GetPolicyVersion Operation</seealso> public virtual Task<GetPolicyVersionResponse> GetPolicyVersionAsync(GetPolicyVersionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetPolicyVersionRequestMarshaller.Instance; options.ResponseUnmarshaller = GetPolicyVersionResponseUnmarshaller.Instance; return InvokeAsync<GetPolicyVersionResponse>(request, options, cancellationToken); } #endregion #region GetRegistrationCode /// <summary> /// Gets a registration code used to register a CA certificate with AWS IoT. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetRegistrationCode service method.</param> /// /// <returns>The response from the GetRegistrationCode service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetRegistrationCode">REST API Reference for GetRegistrationCode Operation</seealso> public virtual GetRegistrationCodeResponse GetRegistrationCode(GetRegistrationCodeRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetRegistrationCodeRequestMarshaller.Instance; options.ResponseUnmarshaller = GetRegistrationCodeResponseUnmarshaller.Instance; return Invoke<GetRegistrationCodeResponse>(request, options); } /// <summary> /// Gets a registration code used to register a CA certificate with AWS IoT. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetRegistrationCode 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 GetRegistrationCode service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetRegistrationCode">REST API Reference for GetRegistrationCode Operation</seealso> public virtual Task<GetRegistrationCodeResponse> GetRegistrationCodeAsync(GetRegistrationCodeRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetRegistrationCodeRequestMarshaller.Instance; options.ResponseUnmarshaller = GetRegistrationCodeResponseUnmarshaller.Instance; return InvokeAsync<GetRegistrationCodeResponse>(request, options, cancellationToken); } #endregion #region GetStatistics /// <summary> /// Returns the count, average, sum, minimum, maximum, sum of squares, variance, and standard /// deviation for the specified aggregated field. If the aggregation field is of type /// <code>String</code>, only the count statistic is returned. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetStatistics service method.</param> /// /// <returns>The response from the GetStatistics service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.IndexNotReadyException"> /// The index is not ready. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidAggregationException"> /// The aggregation is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidQueryException"> /// The query is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetStatistics">REST API Reference for GetStatistics Operation</seealso> public virtual GetStatisticsResponse GetStatistics(GetStatisticsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetStatisticsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetStatisticsResponseUnmarshaller.Instance; return Invoke<GetStatisticsResponse>(request, options); } /// <summary> /// Returns the count, average, sum, minimum, maximum, sum of squares, variance, and standard /// deviation for the specified aggregated field. If the aggregation field is of type /// <code>String</code>, only the count statistic is returned. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetStatistics 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 GetStatistics service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.IndexNotReadyException"> /// The index is not ready. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidAggregationException"> /// The aggregation is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidQueryException"> /// The query is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetStatistics">REST API Reference for GetStatistics Operation</seealso> public virtual Task<GetStatisticsResponse> GetStatisticsAsync(GetStatisticsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetStatisticsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetStatisticsResponseUnmarshaller.Instance; return InvokeAsync<GetStatisticsResponse>(request, options, cancellationToken); } #endregion #region GetTopicRule /// <summary> /// Gets information about the rule. /// </summary> /// <param name="ruleName">The name of the rule.</param> /// /// <returns>The response from the GetTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetTopicRule">REST API Reference for GetTopicRule Operation</seealso> public virtual GetTopicRuleResponse GetTopicRule(string ruleName) { var request = new GetTopicRuleRequest(); request.RuleName = ruleName; return GetTopicRule(request); } /// <summary> /// Gets information about the rule. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetTopicRule service method.</param> /// /// <returns>The response from the GetTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetTopicRule">REST API Reference for GetTopicRule Operation</seealso> public virtual GetTopicRuleResponse GetTopicRule(GetTopicRuleRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetTopicRuleRequestMarshaller.Instance; options.ResponseUnmarshaller = GetTopicRuleResponseUnmarshaller.Instance; return Invoke<GetTopicRuleResponse>(request, options); } /// <summary> /// Gets information about the rule. /// </summary> /// <param name="ruleName">The name of the rule.</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 GetTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetTopicRule">REST API Reference for GetTopicRule Operation</seealso> public virtual Task<GetTopicRuleResponse> GetTopicRuleAsync(string ruleName, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new GetTopicRuleRequest(); request.RuleName = ruleName; return GetTopicRuleAsync(request, cancellationToken); } /// <summary> /// Gets information about the rule. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetTopicRule 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 GetTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetTopicRule">REST API Reference for GetTopicRule Operation</seealso> public virtual Task<GetTopicRuleResponse> GetTopicRuleAsync(GetTopicRuleRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetTopicRuleRequestMarshaller.Instance; options.ResponseUnmarshaller = GetTopicRuleResponseUnmarshaller.Instance; return InvokeAsync<GetTopicRuleResponse>(request, options, cancellationToken); } #endregion #region GetTopicRuleDestination /// <summary> /// Gets information about a topic rule destination. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetTopicRuleDestination service method.</param> /// /// <returns>The response from the GetTopicRuleDestination service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetTopicRuleDestination">REST API Reference for GetTopicRuleDestination Operation</seealso> public virtual GetTopicRuleDestinationResponse GetTopicRuleDestination(GetTopicRuleDestinationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetTopicRuleDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetTopicRuleDestinationResponseUnmarshaller.Instance; return Invoke<GetTopicRuleDestinationResponse>(request, options); } /// <summary> /// Gets information about a topic rule destination. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetTopicRuleDestination 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 GetTopicRuleDestination service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetTopicRuleDestination">REST API Reference for GetTopicRuleDestination Operation</seealso> public virtual Task<GetTopicRuleDestinationResponse> GetTopicRuleDestinationAsync(GetTopicRuleDestinationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetTopicRuleDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = GetTopicRuleDestinationResponseUnmarshaller.Instance; return InvokeAsync<GetTopicRuleDestinationResponse>(request, options, cancellationToken); } #endregion #region GetV2LoggingOptions /// <summary> /// Gets the fine grained logging options. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetV2LoggingOptions service method.</param> /// /// <returns>The response from the GetV2LoggingOptions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.NotConfiguredException"> /// The resource is not configured. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetV2LoggingOptions">REST API Reference for GetV2LoggingOptions Operation</seealso> public virtual GetV2LoggingOptionsResponse GetV2LoggingOptions(GetV2LoggingOptionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetV2LoggingOptionsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetV2LoggingOptionsResponseUnmarshaller.Instance; return Invoke<GetV2LoggingOptionsResponse>(request, options); } /// <summary> /// Gets the fine grained logging options. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetV2LoggingOptions 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 GetV2LoggingOptions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.NotConfiguredException"> /// The resource is not configured. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/GetV2LoggingOptions">REST API Reference for GetV2LoggingOptions Operation</seealso> public virtual Task<GetV2LoggingOptionsResponse> GetV2LoggingOptionsAsync(GetV2LoggingOptionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetV2LoggingOptionsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetV2LoggingOptionsResponseUnmarshaller.Instance; return InvokeAsync<GetV2LoggingOptionsResponse>(request, options, cancellationToken); } #endregion #region ListActiveViolations /// <summary> /// Lists the active violations for a given Device Defender security profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListActiveViolations service method.</param> /// /// <returns>The response from the ListActiveViolations service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListActiveViolations">REST API Reference for ListActiveViolations Operation</seealso> public virtual ListActiveViolationsResponse ListActiveViolations(ListActiveViolationsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListActiveViolationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListActiveViolationsResponseUnmarshaller.Instance; return Invoke<ListActiveViolationsResponse>(request, options); } /// <summary> /// Lists the active violations for a given Device Defender security profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListActiveViolations 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 ListActiveViolations service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListActiveViolations">REST API Reference for ListActiveViolations Operation</seealso> public virtual Task<ListActiveViolationsResponse> ListActiveViolationsAsync(ListActiveViolationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListActiveViolationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListActiveViolationsResponseUnmarshaller.Instance; return InvokeAsync<ListActiveViolationsResponse>(request, options, cancellationToken); } #endregion #region ListAttachedPolicies /// <summary> /// Lists the policies attached to the specified thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAttachedPolicies service method.</param> /// /// <returns>The response from the ListAttachedPolicies service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAttachedPolicies">REST API Reference for ListAttachedPolicies Operation</seealso> public virtual ListAttachedPoliciesResponse ListAttachedPolicies(ListAttachedPoliciesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListAttachedPoliciesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAttachedPoliciesResponseUnmarshaller.Instance; return Invoke<ListAttachedPoliciesResponse>(request, options); } /// <summary> /// Lists the policies attached to the specified thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAttachedPolicies 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 ListAttachedPolicies service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAttachedPolicies">REST API Reference for ListAttachedPolicies Operation</seealso> public virtual Task<ListAttachedPoliciesResponse> ListAttachedPoliciesAsync(ListAttachedPoliciesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListAttachedPoliciesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAttachedPoliciesResponseUnmarshaller.Instance; return InvokeAsync<ListAttachedPoliciesResponse>(request, options, cancellationToken); } #endregion #region ListAuditFindings /// <summary> /// Lists the findings (results) of a Device Defender audit or of the audits performed /// during a specified time period. (Findings are retained for 90 days.) /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAuditFindings service method.</param> /// /// <returns>The response from the ListAuditFindings service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAuditFindings">REST API Reference for ListAuditFindings Operation</seealso> public virtual ListAuditFindingsResponse ListAuditFindings(ListAuditFindingsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListAuditFindingsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAuditFindingsResponseUnmarshaller.Instance; return Invoke<ListAuditFindingsResponse>(request, options); } /// <summary> /// Lists the findings (results) of a Device Defender audit or of the audits performed /// during a specified time period. (Findings are retained for 90 days.) /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAuditFindings 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 ListAuditFindings service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAuditFindings">REST API Reference for ListAuditFindings Operation</seealso> public virtual Task<ListAuditFindingsResponse> ListAuditFindingsAsync(ListAuditFindingsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListAuditFindingsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAuditFindingsResponseUnmarshaller.Instance; return InvokeAsync<ListAuditFindingsResponse>(request, options, cancellationToken); } #endregion #region ListAuditMitigationActionsExecutions /// <summary> /// Gets the status of audit mitigation action tasks that were executed. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAuditMitigationActionsExecutions service method.</param> /// /// <returns>The response from the ListAuditMitigationActionsExecutions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAuditMitigationActionsExecutions">REST API Reference for ListAuditMitigationActionsExecutions Operation</seealso> public virtual ListAuditMitigationActionsExecutionsResponse ListAuditMitigationActionsExecutions(ListAuditMitigationActionsExecutionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListAuditMitigationActionsExecutionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAuditMitigationActionsExecutionsResponseUnmarshaller.Instance; return Invoke<ListAuditMitigationActionsExecutionsResponse>(request, options); } /// <summary> /// Gets the status of audit mitigation action tasks that were executed. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAuditMitigationActionsExecutions 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 ListAuditMitigationActionsExecutions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAuditMitigationActionsExecutions">REST API Reference for ListAuditMitigationActionsExecutions Operation</seealso> public virtual Task<ListAuditMitigationActionsExecutionsResponse> ListAuditMitigationActionsExecutionsAsync(ListAuditMitigationActionsExecutionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListAuditMitigationActionsExecutionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAuditMitigationActionsExecutionsResponseUnmarshaller.Instance; return InvokeAsync<ListAuditMitigationActionsExecutionsResponse>(request, options, cancellationToken); } #endregion #region ListAuditMitigationActionsTasks /// <summary> /// Gets a list of audit mitigation action tasks that match the specified filters. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAuditMitigationActionsTasks service method.</param> /// /// <returns>The response from the ListAuditMitigationActionsTasks service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAuditMitigationActionsTasks">REST API Reference for ListAuditMitigationActionsTasks Operation</seealso> public virtual ListAuditMitigationActionsTasksResponse ListAuditMitigationActionsTasks(ListAuditMitigationActionsTasksRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListAuditMitigationActionsTasksRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAuditMitigationActionsTasksResponseUnmarshaller.Instance; return Invoke<ListAuditMitigationActionsTasksResponse>(request, options); } /// <summary> /// Gets a list of audit mitigation action tasks that match the specified filters. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAuditMitigationActionsTasks 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 ListAuditMitigationActionsTasks service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAuditMitigationActionsTasks">REST API Reference for ListAuditMitigationActionsTasks Operation</seealso> public virtual Task<ListAuditMitigationActionsTasksResponse> ListAuditMitigationActionsTasksAsync(ListAuditMitigationActionsTasksRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListAuditMitigationActionsTasksRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAuditMitigationActionsTasksResponseUnmarshaller.Instance; return InvokeAsync<ListAuditMitigationActionsTasksResponse>(request, options, cancellationToken); } #endregion #region ListAuditSuppressions /// <summary> /// Lists your Device Defender audit listings. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAuditSuppressions service method.</param> /// /// <returns>The response from the ListAuditSuppressions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAuditSuppressions">REST API Reference for ListAuditSuppressions Operation</seealso> public virtual ListAuditSuppressionsResponse ListAuditSuppressions(ListAuditSuppressionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListAuditSuppressionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAuditSuppressionsResponseUnmarshaller.Instance; return Invoke<ListAuditSuppressionsResponse>(request, options); } /// <summary> /// Lists your Device Defender audit listings. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAuditSuppressions 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 ListAuditSuppressions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAuditSuppressions">REST API Reference for ListAuditSuppressions Operation</seealso> public virtual Task<ListAuditSuppressionsResponse> ListAuditSuppressionsAsync(ListAuditSuppressionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListAuditSuppressionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAuditSuppressionsResponseUnmarshaller.Instance; return InvokeAsync<ListAuditSuppressionsResponse>(request, options, cancellationToken); } #endregion #region ListAuditTasks /// <summary> /// Lists the Device Defender audits that have been performed during a given time period. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAuditTasks service method.</param> /// /// <returns>The response from the ListAuditTasks service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAuditTasks">REST API Reference for ListAuditTasks Operation</seealso> public virtual ListAuditTasksResponse ListAuditTasks(ListAuditTasksRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListAuditTasksRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAuditTasksResponseUnmarshaller.Instance; return Invoke<ListAuditTasksResponse>(request, options); } /// <summary> /// Lists the Device Defender audits that have been performed during a given time period. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAuditTasks 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 ListAuditTasks service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAuditTasks">REST API Reference for ListAuditTasks Operation</seealso> public virtual Task<ListAuditTasksResponse> ListAuditTasksAsync(ListAuditTasksRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListAuditTasksRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAuditTasksResponseUnmarshaller.Instance; return InvokeAsync<ListAuditTasksResponse>(request, options, cancellationToken); } #endregion #region ListAuthorizers /// <summary> /// Lists the authorizers registered in your account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAuthorizers service method.</param> /// /// <returns>The response from the ListAuthorizers service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAuthorizers">REST API Reference for ListAuthorizers Operation</seealso> public virtual ListAuthorizersResponse ListAuthorizers(ListAuthorizersRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListAuthorizersRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAuthorizersResponseUnmarshaller.Instance; return Invoke<ListAuthorizersResponse>(request, options); } /// <summary> /// Lists the authorizers registered in your account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListAuthorizers 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 ListAuthorizers service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListAuthorizers">REST API Reference for ListAuthorizers Operation</seealso> public virtual Task<ListAuthorizersResponse> ListAuthorizersAsync(ListAuthorizersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListAuthorizersRequestMarshaller.Instance; options.ResponseUnmarshaller = ListAuthorizersResponseUnmarshaller.Instance; return InvokeAsync<ListAuthorizersResponse>(request, options, cancellationToken); } #endregion #region ListBillingGroups /// <summary> /// Lists the billing groups you have created. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListBillingGroups service method.</param> /// /// <returns>The response from the ListBillingGroups service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListBillingGroups">REST API Reference for ListBillingGroups Operation</seealso> public virtual ListBillingGroupsResponse ListBillingGroups(ListBillingGroupsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListBillingGroupsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListBillingGroupsResponseUnmarshaller.Instance; return Invoke<ListBillingGroupsResponse>(request, options); } /// <summary> /// Lists the billing groups you have created. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListBillingGroups 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 ListBillingGroups service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListBillingGroups">REST API Reference for ListBillingGroups Operation</seealso> public virtual Task<ListBillingGroupsResponse> ListBillingGroupsAsync(ListBillingGroupsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListBillingGroupsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListBillingGroupsResponseUnmarshaller.Instance; return InvokeAsync<ListBillingGroupsResponse>(request, options, cancellationToken); } #endregion #region ListCACertificates /// <summary> /// Lists the CA certificates registered for your AWS account. /// /// /// <para> /// The results are paginated with a default page size of 25. You can use the returned /// marker to retrieve additional results. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListCACertificates service method.</param> /// /// <returns>The response from the ListCACertificates service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListCACertificates">REST API Reference for ListCACertificates Operation</seealso> public virtual ListCACertificatesResponse ListCACertificates(ListCACertificatesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListCACertificatesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListCACertificatesResponseUnmarshaller.Instance; return Invoke<ListCACertificatesResponse>(request, options); } /// <summary> /// Lists the CA certificates registered for your AWS account. /// /// /// <para> /// The results are paginated with a default page size of 25. You can use the returned /// marker to retrieve additional results. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListCACertificates 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 ListCACertificates service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListCACertificates">REST API Reference for ListCACertificates Operation</seealso> public virtual Task<ListCACertificatesResponse> ListCACertificatesAsync(ListCACertificatesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListCACertificatesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListCACertificatesResponseUnmarshaller.Instance; return InvokeAsync<ListCACertificatesResponse>(request, options, cancellationToken); } #endregion #region ListCertificates /// <summary> /// Lists the certificates registered in your AWS account. /// /// /// <para> /// The results are paginated with a default page size of 25. You can use the returned /// marker to retrieve additional results. /// </para> /// </summary> /// /// <returns>The response from the ListCertificates service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListCertificates">REST API Reference for ListCertificates Operation</seealso> public virtual ListCertificatesResponse ListCertificates() { var request = new ListCertificatesRequest(); return ListCertificates(request); } /// <summary> /// Lists the certificates registered in your AWS account. /// /// /// <para> /// The results are paginated with a default page size of 25. You can use the returned /// marker to retrieve additional results. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListCertificates service method.</param> /// /// <returns>The response from the ListCertificates service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListCertificates">REST API Reference for ListCertificates Operation</seealso> public virtual ListCertificatesResponse ListCertificates(ListCertificatesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListCertificatesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListCertificatesResponseUnmarshaller.Instance; return Invoke<ListCertificatesResponse>(request, options); } /// <summary> /// Lists the certificates registered in your AWS account. /// /// /// <para> /// The results are paginated with a default page size of 25. You can use the returned /// marker to retrieve additional results. /// </para> /// </summary> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListCertificates service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListCertificates">REST API Reference for ListCertificates Operation</seealso> public virtual Task<ListCertificatesResponse> ListCertificatesAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new ListCertificatesRequest(); return ListCertificatesAsync(request, cancellationToken); } /// <summary> /// Lists the certificates registered in your AWS account. /// /// /// <para> /// The results are paginated with a default page size of 25. You can use the returned /// marker to retrieve additional results. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListCertificates 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 ListCertificates service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListCertificates">REST API Reference for ListCertificates Operation</seealso> public virtual Task<ListCertificatesResponse> ListCertificatesAsync(ListCertificatesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListCertificatesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListCertificatesResponseUnmarshaller.Instance; return InvokeAsync<ListCertificatesResponse>(request, options, cancellationToken); } #endregion #region ListCertificatesByCA /// <summary> /// List the device certificates signed by the specified CA certificate. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListCertificatesByCA service method.</param> /// /// <returns>The response from the ListCertificatesByCA service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListCertificatesByCA">REST API Reference for ListCertificatesByCA Operation</seealso> public virtual ListCertificatesByCAResponse ListCertificatesByCA(ListCertificatesByCARequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListCertificatesByCARequestMarshaller.Instance; options.ResponseUnmarshaller = ListCertificatesByCAResponseUnmarshaller.Instance; return Invoke<ListCertificatesByCAResponse>(request, options); } /// <summary> /// List the device certificates signed by the specified CA certificate. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListCertificatesByCA 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 ListCertificatesByCA service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListCertificatesByCA">REST API Reference for ListCertificatesByCA Operation</seealso> public virtual Task<ListCertificatesByCAResponse> ListCertificatesByCAAsync(ListCertificatesByCARequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListCertificatesByCARequestMarshaller.Instance; options.ResponseUnmarshaller = ListCertificatesByCAResponseUnmarshaller.Instance; return InvokeAsync<ListCertificatesByCAResponse>(request, options, cancellationToken); } #endregion #region ListDimensions /// <summary> /// List the set of dimensions that are defined for your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListDimensions service method.</param> /// /// <returns>The response from the ListDimensions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListDimensions">REST API Reference for ListDimensions Operation</seealso> public virtual ListDimensionsResponse ListDimensions(ListDimensionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListDimensionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListDimensionsResponseUnmarshaller.Instance; return Invoke<ListDimensionsResponse>(request, options); } /// <summary> /// List the set of dimensions that are defined for your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListDimensions 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 ListDimensions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListDimensions">REST API Reference for ListDimensions Operation</seealso> public virtual Task<ListDimensionsResponse> ListDimensionsAsync(ListDimensionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListDimensionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListDimensionsResponseUnmarshaller.Instance; return InvokeAsync<ListDimensionsResponse>(request, options, cancellationToken); } #endregion #region ListDomainConfigurations /// <summary> /// Gets a list of domain configurations for the user. This list is sorted alphabetically /// by domain configuration name. /// /// <note> /// <para> /// The domain configuration feature is in public preview and is subject to change. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListDomainConfigurations service method.</param> /// /// <returns>The response from the ListDomainConfigurations service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListDomainConfigurations">REST API Reference for ListDomainConfigurations Operation</seealso> public virtual ListDomainConfigurationsResponse ListDomainConfigurations(ListDomainConfigurationsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListDomainConfigurationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListDomainConfigurationsResponseUnmarshaller.Instance; return Invoke<ListDomainConfigurationsResponse>(request, options); } /// <summary> /// Gets a list of domain configurations for the user. This list is sorted alphabetically /// by domain configuration name. /// /// <note> /// <para> /// The domain configuration feature is in public preview and is subject to change. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListDomainConfigurations 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 ListDomainConfigurations service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListDomainConfigurations">REST API Reference for ListDomainConfigurations Operation</seealso> public virtual Task<ListDomainConfigurationsResponse> ListDomainConfigurationsAsync(ListDomainConfigurationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListDomainConfigurationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListDomainConfigurationsResponseUnmarshaller.Instance; return InvokeAsync<ListDomainConfigurationsResponse>(request, options, cancellationToken); } #endregion #region ListIndices /// <summary> /// Lists the search indices. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListIndices service method.</param> /// /// <returns>The response from the ListIndices service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListIndices">REST API Reference for ListIndices Operation</seealso> public virtual ListIndicesResponse ListIndices(ListIndicesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListIndicesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListIndicesResponseUnmarshaller.Instance; return Invoke<ListIndicesResponse>(request, options); } /// <summary> /// Lists the search indices. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListIndices 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 ListIndices service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListIndices">REST API Reference for ListIndices Operation</seealso> public virtual Task<ListIndicesResponse> ListIndicesAsync(ListIndicesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListIndicesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListIndicesResponseUnmarshaller.Instance; return InvokeAsync<ListIndicesResponse>(request, options, cancellationToken); } #endregion #region ListJobExecutionsForJob /// <summary> /// Lists the job executions for a job. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListJobExecutionsForJob service method.</param> /// /// <returns>The response from the ListJobExecutionsForJob service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListJobExecutionsForJob">REST API Reference for ListJobExecutionsForJob Operation</seealso> public virtual ListJobExecutionsForJobResponse ListJobExecutionsForJob(ListJobExecutionsForJobRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListJobExecutionsForJobRequestMarshaller.Instance; options.ResponseUnmarshaller = ListJobExecutionsForJobResponseUnmarshaller.Instance; return Invoke<ListJobExecutionsForJobResponse>(request, options); } /// <summary> /// Lists the job executions for a job. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListJobExecutionsForJob 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 ListJobExecutionsForJob service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListJobExecutionsForJob">REST API Reference for ListJobExecutionsForJob Operation</seealso> public virtual Task<ListJobExecutionsForJobResponse> ListJobExecutionsForJobAsync(ListJobExecutionsForJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListJobExecutionsForJobRequestMarshaller.Instance; options.ResponseUnmarshaller = ListJobExecutionsForJobResponseUnmarshaller.Instance; return InvokeAsync<ListJobExecutionsForJobResponse>(request, options, cancellationToken); } #endregion #region ListJobExecutionsForThing /// <summary> /// Lists the job executions for the specified thing. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListJobExecutionsForThing service method.</param> /// /// <returns>The response from the ListJobExecutionsForThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListJobExecutionsForThing">REST API Reference for ListJobExecutionsForThing Operation</seealso> public virtual ListJobExecutionsForThingResponse ListJobExecutionsForThing(ListJobExecutionsForThingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListJobExecutionsForThingRequestMarshaller.Instance; options.ResponseUnmarshaller = ListJobExecutionsForThingResponseUnmarshaller.Instance; return Invoke<ListJobExecutionsForThingResponse>(request, options); } /// <summary> /// Lists the job executions for the specified thing. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListJobExecutionsForThing 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 ListJobExecutionsForThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListJobExecutionsForThing">REST API Reference for ListJobExecutionsForThing Operation</seealso> public virtual Task<ListJobExecutionsForThingResponse> ListJobExecutionsForThingAsync(ListJobExecutionsForThingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListJobExecutionsForThingRequestMarshaller.Instance; options.ResponseUnmarshaller = ListJobExecutionsForThingResponseUnmarshaller.Instance; return InvokeAsync<ListJobExecutionsForThingResponse>(request, options, cancellationToken); } #endregion #region ListJobs /// <summary> /// Lists jobs. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListJobs service method.</param> /// /// <returns>The response from the ListJobs service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListJobs">REST API Reference for ListJobs Operation</seealso> public virtual ListJobsResponse ListJobs(ListJobsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListJobsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListJobsResponseUnmarshaller.Instance; return Invoke<ListJobsResponse>(request, options); } /// <summary> /// Lists jobs. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListJobs service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListJobs service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListJobs">REST API Reference for ListJobs Operation</seealso> public virtual Task<ListJobsResponse> ListJobsAsync(ListJobsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListJobsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListJobsResponseUnmarshaller.Instance; return InvokeAsync<ListJobsResponse>(request, options, cancellationToken); } #endregion #region ListMitigationActions /// <summary> /// Gets a list of all mitigation actions that match the specified filter criteria. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListMitigationActions service method.</param> /// /// <returns>The response from the ListMitigationActions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListMitigationActions">REST API Reference for ListMitigationActions Operation</seealso> public virtual ListMitigationActionsResponse ListMitigationActions(ListMitigationActionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListMitigationActionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListMitigationActionsResponseUnmarshaller.Instance; return Invoke<ListMitigationActionsResponse>(request, options); } /// <summary> /// Gets a list of all mitigation actions that match the specified filter criteria. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListMitigationActions 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 ListMitigationActions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListMitigationActions">REST API Reference for ListMitigationActions Operation</seealso> public virtual Task<ListMitigationActionsResponse> ListMitigationActionsAsync(ListMitigationActionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListMitigationActionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListMitigationActionsResponseUnmarshaller.Instance; return InvokeAsync<ListMitigationActionsResponse>(request, options, cancellationToken); } #endregion #region ListOTAUpdates /// <summary> /// Lists OTA updates. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListOTAUpdates service method.</param> /// /// <returns>The response from the ListOTAUpdates service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListOTAUpdates">REST API Reference for ListOTAUpdates Operation</seealso> public virtual ListOTAUpdatesResponse ListOTAUpdates(ListOTAUpdatesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListOTAUpdatesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListOTAUpdatesResponseUnmarshaller.Instance; return Invoke<ListOTAUpdatesResponse>(request, options); } /// <summary> /// Lists OTA updates. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListOTAUpdates 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 ListOTAUpdates service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListOTAUpdates">REST API Reference for ListOTAUpdates Operation</seealso> public virtual Task<ListOTAUpdatesResponse> ListOTAUpdatesAsync(ListOTAUpdatesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListOTAUpdatesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListOTAUpdatesResponseUnmarshaller.Instance; return InvokeAsync<ListOTAUpdatesResponse>(request, options, cancellationToken); } #endregion #region ListOutgoingCertificates /// <summary> /// Lists certificates that are being transferred but not yet accepted. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListOutgoingCertificates service method.</param> /// /// <returns>The response from the ListOutgoingCertificates service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListOutgoingCertificates">REST API Reference for ListOutgoingCertificates Operation</seealso> public virtual ListOutgoingCertificatesResponse ListOutgoingCertificates(ListOutgoingCertificatesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListOutgoingCertificatesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListOutgoingCertificatesResponseUnmarshaller.Instance; return Invoke<ListOutgoingCertificatesResponse>(request, options); } /// <summary> /// Lists certificates that are being transferred but not yet accepted. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListOutgoingCertificates 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 ListOutgoingCertificates service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListOutgoingCertificates">REST API Reference for ListOutgoingCertificates Operation</seealso> public virtual Task<ListOutgoingCertificatesResponse> ListOutgoingCertificatesAsync(ListOutgoingCertificatesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListOutgoingCertificatesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListOutgoingCertificatesResponseUnmarshaller.Instance; return InvokeAsync<ListOutgoingCertificatesResponse>(request, options, cancellationToken); } #endregion #region ListPolicies /// <summary> /// Lists your policies. /// </summary> /// /// <returns>The response from the ListPolicies service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPolicies">REST API Reference for ListPolicies Operation</seealso> public virtual ListPoliciesResponse ListPolicies() { var request = new ListPoliciesRequest(); return ListPolicies(request); } /// <summary> /// Lists your policies. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListPolicies service method.</param> /// /// <returns>The response from the ListPolicies service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPolicies">REST API Reference for ListPolicies Operation</seealso> public virtual ListPoliciesResponse ListPolicies(ListPoliciesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListPoliciesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPoliciesResponseUnmarshaller.Instance; return Invoke<ListPoliciesResponse>(request, options); } /// <summary> /// Lists your policies. /// </summary> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListPolicies service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPolicies">REST API Reference for ListPolicies Operation</seealso> public virtual Task<ListPoliciesResponse> ListPoliciesAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new ListPoliciesRequest(); return ListPoliciesAsync(request, cancellationToken); } /// <summary> /// Lists your policies. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListPolicies 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 ListPolicies service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPolicies">REST API Reference for ListPolicies Operation</seealso> public virtual Task<ListPoliciesResponse> ListPoliciesAsync(ListPoliciesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListPoliciesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPoliciesResponseUnmarshaller.Instance; return InvokeAsync<ListPoliciesResponse>(request, options, cancellationToken); } #endregion #region ListPolicyPrincipals /// <summary> /// Lists the principals associated with the specified policy. /// /// /// <para> /// <b>Note:</b> This API is deprecated. Please use <a>ListTargetsForPolicy</a> instead. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListPolicyPrincipals service method.</param> /// /// <returns>The response from the ListPolicyPrincipals service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPolicyPrincipals">REST API Reference for ListPolicyPrincipals Operation</seealso> [Obsolete("Deprecated in favor of ListTargetsForPolicy.")] public virtual ListPolicyPrincipalsResponse ListPolicyPrincipals(ListPolicyPrincipalsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListPolicyPrincipalsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPolicyPrincipalsResponseUnmarshaller.Instance; return Invoke<ListPolicyPrincipalsResponse>(request, options); } /// <summary> /// Lists the principals associated with the specified policy. /// /// /// <para> /// <b>Note:</b> This API is deprecated. Please use <a>ListTargetsForPolicy</a> instead. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListPolicyPrincipals 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 ListPolicyPrincipals service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPolicyPrincipals">REST API Reference for ListPolicyPrincipals Operation</seealso> [Obsolete("Deprecated in favor of ListTargetsForPolicy.")] public virtual Task<ListPolicyPrincipalsResponse> ListPolicyPrincipalsAsync(ListPolicyPrincipalsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListPolicyPrincipalsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPolicyPrincipalsResponseUnmarshaller.Instance; return InvokeAsync<ListPolicyPrincipalsResponse>(request, options, cancellationToken); } #endregion #region ListPolicyVersions /// <summary> /// Lists the versions of the specified policy and identifies the default version. /// </summary> /// <param name="policyName">The policy name.</param> /// /// <returns>The response from the ListPolicyVersions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPolicyVersions">REST API Reference for ListPolicyVersions Operation</seealso> public virtual ListPolicyVersionsResponse ListPolicyVersions(string policyName) { var request = new ListPolicyVersionsRequest(); request.PolicyName = policyName; return ListPolicyVersions(request); } /// <summary> /// Lists the versions of the specified policy and identifies the default version. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListPolicyVersions service method.</param> /// /// <returns>The response from the ListPolicyVersions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPolicyVersions">REST API Reference for ListPolicyVersions Operation</seealso> public virtual ListPolicyVersionsResponse ListPolicyVersions(ListPolicyVersionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListPolicyVersionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPolicyVersionsResponseUnmarshaller.Instance; return Invoke<ListPolicyVersionsResponse>(request, options); } /// <summary> /// Lists the versions of the specified policy and identifies the default version. /// </summary> /// <param name="policyName">The policy name.</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 ListPolicyVersions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPolicyVersions">REST API Reference for ListPolicyVersions Operation</seealso> public virtual Task<ListPolicyVersionsResponse> ListPolicyVersionsAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new ListPolicyVersionsRequest(); request.PolicyName = policyName; return ListPolicyVersionsAsync(request, cancellationToken); } /// <summary> /// Lists the versions of the specified policy and identifies the default version. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListPolicyVersions 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 ListPolicyVersions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPolicyVersions">REST API Reference for ListPolicyVersions Operation</seealso> public virtual Task<ListPolicyVersionsResponse> ListPolicyVersionsAsync(ListPolicyVersionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListPolicyVersionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPolicyVersionsResponseUnmarshaller.Instance; return InvokeAsync<ListPolicyVersionsResponse>(request, options, cancellationToken); } #endregion #region ListPrincipalPolicies /// <summary> /// Lists the policies attached to the specified principal. If you use an Cognito identity, /// the ID must be in <a href="https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetCredentialsForIdentity.html#API_GetCredentialsForIdentity_RequestSyntax">AmazonCognito /// Identity format</a>. /// /// /// <para> /// <b>Note:</b> This API is deprecated. Please use <a>ListAttachedPolicies</a> instead. /// </para> /// </summary> /// <param name="principal">The principal. Valid principals are CertificateArn (arn:aws:iot:<i>region</i>:<i>accountId</i>:cert/<i>certificateId</i>), thingGroupArn (arn:aws:iot:<i>region</i>:<i>accountId</i>:thinggroup/<i>groupName</i>) and CognitoId (<i>region</i>:<i>id</i>).</param> /// /// <returns>The response from the ListPrincipalPolicies service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPrincipalPolicies">REST API Reference for ListPrincipalPolicies Operation</seealso> [Obsolete("Deprecated in favor of ListAttachedPolicies.")] public virtual ListPrincipalPoliciesResponse ListPrincipalPolicies(string principal) { var request = new ListPrincipalPoliciesRequest(); request.Principal = principal; return ListPrincipalPolicies(request); } /// <summary> /// Lists the policies attached to the specified principal. If you use an Cognito identity, /// the ID must be in <a href="https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetCredentialsForIdentity.html#API_GetCredentialsForIdentity_RequestSyntax">AmazonCognito /// Identity format</a>. /// /// /// <para> /// <b>Note:</b> This API is deprecated. Please use <a>ListAttachedPolicies</a> instead. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListPrincipalPolicies service method.</param> /// /// <returns>The response from the ListPrincipalPolicies service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPrincipalPolicies">REST API Reference for ListPrincipalPolicies Operation</seealso> [Obsolete("Deprecated in favor of ListAttachedPolicies.")] public virtual ListPrincipalPoliciesResponse ListPrincipalPolicies(ListPrincipalPoliciesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListPrincipalPoliciesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPrincipalPoliciesResponseUnmarshaller.Instance; return Invoke<ListPrincipalPoliciesResponse>(request, options); } /// <summary> /// Lists the policies attached to the specified principal. If you use an Cognito identity, /// the ID must be in <a href="https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetCredentialsForIdentity.html#API_GetCredentialsForIdentity_RequestSyntax">AmazonCognito /// Identity format</a>. /// /// /// <para> /// <b>Note:</b> This API is deprecated. Please use <a>ListAttachedPolicies</a> instead. /// </para> /// </summary> /// <param name="principal">The principal. Valid principals are CertificateArn (arn:aws:iot:<i>region</i>:<i>accountId</i>:cert/<i>certificateId</i>), thingGroupArn (arn:aws:iot:<i>region</i>:<i>accountId</i>:thinggroup/<i>groupName</i>) and CognitoId (<i>region</i>:<i>id</i>).</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 ListPrincipalPolicies service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPrincipalPolicies">REST API Reference for ListPrincipalPolicies Operation</seealso> [Obsolete("Deprecated in favor of ListAttachedPolicies.")] public virtual Task<ListPrincipalPoliciesResponse> ListPrincipalPoliciesAsync(string principal, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new ListPrincipalPoliciesRequest(); request.Principal = principal; return ListPrincipalPoliciesAsync(request, cancellationToken); } /// <summary> /// Lists the policies attached to the specified principal. If you use an Cognito identity, /// the ID must be in <a href="https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetCredentialsForIdentity.html#API_GetCredentialsForIdentity_RequestSyntax">AmazonCognito /// Identity format</a>. /// /// /// <para> /// <b>Note:</b> This API is deprecated. Please use <a>ListAttachedPolicies</a> instead. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListPrincipalPolicies 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 ListPrincipalPolicies service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPrincipalPolicies">REST API Reference for ListPrincipalPolicies Operation</seealso> [Obsolete("Deprecated in favor of ListAttachedPolicies.")] public virtual Task<ListPrincipalPoliciesResponse> ListPrincipalPoliciesAsync(ListPrincipalPoliciesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListPrincipalPoliciesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPrincipalPoliciesResponseUnmarshaller.Instance; return InvokeAsync<ListPrincipalPoliciesResponse>(request, options, cancellationToken); } #endregion #region ListPrincipalThings /// <summary> /// Lists the things associated with the specified principal. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// </summary> /// <param name="principal">The principal.</param> /// /// <returns>The response from the ListPrincipalThings service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPrincipalThings">REST API Reference for ListPrincipalThings Operation</seealso> public virtual ListPrincipalThingsResponse ListPrincipalThings(string principal) { var request = new ListPrincipalThingsRequest(); request.Principal = principal; return ListPrincipalThings(request); } /// <summary> /// Lists the things associated with the specified principal. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListPrincipalThings service method.</param> /// /// <returns>The response from the ListPrincipalThings service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPrincipalThings">REST API Reference for ListPrincipalThings Operation</seealso> public virtual ListPrincipalThingsResponse ListPrincipalThings(ListPrincipalThingsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListPrincipalThingsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPrincipalThingsResponseUnmarshaller.Instance; return Invoke<ListPrincipalThingsResponse>(request, options); } /// <summary> /// Lists the things associated with the specified principal. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// </summary> /// <param name="principal">The principal.</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 ListPrincipalThings service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPrincipalThings">REST API Reference for ListPrincipalThings Operation</seealso> public virtual Task<ListPrincipalThingsResponse> ListPrincipalThingsAsync(string principal, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new ListPrincipalThingsRequest(); request.Principal = principal; return ListPrincipalThingsAsync(request, cancellationToken); } /// <summary> /// Lists the things associated with the specified principal. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListPrincipalThings 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 ListPrincipalThings service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPrincipalThings">REST API Reference for ListPrincipalThings Operation</seealso> public virtual Task<ListPrincipalThingsResponse> ListPrincipalThingsAsync(ListPrincipalThingsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListPrincipalThingsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListPrincipalThingsResponseUnmarshaller.Instance; return InvokeAsync<ListPrincipalThingsResponse>(request, options, cancellationToken); } #endregion #region ListProvisioningTemplates /// <summary> /// Lists the fleet provisioning templates in your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListProvisioningTemplates service method.</param> /// /// <returns>The response from the ListProvisioningTemplates service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListProvisioningTemplates">REST API Reference for ListProvisioningTemplates Operation</seealso> public virtual ListProvisioningTemplatesResponse ListProvisioningTemplates(ListProvisioningTemplatesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListProvisioningTemplatesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListProvisioningTemplatesResponseUnmarshaller.Instance; return Invoke<ListProvisioningTemplatesResponse>(request, options); } /// <summary> /// Lists the fleet provisioning templates in your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListProvisioningTemplates 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 ListProvisioningTemplates service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListProvisioningTemplates">REST API Reference for ListProvisioningTemplates Operation</seealso> public virtual Task<ListProvisioningTemplatesResponse> ListProvisioningTemplatesAsync(ListProvisioningTemplatesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListProvisioningTemplatesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListProvisioningTemplatesResponseUnmarshaller.Instance; return InvokeAsync<ListProvisioningTemplatesResponse>(request, options, cancellationToken); } #endregion #region ListProvisioningTemplateVersions /// <summary> /// A list of fleet provisioning template versions. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListProvisioningTemplateVersions service method.</param> /// /// <returns>The response from the ListProvisioningTemplateVersions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListProvisioningTemplateVersions">REST API Reference for ListProvisioningTemplateVersions Operation</seealso> public virtual ListProvisioningTemplateVersionsResponse ListProvisioningTemplateVersions(ListProvisioningTemplateVersionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListProvisioningTemplateVersionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListProvisioningTemplateVersionsResponseUnmarshaller.Instance; return Invoke<ListProvisioningTemplateVersionsResponse>(request, options); } /// <summary> /// A list of fleet provisioning template versions. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListProvisioningTemplateVersions 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 ListProvisioningTemplateVersions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListProvisioningTemplateVersions">REST API Reference for ListProvisioningTemplateVersions Operation</seealso> public virtual Task<ListProvisioningTemplateVersionsResponse> ListProvisioningTemplateVersionsAsync(ListProvisioningTemplateVersionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListProvisioningTemplateVersionsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListProvisioningTemplateVersionsResponseUnmarshaller.Instance; return InvokeAsync<ListProvisioningTemplateVersionsResponse>(request, options, cancellationToken); } #endregion #region ListRoleAliases /// <summary> /// Lists the role aliases registered in your account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListRoleAliases service method.</param> /// /// <returns>The response from the ListRoleAliases service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListRoleAliases">REST API Reference for ListRoleAliases Operation</seealso> public virtual ListRoleAliasesResponse ListRoleAliases(ListRoleAliasesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListRoleAliasesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListRoleAliasesResponseUnmarshaller.Instance; return Invoke<ListRoleAliasesResponse>(request, options); } /// <summary> /// Lists the role aliases registered in your account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListRoleAliases 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 ListRoleAliases service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListRoleAliases">REST API Reference for ListRoleAliases Operation</seealso> public virtual Task<ListRoleAliasesResponse> ListRoleAliasesAsync(ListRoleAliasesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListRoleAliasesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListRoleAliasesResponseUnmarshaller.Instance; return InvokeAsync<ListRoleAliasesResponse>(request, options, cancellationToken); } #endregion #region ListScheduledAudits /// <summary> /// Lists all of your scheduled audits. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListScheduledAudits service method.</param> /// /// <returns>The response from the ListScheduledAudits service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListScheduledAudits">REST API Reference for ListScheduledAudits Operation</seealso> public virtual ListScheduledAuditsResponse ListScheduledAudits(ListScheduledAuditsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListScheduledAuditsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListScheduledAuditsResponseUnmarshaller.Instance; return Invoke<ListScheduledAuditsResponse>(request, options); } /// <summary> /// Lists all of your scheduled audits. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListScheduledAudits 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 ListScheduledAudits service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListScheduledAudits">REST API Reference for ListScheduledAudits Operation</seealso> public virtual Task<ListScheduledAuditsResponse> ListScheduledAuditsAsync(ListScheduledAuditsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListScheduledAuditsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListScheduledAuditsResponseUnmarshaller.Instance; return InvokeAsync<ListScheduledAuditsResponse>(request, options, cancellationToken); } #endregion #region ListSecurityProfiles /// <summary> /// Lists the Device Defender security profiles you have created. You can use filters /// to list only those security profiles associated with a thing group or only those associated /// with your account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListSecurityProfiles service method.</param> /// /// <returns>The response from the ListSecurityProfiles service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListSecurityProfiles">REST API Reference for ListSecurityProfiles Operation</seealso> public virtual ListSecurityProfilesResponse ListSecurityProfiles(ListSecurityProfilesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListSecurityProfilesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListSecurityProfilesResponseUnmarshaller.Instance; return Invoke<ListSecurityProfilesResponse>(request, options); } /// <summary> /// Lists the Device Defender security profiles you have created. You can use filters /// to list only those security profiles associated with a thing group or only those associated /// with your account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListSecurityProfiles 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 ListSecurityProfiles service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListSecurityProfiles">REST API Reference for ListSecurityProfiles Operation</seealso> public virtual Task<ListSecurityProfilesResponse> ListSecurityProfilesAsync(ListSecurityProfilesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListSecurityProfilesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListSecurityProfilesResponseUnmarshaller.Instance; return InvokeAsync<ListSecurityProfilesResponse>(request, options, cancellationToken); } #endregion #region ListSecurityProfilesForTarget /// <summary> /// Lists the Device Defender security profiles attached to a target (thing group). /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListSecurityProfilesForTarget service method.</param> /// /// <returns>The response from the ListSecurityProfilesForTarget service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListSecurityProfilesForTarget">REST API Reference for ListSecurityProfilesForTarget Operation</seealso> public virtual ListSecurityProfilesForTargetResponse ListSecurityProfilesForTarget(ListSecurityProfilesForTargetRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListSecurityProfilesForTargetRequestMarshaller.Instance; options.ResponseUnmarshaller = ListSecurityProfilesForTargetResponseUnmarshaller.Instance; return Invoke<ListSecurityProfilesForTargetResponse>(request, options); } /// <summary> /// Lists the Device Defender security profiles attached to a target (thing group). /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListSecurityProfilesForTarget 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 ListSecurityProfilesForTarget service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListSecurityProfilesForTarget">REST API Reference for ListSecurityProfilesForTarget Operation</seealso> public virtual Task<ListSecurityProfilesForTargetResponse> ListSecurityProfilesForTargetAsync(ListSecurityProfilesForTargetRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListSecurityProfilesForTargetRequestMarshaller.Instance; options.ResponseUnmarshaller = ListSecurityProfilesForTargetResponseUnmarshaller.Instance; return InvokeAsync<ListSecurityProfilesForTargetResponse>(request, options, cancellationToken); } #endregion #region ListStreams /// <summary> /// Lists all of the streams in your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListStreams service method.</param> /// /// <returns>The response from the ListStreams service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListStreams">REST API Reference for ListStreams Operation</seealso> public virtual ListStreamsResponse ListStreams(ListStreamsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListStreamsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListStreamsResponseUnmarshaller.Instance; return Invoke<ListStreamsResponse>(request, options); } /// <summary> /// Lists all of the streams in your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListStreams 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 ListStreams service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListStreams">REST API Reference for ListStreams Operation</seealso> public virtual Task<ListStreamsResponse> ListStreamsAsync(ListStreamsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListStreamsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListStreamsResponseUnmarshaller.Instance; return InvokeAsync<ListStreamsResponse>(request, options, cancellationToken); } #endregion #region ListTagsForResource /// <summary> /// Lists the tags (metadata) you have assigned to the resource. /// </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 IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/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> /// Lists the tags (metadata) you have assigned to the resource. /// </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 IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/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 ListTargetsForPolicy /// <summary> /// List targets for the specified policy. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListTargetsForPolicy service method.</param> /// /// <returns>The response from the ListTargetsForPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListTargetsForPolicy">REST API Reference for ListTargetsForPolicy Operation</seealso> public virtual ListTargetsForPolicyResponse ListTargetsForPolicy(ListTargetsForPolicyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListTargetsForPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTargetsForPolicyResponseUnmarshaller.Instance; return Invoke<ListTargetsForPolicyResponse>(request, options); } /// <summary> /// List targets for the specified policy. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListTargetsForPolicy 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 ListTargetsForPolicy service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListTargetsForPolicy">REST API Reference for ListTargetsForPolicy Operation</seealso> public virtual Task<ListTargetsForPolicyResponse> ListTargetsForPolicyAsync(ListTargetsForPolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListTargetsForPolicyRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTargetsForPolicyResponseUnmarshaller.Instance; return InvokeAsync<ListTargetsForPolicyResponse>(request, options, cancellationToken); } #endregion #region ListTargetsForSecurityProfile /// <summary> /// Lists the targets (thing groups) associated with a given Device Defender security /// profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListTargetsForSecurityProfile service method.</param> /// /// <returns>The response from the ListTargetsForSecurityProfile service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListTargetsForSecurityProfile">REST API Reference for ListTargetsForSecurityProfile Operation</seealso> public virtual ListTargetsForSecurityProfileResponse ListTargetsForSecurityProfile(ListTargetsForSecurityProfileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListTargetsForSecurityProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTargetsForSecurityProfileResponseUnmarshaller.Instance; return Invoke<ListTargetsForSecurityProfileResponse>(request, options); } /// <summary> /// Lists the targets (thing groups) associated with a given Device Defender security /// profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListTargetsForSecurityProfile 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 ListTargetsForSecurityProfile service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListTargetsForSecurityProfile">REST API Reference for ListTargetsForSecurityProfile Operation</seealso> public virtual Task<ListTargetsForSecurityProfileResponse> ListTargetsForSecurityProfileAsync(ListTargetsForSecurityProfileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListTargetsForSecurityProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTargetsForSecurityProfileResponseUnmarshaller.Instance; return InvokeAsync<ListTargetsForSecurityProfileResponse>(request, options, cancellationToken); } #endregion #region ListThingGroups /// <summary> /// List the thing groups in your account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingGroups service method.</param> /// /// <returns>The response from the ListThingGroups service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingGroups">REST API Reference for ListThingGroups Operation</seealso> public virtual ListThingGroupsResponse ListThingGroups(ListThingGroupsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingGroupsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingGroupsResponseUnmarshaller.Instance; return Invoke<ListThingGroupsResponse>(request, options); } /// <summary> /// List the thing groups in your account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingGroups 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 ListThingGroups service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingGroups">REST API Reference for ListThingGroups Operation</seealso> public virtual Task<ListThingGroupsResponse> ListThingGroupsAsync(ListThingGroupsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingGroupsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingGroupsResponseUnmarshaller.Instance; return InvokeAsync<ListThingGroupsResponse>(request, options, cancellationToken); } #endregion #region ListThingGroupsForThing /// <summary> /// List the thing groups to which the specified thing belongs. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingGroupsForThing service method.</param> /// /// <returns>The response from the ListThingGroupsForThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingGroupsForThing">REST API Reference for ListThingGroupsForThing Operation</seealso> public virtual ListThingGroupsForThingResponse ListThingGroupsForThing(ListThingGroupsForThingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingGroupsForThingRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingGroupsForThingResponseUnmarshaller.Instance; return Invoke<ListThingGroupsForThingResponse>(request, options); } /// <summary> /// List the thing groups to which the specified thing belongs. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingGroupsForThing 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 ListThingGroupsForThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingGroupsForThing">REST API Reference for ListThingGroupsForThing Operation</seealso> public virtual Task<ListThingGroupsForThingResponse> ListThingGroupsForThingAsync(ListThingGroupsForThingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingGroupsForThingRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingGroupsForThingResponseUnmarshaller.Instance; return InvokeAsync<ListThingGroupsForThingResponse>(request, options, cancellationToken); } #endregion #region ListThingPrincipals /// <summary> /// Lists the principals associated with the specified thing. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// </summary> /// <param name="thingName">The name of the thing.</param> /// /// <returns>The response from the ListThingPrincipals service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingPrincipals">REST API Reference for ListThingPrincipals Operation</seealso> public virtual ListThingPrincipalsResponse ListThingPrincipals(string thingName) { var request = new ListThingPrincipalsRequest(); request.ThingName = thingName; return ListThingPrincipals(request); } /// <summary> /// Lists the principals associated with the specified thing. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingPrincipals service method.</param> /// /// <returns>The response from the ListThingPrincipals service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingPrincipals">REST API Reference for ListThingPrincipals Operation</seealso> public virtual ListThingPrincipalsResponse ListThingPrincipals(ListThingPrincipalsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingPrincipalsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingPrincipalsResponseUnmarshaller.Instance; return Invoke<ListThingPrincipalsResponse>(request, options); } /// <summary> /// Lists the principals associated with the specified thing. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// </summary> /// <param name="thingName">The name of the thing.</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 ListThingPrincipals service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingPrincipals">REST API Reference for ListThingPrincipals Operation</seealso> public virtual Task<ListThingPrincipalsResponse> ListThingPrincipalsAsync(string thingName, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new ListThingPrincipalsRequest(); request.ThingName = thingName; return ListThingPrincipalsAsync(request, cancellationToken); } /// <summary> /// Lists the principals associated with the specified thing. A principal can be X.509 /// certificates, IAM users, groups, and roles, Amazon Cognito identities or federated /// identities. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingPrincipals 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 ListThingPrincipals service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingPrincipals">REST API Reference for ListThingPrincipals Operation</seealso> public virtual Task<ListThingPrincipalsResponse> ListThingPrincipalsAsync(ListThingPrincipalsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingPrincipalsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingPrincipalsResponseUnmarshaller.Instance; return InvokeAsync<ListThingPrincipalsResponse>(request, options, cancellationToken); } #endregion #region ListThingRegistrationTaskReports /// <summary> /// Information about the thing registration tasks. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingRegistrationTaskReports service method.</param> /// /// <returns>The response from the ListThingRegistrationTaskReports service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingRegistrationTaskReports">REST API Reference for ListThingRegistrationTaskReports Operation</seealso> public virtual ListThingRegistrationTaskReportsResponse ListThingRegistrationTaskReports(ListThingRegistrationTaskReportsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingRegistrationTaskReportsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingRegistrationTaskReportsResponseUnmarshaller.Instance; return Invoke<ListThingRegistrationTaskReportsResponse>(request, options); } /// <summary> /// Information about the thing registration tasks. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingRegistrationTaskReports 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 ListThingRegistrationTaskReports service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingRegistrationTaskReports">REST API Reference for ListThingRegistrationTaskReports Operation</seealso> public virtual Task<ListThingRegistrationTaskReportsResponse> ListThingRegistrationTaskReportsAsync(ListThingRegistrationTaskReportsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingRegistrationTaskReportsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingRegistrationTaskReportsResponseUnmarshaller.Instance; return InvokeAsync<ListThingRegistrationTaskReportsResponse>(request, options, cancellationToken); } #endregion #region ListThingRegistrationTasks /// <summary> /// List bulk thing provisioning tasks. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingRegistrationTasks service method.</param> /// /// <returns>The response from the ListThingRegistrationTasks service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingRegistrationTasks">REST API Reference for ListThingRegistrationTasks Operation</seealso> public virtual ListThingRegistrationTasksResponse ListThingRegistrationTasks(ListThingRegistrationTasksRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingRegistrationTasksRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingRegistrationTasksResponseUnmarshaller.Instance; return Invoke<ListThingRegistrationTasksResponse>(request, options); } /// <summary> /// List bulk thing provisioning tasks. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingRegistrationTasks 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 ListThingRegistrationTasks service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingRegistrationTasks">REST API Reference for ListThingRegistrationTasks Operation</seealso> public virtual Task<ListThingRegistrationTasksResponse> ListThingRegistrationTasksAsync(ListThingRegistrationTasksRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingRegistrationTasksRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingRegistrationTasksResponseUnmarshaller.Instance; return InvokeAsync<ListThingRegistrationTasksResponse>(request, options, cancellationToken); } #endregion #region ListThings /// <summary> /// Lists your things. Use the <b>attributeName</b> and <b>attributeValue</b> parameters /// to filter your things. For example, calling <code>ListThings</code> with attributeName=Color /// and attributeValue=Red retrieves all things in the registry that contain an attribute /// <b>Color</b> with the value <b>Red</b>. /// /// <note> /// <para> /// You will not be charged for calling this API if an <code>Access denied</code> error /// is returned. You will also not be charged if no attributes or pagination token was /// provided in request and no pagination token and no results were returned. /// </para> /// </note> /// </summary> /// /// <returns>The response from the ListThings service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThings">REST API Reference for ListThings Operation</seealso> public virtual ListThingsResponse ListThings() { var request = new ListThingsRequest(); return ListThings(request); } /// <summary> /// Lists your things. Use the <b>attributeName</b> and <b>attributeValue</b> parameters /// to filter your things. For example, calling <code>ListThings</code> with attributeName=Color /// and attributeValue=Red retrieves all things in the registry that contain an attribute /// <b>Color</b> with the value <b>Red</b>. /// /// <note> /// <para> /// You will not be charged for calling this API if an <code>Access denied</code> error /// is returned. You will also not be charged if no attributes or pagination token was /// provided in request and no pagination token and no results were returned. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThings service method.</param> /// /// <returns>The response from the ListThings service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThings">REST API Reference for ListThings Operation</seealso> public virtual ListThingsResponse ListThings(ListThingsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingsResponseUnmarshaller.Instance; return Invoke<ListThingsResponse>(request, options); } /// <summary> /// Lists your things. Use the <b>attributeName</b> and <b>attributeValue</b> parameters /// to filter your things. For example, calling <code>ListThings</code> with attributeName=Color /// and attributeValue=Red retrieves all things in the registry that contain an attribute /// <b>Color</b> with the value <b>Red</b>. /// /// <note> /// <para> /// You will not be charged for calling this API if an <code>Access denied</code> error /// is returned. You will also not be charged if no attributes or pagination token was /// provided in request and no pagination token and no results were returned. /// </para> /// </note> /// </summary> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the ListThings service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThings">REST API Reference for ListThings Operation</seealso> public virtual Task<ListThingsResponse> ListThingsAsync(System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new ListThingsRequest(); return ListThingsAsync(request, cancellationToken); } /// <summary> /// Lists your things. Use the <b>attributeName</b> and <b>attributeValue</b> parameters /// to filter your things. For example, calling <code>ListThings</code> with attributeName=Color /// and attributeValue=Red retrieves all things in the registry that contain an attribute /// <b>Color</b> with the value <b>Red</b>. /// /// <note> /// <para> /// You will not be charged for calling this API if an <code>Access denied</code> error /// is returned. You will also not be charged if no attributes or pagination token was /// provided in request and no pagination token and no results were returned. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThings 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 ListThings service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThings">REST API Reference for ListThings Operation</seealso> public virtual Task<ListThingsResponse> ListThingsAsync(ListThingsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingsResponseUnmarshaller.Instance; return InvokeAsync<ListThingsResponse>(request, options, cancellationToken); } #endregion #region ListThingsInBillingGroup /// <summary> /// Lists the things you have added to the given billing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingsInBillingGroup service method.</param> /// /// <returns>The response from the ListThingsInBillingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingsInBillingGroup">REST API Reference for ListThingsInBillingGroup Operation</seealso> public virtual ListThingsInBillingGroupResponse ListThingsInBillingGroup(ListThingsInBillingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingsInBillingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingsInBillingGroupResponseUnmarshaller.Instance; return Invoke<ListThingsInBillingGroupResponse>(request, options); } /// <summary> /// Lists the things you have added to the given billing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingsInBillingGroup 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 ListThingsInBillingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingsInBillingGroup">REST API Reference for ListThingsInBillingGroup Operation</seealso> public virtual Task<ListThingsInBillingGroupResponse> ListThingsInBillingGroupAsync(ListThingsInBillingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingsInBillingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingsInBillingGroupResponseUnmarshaller.Instance; return InvokeAsync<ListThingsInBillingGroupResponse>(request, options, cancellationToken); } #endregion #region ListThingsInThingGroup /// <summary> /// Lists the things in the specified group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingsInThingGroup service method.</param> /// /// <returns>The response from the ListThingsInThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingsInThingGroup">REST API Reference for ListThingsInThingGroup Operation</seealso> public virtual ListThingsInThingGroupResponse ListThingsInThingGroup(ListThingsInThingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingsInThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingsInThingGroupResponseUnmarshaller.Instance; return Invoke<ListThingsInThingGroupResponse>(request, options); } /// <summary> /// Lists the things in the specified group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingsInThingGroup 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 ListThingsInThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingsInThingGroup">REST API Reference for ListThingsInThingGroup Operation</seealso> public virtual Task<ListThingsInThingGroupResponse> ListThingsInThingGroupAsync(ListThingsInThingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingsInThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingsInThingGroupResponseUnmarshaller.Instance; return InvokeAsync<ListThingsInThingGroupResponse>(request, options, cancellationToken); } #endregion #region ListThingTypes /// <summary> /// Lists the existing thing types. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingTypes service method.</param> /// /// <returns>The response from the ListThingTypes service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingTypes">REST API Reference for ListThingTypes Operation</seealso> public virtual ListThingTypesResponse ListThingTypes(ListThingTypesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingTypesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingTypesResponseUnmarshaller.Instance; return Invoke<ListThingTypesResponse>(request, options); } /// <summary> /// Lists the existing thing types. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListThingTypes 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 ListThingTypes service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListThingTypes">REST API Reference for ListThingTypes Operation</seealso> public virtual Task<ListThingTypesResponse> ListThingTypesAsync(ListThingTypesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListThingTypesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListThingTypesResponseUnmarshaller.Instance; return InvokeAsync<ListThingTypesResponse>(request, options, cancellationToken); } #endregion #region ListTopicRuleDestinations /// <summary> /// Lists all the topic rule destinations in your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListTopicRuleDestinations service method.</param> /// /// <returns>The response from the ListTopicRuleDestinations service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListTopicRuleDestinations">REST API Reference for ListTopicRuleDestinations Operation</seealso> public virtual ListTopicRuleDestinationsResponse ListTopicRuleDestinations(ListTopicRuleDestinationsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListTopicRuleDestinationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTopicRuleDestinationsResponseUnmarshaller.Instance; return Invoke<ListTopicRuleDestinationsResponse>(request, options); } /// <summary> /// Lists all the topic rule destinations in your AWS account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListTopicRuleDestinations 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 ListTopicRuleDestinations service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListTopicRuleDestinations">REST API Reference for ListTopicRuleDestinations Operation</seealso> public virtual Task<ListTopicRuleDestinationsResponse> ListTopicRuleDestinationsAsync(ListTopicRuleDestinationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListTopicRuleDestinationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTopicRuleDestinationsResponseUnmarshaller.Instance; return InvokeAsync<ListTopicRuleDestinationsResponse>(request, options, cancellationToken); } #endregion #region ListTopicRules /// <summary> /// Lists the rules for the specific topic. /// </summary> /// <param name="topic">The topic.</param> /// /// <returns>The response from the ListTopicRules service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListTopicRules">REST API Reference for ListTopicRules Operation</seealso> public virtual ListTopicRulesResponse ListTopicRules(string topic) { var request = new ListTopicRulesRequest(); request.Topic = topic; return ListTopicRules(request); } /// <summary> /// Lists the rules for the specific topic. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListTopicRules service method.</param> /// /// <returns>The response from the ListTopicRules service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListTopicRules">REST API Reference for ListTopicRules Operation</seealso> public virtual ListTopicRulesResponse ListTopicRules(ListTopicRulesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListTopicRulesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTopicRulesResponseUnmarshaller.Instance; return Invoke<ListTopicRulesResponse>(request, options); } /// <summary> /// Lists the rules for the specific topic. /// </summary> /// <param name="topic">The topic.</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 ListTopicRules service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListTopicRules">REST API Reference for ListTopicRules Operation</seealso> public virtual Task<ListTopicRulesResponse> ListTopicRulesAsync(string topic, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new ListTopicRulesRequest(); request.Topic = topic; return ListTopicRulesAsync(request, cancellationToken); } /// <summary> /// Lists the rules for the specific topic. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListTopicRules 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 ListTopicRules service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListTopicRules">REST API Reference for ListTopicRules Operation</seealso> public virtual Task<ListTopicRulesResponse> ListTopicRulesAsync(ListTopicRulesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListTopicRulesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTopicRulesResponseUnmarshaller.Instance; return InvokeAsync<ListTopicRulesResponse>(request, options, cancellationToken); } #endregion #region ListV2LoggingLevels /// <summary> /// Lists logging levels. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListV2LoggingLevels service method.</param> /// /// <returns>The response from the ListV2LoggingLevels service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.NotConfiguredException"> /// The resource is not configured. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListV2LoggingLevels">REST API Reference for ListV2LoggingLevels Operation</seealso> public virtual ListV2LoggingLevelsResponse ListV2LoggingLevels(ListV2LoggingLevelsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListV2LoggingLevelsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListV2LoggingLevelsResponseUnmarshaller.Instance; return Invoke<ListV2LoggingLevelsResponse>(request, options); } /// <summary> /// Lists logging levels. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListV2LoggingLevels 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 ListV2LoggingLevels service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.NotConfiguredException"> /// The resource is not configured. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListV2LoggingLevels">REST API Reference for ListV2LoggingLevels Operation</seealso> public virtual Task<ListV2LoggingLevelsResponse> ListV2LoggingLevelsAsync(ListV2LoggingLevelsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListV2LoggingLevelsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListV2LoggingLevelsResponseUnmarshaller.Instance; return InvokeAsync<ListV2LoggingLevelsResponse>(request, options, cancellationToken); } #endregion #region ListViolationEvents /// <summary> /// Lists the Device Defender security profile violations discovered during the given /// time period. You can use filters to limit the results to those alerts issued for a /// particular security profile, behavior, or thing (device). /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListViolationEvents service method.</param> /// /// <returns>The response from the ListViolationEvents service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListViolationEvents">REST API Reference for ListViolationEvents Operation</seealso> public virtual ListViolationEventsResponse ListViolationEvents(ListViolationEventsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListViolationEventsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListViolationEventsResponseUnmarshaller.Instance; return Invoke<ListViolationEventsResponse>(request, options); } /// <summary> /// Lists the Device Defender security profile violations discovered during the given /// time period. You can use filters to limit the results to those alerts issued for a /// particular security profile, behavior, or thing (device). /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListViolationEvents 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 ListViolationEvents service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListViolationEvents">REST API Reference for ListViolationEvents Operation</seealso> public virtual Task<ListViolationEventsResponse> ListViolationEventsAsync(ListViolationEventsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListViolationEventsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListViolationEventsResponseUnmarshaller.Instance; return InvokeAsync<ListViolationEventsResponse>(request, options, cancellationToken); } #endregion #region RegisterCACertificate /// <summary> /// Registers a CA certificate with AWS IoT. This CA certificate can then be used to sign /// device certificates, which can be then registered with AWS IoT. You can register up /// to 10 CA certificates per AWS account that have the same subject field. This enables /// you to have up to 10 certificate authorities sign your device certificates. If you /// have more than one CA certificate registered, make sure you pass the CA certificate /// when you register your device certificates with the RegisterCertificate API. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RegisterCACertificate service method.</param> /// /// <returns>The response from the RegisterCACertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateValidationException"> /// The certificate is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.RegistrationCodeValidationException"> /// The registration code is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RegisterCACertificate">REST API Reference for RegisterCACertificate Operation</seealso> public virtual RegisterCACertificateResponse RegisterCACertificate(RegisterCACertificateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = RegisterCACertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = RegisterCACertificateResponseUnmarshaller.Instance; return Invoke<RegisterCACertificateResponse>(request, options); } /// <summary> /// Registers a CA certificate with AWS IoT. This CA certificate can then be used to sign /// device certificates, which can be then registered with AWS IoT. You can register up /// to 10 CA certificates per AWS account that have the same subject field. This enables /// you to have up to 10 certificate authorities sign your device certificates. If you /// have more than one CA certificate registered, make sure you pass the CA certificate /// when you register your device certificates with the RegisterCertificate API. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RegisterCACertificate 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 RegisterCACertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateValidationException"> /// The certificate is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.RegistrationCodeValidationException"> /// The registration code is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RegisterCACertificate">REST API Reference for RegisterCACertificate Operation</seealso> public virtual Task<RegisterCACertificateResponse> RegisterCACertificateAsync(RegisterCACertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = RegisterCACertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = RegisterCACertificateResponseUnmarshaller.Instance; return InvokeAsync<RegisterCACertificateResponse>(request, options, cancellationToken); } #endregion #region RegisterCertificate /// <summary> /// Registers a device certificate with AWS IoT. If you have more than one CA certificate /// that has the same subject field, you must specify the CA certificate that was used /// to sign the device certificate being registered. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RegisterCertificate service method.</param> /// /// <returns>The response from the RegisterCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateConflictException"> /// Unable to verify the CA certificate used to sign the device certificate you are attempting /// to register. This is happens when you have registered more than one CA certificate /// that has the same subject field and public key. /// </exception> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.CertificateValidationException"> /// The certificate is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RegisterCertificate">REST API Reference for RegisterCertificate Operation</seealso> public virtual RegisterCertificateResponse RegisterCertificate(RegisterCertificateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = RegisterCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = RegisterCertificateResponseUnmarshaller.Instance; return Invoke<RegisterCertificateResponse>(request, options); } /// <summary> /// Registers a device certificate with AWS IoT. If you have more than one CA certificate /// that has the same subject field, you must specify the CA certificate that was used /// to sign the device certificate being registered. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RegisterCertificate 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 RegisterCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateConflictException"> /// Unable to verify the CA certificate used to sign the device certificate you are attempting /// to register. This is happens when you have registered more than one CA certificate /// that has the same subject field and public key. /// </exception> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.CertificateValidationException"> /// The certificate is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RegisterCertificate">REST API Reference for RegisterCertificate Operation</seealso> public virtual Task<RegisterCertificateResponse> RegisterCertificateAsync(RegisterCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = RegisterCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = RegisterCertificateResponseUnmarshaller.Instance; return InvokeAsync<RegisterCertificateResponse>(request, options, cancellationToken); } #endregion #region RegisterCertificateWithoutCA /// <summary> /// Register a certificate that does not have a certificate authority (CA). /// </summary> /// <param name="request">Container for the necessary parameters to execute the RegisterCertificateWithoutCA service method.</param> /// /// <returns>The response from the RegisterCertificateWithoutCA service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.CertificateValidationException"> /// The certificate is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RegisterCertificateWithoutCA">REST API Reference for RegisterCertificateWithoutCA Operation</seealso> public virtual RegisterCertificateWithoutCAResponse RegisterCertificateWithoutCA(RegisterCertificateWithoutCARequest request) { var options = new InvokeOptions(); options.RequestMarshaller = RegisterCertificateWithoutCARequestMarshaller.Instance; options.ResponseUnmarshaller = RegisterCertificateWithoutCAResponseUnmarshaller.Instance; return Invoke<RegisterCertificateWithoutCAResponse>(request, options); } /// <summary> /// Register a certificate that does not have a certificate authority (CA). /// </summary> /// <param name="request">Container for the necessary parameters to execute the RegisterCertificateWithoutCA 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 RegisterCertificateWithoutCA service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.CertificateValidationException"> /// The certificate is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RegisterCertificateWithoutCA">REST API Reference for RegisterCertificateWithoutCA Operation</seealso> public virtual Task<RegisterCertificateWithoutCAResponse> RegisterCertificateWithoutCAAsync(RegisterCertificateWithoutCARequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = RegisterCertificateWithoutCARequestMarshaller.Instance; options.ResponseUnmarshaller = RegisterCertificateWithoutCAResponseUnmarshaller.Instance; return InvokeAsync<RegisterCertificateWithoutCAResponse>(request, options, cancellationToken); } #endregion #region RegisterThing /// <summary> /// Provisions a thing in the device registry. RegisterThing calls other AWS IoT control /// plane APIs. These calls might exceed your account level <a href="https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_iot"> /// AWS IoT Throttling Limits</a> and cause throttle errors. Please contact <a href="https://console.aws.amazon.com/support/home">AWS /// Customer Support</a> to raise your throttling limits if necessary. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RegisterThing service method.</param> /// /// <returns>The response from the RegisterThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceRegistrationFailureException"> /// The resource registration failed. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RegisterThing">REST API Reference for RegisterThing Operation</seealso> public virtual RegisterThingResponse RegisterThing(RegisterThingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = RegisterThingRequestMarshaller.Instance; options.ResponseUnmarshaller = RegisterThingResponseUnmarshaller.Instance; return Invoke<RegisterThingResponse>(request, options); } /// <summary> /// Provisions a thing in the device registry. RegisterThing calls other AWS IoT control /// plane APIs. These calls might exceed your account level <a href="https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_iot"> /// AWS IoT Throttling Limits</a> and cause throttle errors. Please contact <a href="https://console.aws.amazon.com/support/home">AWS /// Customer Support</a> to raise your throttling limits if necessary. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RegisterThing 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 RegisterThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceRegistrationFailureException"> /// The resource registration failed. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RegisterThing">REST API Reference for RegisterThing Operation</seealso> public virtual Task<RegisterThingResponse> RegisterThingAsync(RegisterThingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = RegisterThingRequestMarshaller.Instance; options.ResponseUnmarshaller = RegisterThingResponseUnmarshaller.Instance; return InvokeAsync<RegisterThingResponse>(request, options, cancellationToken); } #endregion #region RejectCertificateTransfer /// <summary> /// Rejects a pending certificate transfer. After AWS IoT rejects a certificate transfer, /// the certificate status changes from <b>PENDING_TRANSFER</b> to <b>INACTIVE</b>. /// /// /// <para> /// To check for pending certificate transfers, call <a>ListCertificates</a> to enumerate /// your certificates. /// </para> /// /// <para> /// This operation can only be called by the transfer destination. After it is called, /// the certificate will be returned to the source's account in the INACTIVE state. /// </para> /// </summary> /// <param name="certificateId">The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</param> /// /// <returns>The response from the RejectCertificateTransfer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferAlreadyCompletedException"> /// You can't revert the certificate transfer because the transfer is already complete. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RejectCertificateTransfer">REST API Reference for RejectCertificateTransfer Operation</seealso> public virtual RejectCertificateTransferResponse RejectCertificateTransfer(string certificateId) { var request = new RejectCertificateTransferRequest(); request.CertificateId = certificateId; return RejectCertificateTransfer(request); } /// <summary> /// Rejects a pending certificate transfer. After AWS IoT rejects a certificate transfer, /// the certificate status changes from <b>PENDING_TRANSFER</b> to <b>INACTIVE</b>. /// /// /// <para> /// To check for pending certificate transfers, call <a>ListCertificates</a> to enumerate /// your certificates. /// </para> /// /// <para> /// This operation can only be called by the transfer destination. After it is called, /// the certificate will be returned to the source's account in the INACTIVE state. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the RejectCertificateTransfer service method.</param> /// /// <returns>The response from the RejectCertificateTransfer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferAlreadyCompletedException"> /// You can't revert the certificate transfer because the transfer is already complete. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RejectCertificateTransfer">REST API Reference for RejectCertificateTransfer Operation</seealso> public virtual RejectCertificateTransferResponse RejectCertificateTransfer(RejectCertificateTransferRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = RejectCertificateTransferRequestMarshaller.Instance; options.ResponseUnmarshaller = RejectCertificateTransferResponseUnmarshaller.Instance; return Invoke<RejectCertificateTransferResponse>(request, options); } /// <summary> /// Rejects a pending certificate transfer. After AWS IoT rejects a certificate transfer, /// the certificate status changes from <b>PENDING_TRANSFER</b> to <b>INACTIVE</b>. /// /// /// <para> /// To check for pending certificate transfers, call <a>ListCertificates</a> to enumerate /// your certificates. /// </para> /// /// <para> /// This operation can only be called by the transfer destination. After it is called, /// the certificate will be returned to the source's account in the INACTIVE state. /// </para> /// </summary> /// <param name="certificateId">The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</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 RejectCertificateTransfer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferAlreadyCompletedException"> /// You can't revert the certificate transfer because the transfer is already complete. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RejectCertificateTransfer">REST API Reference for RejectCertificateTransfer Operation</seealso> public virtual Task<RejectCertificateTransferResponse> RejectCertificateTransferAsync(string certificateId, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new RejectCertificateTransferRequest(); request.CertificateId = certificateId; return RejectCertificateTransferAsync(request, cancellationToken); } /// <summary> /// Rejects a pending certificate transfer. After AWS IoT rejects a certificate transfer, /// the certificate status changes from <b>PENDING_TRANSFER</b> to <b>INACTIVE</b>. /// /// /// <para> /// To check for pending certificate transfers, call <a>ListCertificates</a> to enumerate /// your certificates. /// </para> /// /// <para> /// This operation can only be called by the transfer destination. After it is called, /// the certificate will be returned to the source's account in the INACTIVE state. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the RejectCertificateTransfer 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 RejectCertificateTransfer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferAlreadyCompletedException"> /// You can't revert the certificate transfer because the transfer is already complete. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RejectCertificateTransfer">REST API Reference for RejectCertificateTransfer Operation</seealso> public virtual Task<RejectCertificateTransferResponse> RejectCertificateTransferAsync(RejectCertificateTransferRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = RejectCertificateTransferRequestMarshaller.Instance; options.ResponseUnmarshaller = RejectCertificateTransferResponseUnmarshaller.Instance; return InvokeAsync<RejectCertificateTransferResponse>(request, options, cancellationToken); } #endregion #region RemoveThingFromBillingGroup /// <summary> /// Removes the given thing from the billing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RemoveThingFromBillingGroup service method.</param> /// /// <returns>The response from the RemoveThingFromBillingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RemoveThingFromBillingGroup">REST API Reference for RemoveThingFromBillingGroup Operation</seealso> public virtual RemoveThingFromBillingGroupResponse RemoveThingFromBillingGroup(RemoveThingFromBillingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = RemoveThingFromBillingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = RemoveThingFromBillingGroupResponseUnmarshaller.Instance; return Invoke<RemoveThingFromBillingGroupResponse>(request, options); } /// <summary> /// Removes the given thing from the billing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the RemoveThingFromBillingGroup 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 RemoveThingFromBillingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RemoveThingFromBillingGroup">REST API Reference for RemoveThingFromBillingGroup Operation</seealso> public virtual Task<RemoveThingFromBillingGroupResponse> RemoveThingFromBillingGroupAsync(RemoveThingFromBillingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = RemoveThingFromBillingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = RemoveThingFromBillingGroupResponseUnmarshaller.Instance; return InvokeAsync<RemoveThingFromBillingGroupResponse>(request, options, cancellationToken); } #endregion #region RemoveThingFromThingGroup /// <summary> /// Remove the specified thing from the specified group. /// /// /// <para> /// You must specify either a <code>thingGroupArn</code> or a <code>thingGroupName</code> /// to identify the thing group and either a <code>thingArn</code> or a <code>thingName</code> /// to identify the thing to remove from the thing group. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the RemoveThingFromThingGroup service method.</param> /// /// <returns>The response from the RemoveThingFromThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RemoveThingFromThingGroup">REST API Reference for RemoveThingFromThingGroup Operation</seealso> public virtual RemoveThingFromThingGroupResponse RemoveThingFromThingGroup(RemoveThingFromThingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = RemoveThingFromThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = RemoveThingFromThingGroupResponseUnmarshaller.Instance; return Invoke<RemoveThingFromThingGroupResponse>(request, options); } /// <summary> /// Remove the specified thing from the specified group. /// /// /// <para> /// You must specify either a <code>thingGroupArn</code> or a <code>thingGroupName</code> /// to identify the thing group and either a <code>thingArn</code> or a <code>thingName</code> /// to identify the thing to remove from the thing group. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the RemoveThingFromThingGroup 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 RemoveThingFromThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/RemoveThingFromThingGroup">REST API Reference for RemoveThingFromThingGroup Operation</seealso> public virtual Task<RemoveThingFromThingGroupResponse> RemoveThingFromThingGroupAsync(RemoveThingFromThingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = RemoveThingFromThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = RemoveThingFromThingGroupResponseUnmarshaller.Instance; return InvokeAsync<RemoveThingFromThingGroupResponse>(request, options, cancellationToken); } #endregion #region ReplaceTopicRule /// <summary> /// Replaces the rule. You must specify all parameters for the new rule. Creating rules /// is an administrator-level action. Any user who has permission to create rules will /// be able to access data processed by the rule. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ReplaceTopicRule service method.</param> /// /// <returns>The response from the ReplaceTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.SqlParseException"> /// The Rule-SQL expression can't be parsed correctly. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ReplaceTopicRule">REST API Reference for ReplaceTopicRule Operation</seealso> public virtual ReplaceTopicRuleResponse ReplaceTopicRule(ReplaceTopicRuleRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ReplaceTopicRuleRequestMarshaller.Instance; options.ResponseUnmarshaller = ReplaceTopicRuleResponseUnmarshaller.Instance; return Invoke<ReplaceTopicRuleResponse>(request, options); } /// <summary> /// Replaces the rule. You must specify all parameters for the new rule. Creating rules /// is an administrator-level action. Any user who has permission to create rules will /// be able to access data processed by the rule. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ReplaceTopicRule 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 ReplaceTopicRule service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.SqlParseException"> /// The Rule-SQL expression can't be parsed correctly. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ReplaceTopicRule">REST API Reference for ReplaceTopicRule Operation</seealso> public virtual Task<ReplaceTopicRuleResponse> ReplaceTopicRuleAsync(ReplaceTopicRuleRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ReplaceTopicRuleRequestMarshaller.Instance; options.ResponseUnmarshaller = ReplaceTopicRuleResponseUnmarshaller.Instance; return InvokeAsync<ReplaceTopicRuleResponse>(request, options, cancellationToken); } #endregion #region SearchIndex /// <summary> /// The query search index. /// </summary> /// <param name="request">Container for the necessary parameters to execute the SearchIndex service method.</param> /// /// <returns>The response from the SearchIndex service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.IndexNotReadyException"> /// The index is not ready. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidQueryException"> /// The query is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/SearchIndex">REST API Reference for SearchIndex Operation</seealso> public virtual SearchIndexResponse SearchIndex(SearchIndexRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = SearchIndexRequestMarshaller.Instance; options.ResponseUnmarshaller = SearchIndexResponseUnmarshaller.Instance; return Invoke<SearchIndexResponse>(request, options); } /// <summary> /// The query search index. /// </summary> /// <param name="request">Container for the necessary parameters to execute the SearchIndex 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 SearchIndex service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.IndexNotReadyException"> /// The index is not ready. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidQueryException"> /// The query is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/SearchIndex">REST API Reference for SearchIndex Operation</seealso> public virtual Task<SearchIndexResponse> SearchIndexAsync(SearchIndexRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = SearchIndexRequestMarshaller.Instance; options.ResponseUnmarshaller = SearchIndexResponseUnmarshaller.Instance; return InvokeAsync<SearchIndexResponse>(request, options, cancellationToken); } #endregion #region SetDefaultAuthorizer /// <summary> /// Sets the default authorizer. This will be used if a websocket connection is made without /// specifying an authorizer. /// </summary> /// <param name="request">Container for the necessary parameters to execute the SetDefaultAuthorizer service method.</param> /// /// <returns>The response from the SetDefaultAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/SetDefaultAuthorizer">REST API Reference for SetDefaultAuthorizer Operation</seealso> public virtual SetDefaultAuthorizerResponse SetDefaultAuthorizer(SetDefaultAuthorizerRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = SetDefaultAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = SetDefaultAuthorizerResponseUnmarshaller.Instance; return Invoke<SetDefaultAuthorizerResponse>(request, options); } /// <summary> /// Sets the default authorizer. This will be used if a websocket connection is made without /// specifying an authorizer. /// </summary> /// <param name="request">Container for the necessary parameters to execute the SetDefaultAuthorizer 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 SetDefaultAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceAlreadyExistsException"> /// The resource already exists. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/SetDefaultAuthorizer">REST API Reference for SetDefaultAuthorizer Operation</seealso> public virtual Task<SetDefaultAuthorizerResponse> SetDefaultAuthorizerAsync(SetDefaultAuthorizerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = SetDefaultAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = SetDefaultAuthorizerResponseUnmarshaller.Instance; return InvokeAsync<SetDefaultAuthorizerResponse>(request, options, cancellationToken); } #endregion #region SetDefaultPolicyVersion /// <summary> /// Sets the specified version of the specified policy as the policy's default (operative) /// version. This action affects all certificates to which the policy is attached. To /// list the principals the policy is attached to, use the ListPrincipalPolicy API. /// </summary> /// <param name="policyName">The policy name.</param> /// <param name="policyVersionId">The policy version ID.</param> /// /// <returns>The response from the SetDefaultPolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/SetDefaultPolicyVersion">REST API Reference for SetDefaultPolicyVersion Operation</seealso> public virtual SetDefaultPolicyVersionResponse SetDefaultPolicyVersion(string policyName, string policyVersionId) { var request = new SetDefaultPolicyVersionRequest(); request.PolicyName = policyName; request.PolicyVersionId = policyVersionId; return SetDefaultPolicyVersion(request); } /// <summary> /// Sets the specified version of the specified policy as the policy's default (operative) /// version. This action affects all certificates to which the policy is attached. To /// list the principals the policy is attached to, use the ListPrincipalPolicy API. /// </summary> /// <param name="request">Container for the necessary parameters to execute the SetDefaultPolicyVersion service method.</param> /// /// <returns>The response from the SetDefaultPolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/SetDefaultPolicyVersion">REST API Reference for SetDefaultPolicyVersion Operation</seealso> public virtual SetDefaultPolicyVersionResponse SetDefaultPolicyVersion(SetDefaultPolicyVersionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = SetDefaultPolicyVersionRequestMarshaller.Instance; options.ResponseUnmarshaller = SetDefaultPolicyVersionResponseUnmarshaller.Instance; return Invoke<SetDefaultPolicyVersionResponse>(request, options); } /// <summary> /// Sets the specified version of the specified policy as the policy's default (operative) /// version. This action affects all certificates to which the policy is attached. To /// list the principals the policy is attached to, use the ListPrincipalPolicy API. /// </summary> /// <param name="policyName">The policy name.</param> /// <param name="policyVersionId">The policy version ID.</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 SetDefaultPolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/SetDefaultPolicyVersion">REST API Reference for SetDefaultPolicyVersion Operation</seealso> public virtual Task<SetDefaultPolicyVersionResponse> SetDefaultPolicyVersionAsync(string policyName, string policyVersionId, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new SetDefaultPolicyVersionRequest(); request.PolicyName = policyName; request.PolicyVersionId = policyVersionId; return SetDefaultPolicyVersionAsync(request, cancellationToken); } /// <summary> /// Sets the specified version of the specified policy as the policy's default (operative) /// version. This action affects all certificates to which the policy is attached. To /// list the principals the policy is attached to, use the ListPrincipalPolicy API. /// </summary> /// <param name="request">Container for the necessary parameters to execute the SetDefaultPolicyVersion 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 SetDefaultPolicyVersion service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/SetDefaultPolicyVersion">REST API Reference for SetDefaultPolicyVersion Operation</seealso> public virtual Task<SetDefaultPolicyVersionResponse> SetDefaultPolicyVersionAsync(SetDefaultPolicyVersionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = SetDefaultPolicyVersionRequestMarshaller.Instance; options.ResponseUnmarshaller = SetDefaultPolicyVersionResponseUnmarshaller.Instance; return InvokeAsync<SetDefaultPolicyVersionResponse>(request, options, cancellationToken); } #endregion #region SetLoggingOptions /// <summary> /// Sets the logging options. /// /// /// <para> /// NOTE: use of this command is not recommended. Use <code>SetV2LoggingOptions</code> /// instead. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the SetLoggingOptions service method.</param> /// /// <returns>The response from the SetLoggingOptions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/SetLoggingOptions">REST API Reference for SetLoggingOptions Operation</seealso> public virtual SetLoggingOptionsResponse SetLoggingOptions(SetLoggingOptionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = SetLoggingOptionsRequestMarshaller.Instance; options.ResponseUnmarshaller = SetLoggingOptionsResponseUnmarshaller.Instance; return Invoke<SetLoggingOptionsResponse>(request, options); } /// <summary> /// Sets the logging options. /// /// /// <para> /// NOTE: use of this command is not recommended. Use <code>SetV2LoggingOptions</code> /// instead. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the SetLoggingOptions 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 SetLoggingOptions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/SetLoggingOptions">REST API Reference for SetLoggingOptions Operation</seealso> public virtual Task<SetLoggingOptionsResponse> SetLoggingOptionsAsync(SetLoggingOptionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = SetLoggingOptionsRequestMarshaller.Instance; options.ResponseUnmarshaller = SetLoggingOptionsResponseUnmarshaller.Instance; return InvokeAsync<SetLoggingOptionsResponse>(request, options, cancellationToken); } #endregion #region SetV2LoggingLevel /// <summary> /// Sets the logging level. /// </summary> /// <param name="request">Container for the necessary parameters to execute the SetV2LoggingLevel service method.</param> /// /// <returns>The response from the SetV2LoggingLevel service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.NotConfiguredException"> /// The resource is not configured. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/SetV2LoggingLevel">REST API Reference for SetV2LoggingLevel Operation</seealso> public virtual SetV2LoggingLevelResponse SetV2LoggingLevel(SetV2LoggingLevelRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = SetV2LoggingLevelRequestMarshaller.Instance; options.ResponseUnmarshaller = SetV2LoggingLevelResponseUnmarshaller.Instance; return Invoke<SetV2LoggingLevelResponse>(request, options); } /// <summary> /// Sets the logging level. /// </summary> /// <param name="request">Container for the necessary parameters to execute the SetV2LoggingLevel 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 SetV2LoggingLevel service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.NotConfiguredException"> /// The resource is not configured. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/SetV2LoggingLevel">REST API Reference for SetV2LoggingLevel Operation</seealso> public virtual Task<SetV2LoggingLevelResponse> SetV2LoggingLevelAsync(SetV2LoggingLevelRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = SetV2LoggingLevelRequestMarshaller.Instance; options.ResponseUnmarshaller = SetV2LoggingLevelResponseUnmarshaller.Instance; return InvokeAsync<SetV2LoggingLevelResponse>(request, options, cancellationToken); } #endregion #region SetV2LoggingOptions /// <summary> /// Sets the logging options for the V2 logging service. /// </summary> /// <param name="request">Container for the necessary parameters to execute the SetV2LoggingOptions service method.</param> /// /// <returns>The response from the SetV2LoggingOptions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/SetV2LoggingOptions">REST API Reference for SetV2LoggingOptions Operation</seealso> public virtual SetV2LoggingOptionsResponse SetV2LoggingOptions(SetV2LoggingOptionsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = SetV2LoggingOptionsRequestMarshaller.Instance; options.ResponseUnmarshaller = SetV2LoggingOptionsResponseUnmarshaller.Instance; return Invoke<SetV2LoggingOptionsResponse>(request, options); } /// <summary> /// Sets the logging options for the V2 logging service. /// </summary> /// <param name="request">Container for the necessary parameters to execute the SetV2LoggingOptions 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 SetV2LoggingOptions service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/SetV2LoggingOptions">REST API Reference for SetV2LoggingOptions Operation</seealso> public virtual Task<SetV2LoggingOptionsResponse> SetV2LoggingOptionsAsync(SetV2LoggingOptionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = SetV2LoggingOptionsRequestMarshaller.Instance; options.ResponseUnmarshaller = SetV2LoggingOptionsResponseUnmarshaller.Instance; return InvokeAsync<SetV2LoggingOptionsResponse>(request, options, cancellationToken); } #endregion #region StartAuditMitigationActionsTask /// <summary> /// Starts a task that applies a set of mitigation actions to the specified target. /// </summary> /// <param name="request">Container for the necessary parameters to execute the StartAuditMitigationActionsTask service method.</param> /// /// <returns>The response from the StartAuditMitigationActionsTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.TaskAlreadyExistsException"> /// This exception occurs if you attempt to start a task with the same task-id as an existing /// task but with a different clientRequestToken. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/StartAuditMitigationActionsTask">REST API Reference for StartAuditMitigationActionsTask Operation</seealso> public virtual StartAuditMitigationActionsTaskResponse StartAuditMitigationActionsTask(StartAuditMitigationActionsTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = StartAuditMitigationActionsTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = StartAuditMitigationActionsTaskResponseUnmarshaller.Instance; return Invoke<StartAuditMitigationActionsTaskResponse>(request, options); } /// <summary> /// Starts a task that applies a set of mitigation actions to the specified target. /// </summary> /// <param name="request">Container for the necessary parameters to execute the StartAuditMitigationActionsTask 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 StartAuditMitigationActionsTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.TaskAlreadyExistsException"> /// This exception occurs if you attempt to start a task with the same task-id as an existing /// task but with a different clientRequestToken. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/StartAuditMitigationActionsTask">REST API Reference for StartAuditMitigationActionsTask Operation</seealso> public virtual Task<StartAuditMitigationActionsTaskResponse> StartAuditMitigationActionsTaskAsync(StartAuditMitigationActionsTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = StartAuditMitigationActionsTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = StartAuditMitigationActionsTaskResponseUnmarshaller.Instance; return InvokeAsync<StartAuditMitigationActionsTaskResponse>(request, options, cancellationToken); } #endregion #region StartOnDemandAuditTask /// <summary> /// Starts an on-demand Device Defender audit. /// </summary> /// <param name="request">Container for the necessary parameters to execute the StartOnDemandAuditTask service method.</param> /// /// <returns>The response from the StartOnDemandAuditTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/StartOnDemandAuditTask">REST API Reference for StartOnDemandAuditTask Operation</seealso> public virtual StartOnDemandAuditTaskResponse StartOnDemandAuditTask(StartOnDemandAuditTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = StartOnDemandAuditTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = StartOnDemandAuditTaskResponseUnmarshaller.Instance; return Invoke<StartOnDemandAuditTaskResponse>(request, options); } /// <summary> /// Starts an on-demand Device Defender audit. /// </summary> /// <param name="request">Container for the necessary parameters to execute the StartOnDemandAuditTask 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 StartOnDemandAuditTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/StartOnDemandAuditTask">REST API Reference for StartOnDemandAuditTask Operation</seealso> public virtual Task<StartOnDemandAuditTaskResponse> StartOnDemandAuditTaskAsync(StartOnDemandAuditTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = StartOnDemandAuditTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = StartOnDemandAuditTaskResponseUnmarshaller.Instance; return InvokeAsync<StartOnDemandAuditTaskResponse>(request, options, cancellationToken); } #endregion #region StartThingRegistrationTask /// <summary> /// Creates a bulk thing provisioning task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the StartThingRegistrationTask service method.</param> /// /// <returns>The response from the StartThingRegistrationTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/StartThingRegistrationTask">REST API Reference for StartThingRegistrationTask Operation</seealso> public virtual StartThingRegistrationTaskResponse StartThingRegistrationTask(StartThingRegistrationTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = StartThingRegistrationTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = StartThingRegistrationTaskResponseUnmarshaller.Instance; return Invoke<StartThingRegistrationTaskResponse>(request, options); } /// <summary> /// Creates a bulk thing provisioning task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the StartThingRegistrationTask 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 StartThingRegistrationTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/StartThingRegistrationTask">REST API Reference for StartThingRegistrationTask Operation</seealso> public virtual Task<StartThingRegistrationTaskResponse> StartThingRegistrationTaskAsync(StartThingRegistrationTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = StartThingRegistrationTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = StartThingRegistrationTaskResponseUnmarshaller.Instance; return InvokeAsync<StartThingRegistrationTaskResponse>(request, options, cancellationToken); } #endregion #region StopThingRegistrationTask /// <summary> /// Cancels a bulk thing provisioning task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the StopThingRegistrationTask service method.</param> /// /// <returns>The response from the StopThingRegistrationTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/StopThingRegistrationTask">REST API Reference for StopThingRegistrationTask Operation</seealso> public virtual StopThingRegistrationTaskResponse StopThingRegistrationTask(StopThingRegistrationTaskRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = StopThingRegistrationTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = StopThingRegistrationTaskResponseUnmarshaller.Instance; return Invoke<StopThingRegistrationTaskResponse>(request, options); } /// <summary> /// Cancels a bulk thing provisioning task. /// </summary> /// <param name="request">Container for the necessary parameters to execute the StopThingRegistrationTask 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 StopThingRegistrationTask service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/StopThingRegistrationTask">REST API Reference for StopThingRegistrationTask Operation</seealso> public virtual Task<StopThingRegistrationTaskResponse> StopThingRegistrationTaskAsync(StopThingRegistrationTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = StopThingRegistrationTaskRequestMarshaller.Instance; options.ResponseUnmarshaller = StopThingRegistrationTaskResponseUnmarshaller.Instance; return InvokeAsync<StopThingRegistrationTaskResponse>(request, options, cancellationToken); } #endregion #region TagResource /// <summary> /// Adds to or modifies the tags of the given resource. Tags are metadata which can be /// used to manage a resource. /// </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 IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/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 to or modifies the tags of the given resource. Tags are metadata which can be /// used to manage a resource. /// </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 IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/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 TestAuthorization /// <summary> /// Tests if a specified principal is authorized to perform an AWS IoT action on a specified /// resource. Use this to test and debug the authorization behavior of devices that connect /// to the AWS IoT device gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the TestAuthorization service method.</param> /// /// <returns>The response from the TestAuthorization service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/TestAuthorization">REST API Reference for TestAuthorization Operation</seealso> public virtual TestAuthorizationResponse TestAuthorization(TestAuthorizationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = TestAuthorizationRequestMarshaller.Instance; options.ResponseUnmarshaller = TestAuthorizationResponseUnmarshaller.Instance; return Invoke<TestAuthorizationResponse>(request, options); } /// <summary> /// Tests if a specified principal is authorized to perform an AWS IoT action on a specified /// resource. Use this to test and debug the authorization behavior of devices that connect /// to the AWS IoT device gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the TestAuthorization 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 TestAuthorization service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/TestAuthorization">REST API Reference for TestAuthorization Operation</seealso> public virtual Task<TestAuthorizationResponse> TestAuthorizationAsync(TestAuthorizationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = TestAuthorizationRequestMarshaller.Instance; options.ResponseUnmarshaller = TestAuthorizationResponseUnmarshaller.Instance; return InvokeAsync<TestAuthorizationResponse>(request, options, cancellationToken); } #endregion #region TestInvokeAuthorizer /// <summary> /// Tests a custom authorization behavior by invoking a specified custom authorizer. Use /// this to test and debug the custom authorization behavior of devices that connect to /// the AWS IoT device gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the TestInvokeAuthorizer service method.</param> /// /// <returns>The response from the TestInvokeAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidResponseException"> /// The response is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/TestInvokeAuthorizer">REST API Reference for TestInvokeAuthorizer Operation</seealso> public virtual TestInvokeAuthorizerResponse TestInvokeAuthorizer(TestInvokeAuthorizerRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = TestInvokeAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = TestInvokeAuthorizerResponseUnmarshaller.Instance; return Invoke<TestInvokeAuthorizerResponse>(request, options); } /// <summary> /// Tests a custom authorization behavior by invoking a specified custom authorizer. Use /// this to test and debug the custom authorization behavior of devices that connect to /// the AWS IoT device gateway. /// </summary> /// <param name="request">Container for the necessary parameters to execute the TestInvokeAuthorizer 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 TestInvokeAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidResponseException"> /// The response is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/TestInvokeAuthorizer">REST API Reference for TestInvokeAuthorizer Operation</seealso> public virtual Task<TestInvokeAuthorizerResponse> TestInvokeAuthorizerAsync(TestInvokeAuthorizerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = TestInvokeAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = TestInvokeAuthorizerResponseUnmarshaller.Instance; return InvokeAsync<TestInvokeAuthorizerResponse>(request, options, cancellationToken); } #endregion #region TransferCertificate /// <summary> /// Transfers the specified certificate to the specified AWS account. /// /// /// <para> /// You can cancel the transfer until it is acknowledged by the recipient. /// </para> /// /// <para> /// No notification is sent to the transfer destination's account. It is up to the caller /// to notify the transfer target. /// </para> /// /// <para> /// The certificate being transferred must not be in the ACTIVE state. You can use the /// UpdateCertificate API to deactivate it. /// </para> /// /// <para> /// The certificate must not have any policies attached to it. You can use the DetachPrincipalPolicy /// API to detach them. /// </para> /// </summary> /// <param name="certificateId">The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</param> /// <param name="targetAwsAccount">The AWS account.</param> /// /// <returns>The response from the TransferCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferConflictException"> /// You can't transfer the certificate because authorization policies are still attached. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/TransferCertificate">REST API Reference for TransferCertificate Operation</seealso> public virtual TransferCertificateResponse TransferCertificate(string certificateId, string targetAwsAccount) { var request = new TransferCertificateRequest(); request.CertificateId = certificateId; request.TargetAwsAccount = targetAwsAccount; return TransferCertificate(request); } /// <summary> /// Transfers the specified certificate to the specified AWS account. /// /// /// <para> /// You can cancel the transfer until it is acknowledged by the recipient. /// </para> /// /// <para> /// No notification is sent to the transfer destination's account. It is up to the caller /// to notify the transfer target. /// </para> /// /// <para> /// The certificate being transferred must not be in the ACTIVE state. You can use the /// UpdateCertificate API to deactivate it. /// </para> /// /// <para> /// The certificate must not have any policies attached to it. You can use the DetachPrincipalPolicy /// API to detach them. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the TransferCertificate service method.</param> /// /// <returns>The response from the TransferCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferConflictException"> /// You can't transfer the certificate because authorization policies are still attached. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/TransferCertificate">REST API Reference for TransferCertificate Operation</seealso> public virtual TransferCertificateResponse TransferCertificate(TransferCertificateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = TransferCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = TransferCertificateResponseUnmarshaller.Instance; return Invoke<TransferCertificateResponse>(request, options); } /// <summary> /// Transfers the specified certificate to the specified AWS account. /// /// /// <para> /// You can cancel the transfer until it is acknowledged by the recipient. /// </para> /// /// <para> /// No notification is sent to the transfer destination's account. It is up to the caller /// to notify the transfer target. /// </para> /// /// <para> /// The certificate being transferred must not be in the ACTIVE state. You can use the /// UpdateCertificate API to deactivate it. /// </para> /// /// <para> /// The certificate must not have any policies attached to it. You can use the DetachPrincipalPolicy /// API to detach them. /// </para> /// </summary> /// <param name="certificateId">The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</param> /// <param name="targetAwsAccount">The AWS account.</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 TransferCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferConflictException"> /// You can't transfer the certificate because authorization policies are still attached. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/TransferCertificate">REST API Reference for TransferCertificate Operation</seealso> public virtual Task<TransferCertificateResponse> TransferCertificateAsync(string certificateId, string targetAwsAccount, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new TransferCertificateRequest(); request.CertificateId = certificateId; request.TargetAwsAccount = targetAwsAccount; return TransferCertificateAsync(request, cancellationToken); } /// <summary> /// Transfers the specified certificate to the specified AWS account. /// /// /// <para> /// You can cancel the transfer until it is acknowledged by the recipient. /// </para> /// /// <para> /// No notification is sent to the transfer destination's account. It is up to the caller /// to notify the transfer target. /// </para> /// /// <para> /// The certificate being transferred must not be in the ACTIVE state. You can use the /// UpdateCertificate API to deactivate it. /// </para> /// /// <para> /// The certificate must not have any policies attached to it. You can use the DetachPrincipalPolicy /// API to detach them. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the TransferCertificate 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 TransferCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferConflictException"> /// You can't transfer the certificate because authorization policies are still attached. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/TransferCertificate">REST API Reference for TransferCertificate Operation</seealso> public virtual Task<TransferCertificateResponse> TransferCertificateAsync(TransferCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = TransferCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = TransferCertificateResponseUnmarshaller.Instance; return InvokeAsync<TransferCertificateResponse>(request, options, cancellationToken); } #endregion #region UntagResource /// <summary> /// Removes the given tags (metadata) from the resource. /// </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 IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/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 the given tags (metadata) from the resource. /// </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 IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/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 UpdateAccountAuditConfiguration /// <summary> /// Configures or reconfigures the Device Defender audit settings for this account. Settings /// include how audit notifications are sent and which audit checks are enabled or disabled. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateAccountAuditConfiguration service method.</param> /// /// <returns>The response from the UpdateAccountAuditConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateAccountAuditConfiguration">REST API Reference for UpdateAccountAuditConfiguration Operation</seealso> public virtual UpdateAccountAuditConfigurationResponse UpdateAccountAuditConfiguration(UpdateAccountAuditConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateAccountAuditConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateAccountAuditConfigurationResponseUnmarshaller.Instance; return Invoke<UpdateAccountAuditConfigurationResponse>(request, options); } /// <summary> /// Configures or reconfigures the Device Defender audit settings for this account. Settings /// include how audit notifications are sent and which audit checks are enabled or disabled. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateAccountAuditConfiguration 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 UpdateAccountAuditConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateAccountAuditConfiguration">REST API Reference for UpdateAccountAuditConfiguration Operation</seealso> public virtual Task<UpdateAccountAuditConfigurationResponse> UpdateAccountAuditConfigurationAsync(UpdateAccountAuditConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateAccountAuditConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateAccountAuditConfigurationResponseUnmarshaller.Instance; return InvokeAsync<UpdateAccountAuditConfigurationResponse>(request, options, cancellationToken); } #endregion #region UpdateAuditSuppression /// <summary> /// Updates a Device Defender audit suppression. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateAuditSuppression service method.</param> /// /// <returns>The response from the UpdateAuditSuppression service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateAuditSuppression">REST API Reference for UpdateAuditSuppression Operation</seealso> public virtual UpdateAuditSuppressionResponse UpdateAuditSuppression(UpdateAuditSuppressionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateAuditSuppressionRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateAuditSuppressionResponseUnmarshaller.Instance; return Invoke<UpdateAuditSuppressionResponse>(request, options); } /// <summary> /// Updates a Device Defender audit suppression. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateAuditSuppression 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 UpdateAuditSuppression service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateAuditSuppression">REST API Reference for UpdateAuditSuppression Operation</seealso> public virtual Task<UpdateAuditSuppressionResponse> UpdateAuditSuppressionAsync(UpdateAuditSuppressionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateAuditSuppressionRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateAuditSuppressionResponseUnmarshaller.Instance; return InvokeAsync<UpdateAuditSuppressionResponse>(request, options, cancellationToken); } #endregion #region UpdateAuthorizer /// <summary> /// Updates an authorizer. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateAuthorizer service method.</param> /// /// <returns>The response from the UpdateAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateAuthorizer">REST API Reference for UpdateAuthorizer Operation</seealso> public virtual UpdateAuthorizerResponse UpdateAuthorizer(UpdateAuthorizerRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateAuthorizerResponseUnmarshaller.Instance; return Invoke<UpdateAuthorizerResponse>(request, options); } /// <summary> /// Updates an authorizer. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateAuthorizer 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 UpdateAuthorizer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.LimitExceededException"> /// A limit has been exceeded. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateAuthorizer">REST API Reference for UpdateAuthorizer Operation</seealso> public virtual Task<UpdateAuthorizerResponse> UpdateAuthorizerAsync(UpdateAuthorizerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateAuthorizerRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateAuthorizerResponseUnmarshaller.Instance; return InvokeAsync<UpdateAuthorizerResponse>(request, options, cancellationToken); } #endregion #region UpdateBillingGroup /// <summary> /// Updates information about the billing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateBillingGroup service method.</param> /// /// <returns>The response from the UpdateBillingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateBillingGroup">REST API Reference for UpdateBillingGroup Operation</seealso> public virtual UpdateBillingGroupResponse UpdateBillingGroup(UpdateBillingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateBillingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateBillingGroupResponseUnmarshaller.Instance; return Invoke<UpdateBillingGroupResponse>(request, options); } /// <summary> /// Updates information about the billing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateBillingGroup 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 UpdateBillingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateBillingGroup">REST API Reference for UpdateBillingGroup Operation</seealso> public virtual Task<UpdateBillingGroupResponse> UpdateBillingGroupAsync(UpdateBillingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateBillingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateBillingGroupResponseUnmarshaller.Instance; return InvokeAsync<UpdateBillingGroupResponse>(request, options, cancellationToken); } #endregion #region UpdateCACertificate /// <summary> /// Updates a registered CA certificate. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateCACertificate service method.</param> /// /// <returns>The response from the UpdateCACertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateCACertificate">REST API Reference for UpdateCACertificate Operation</seealso> public virtual UpdateCACertificateResponse UpdateCACertificate(UpdateCACertificateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateCACertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateCACertificateResponseUnmarshaller.Instance; return Invoke<UpdateCACertificateResponse>(request, options); } /// <summary> /// Updates a registered CA certificate. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateCACertificate 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 UpdateCACertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateCACertificate">REST API Reference for UpdateCACertificate Operation</seealso> public virtual Task<UpdateCACertificateResponse> UpdateCACertificateAsync(UpdateCACertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateCACertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateCACertificateResponseUnmarshaller.Instance; return InvokeAsync<UpdateCACertificateResponse>(request, options, cancellationToken); } #endregion #region UpdateCertificate /// <summary> /// Updates the status of the specified certificate. This operation is idempotent. /// /// /// <para> /// Certificates must be in the ACTIVE state to authenticate devices that use a certificate /// to connect to AWS IoT. /// </para> /// /// <para> /// Within a few minutes of updating a certificate from the ACTIVE state to any other /// state, AWS IoT disconnects all devices that used that certificate to connect. Devices /// cannot use a certificate that is not in the ACTIVE state to reconnect. /// </para> /// </summary> /// <param name="certificateId">The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</param> /// <param name="newStatus">The new status. <b>Note:</b> Setting the status to PENDING_TRANSFER or PENDING_ACTIVATION will result in an exception being thrown. PENDING_TRANSFER and PENDING_ACTIVATION are statuses used internally by AWS IoT. They are not intended for developer use. <b>Note:</b> The status value REGISTER_INACTIVE is deprecated and should not be used.</param> /// /// <returns>The response from the UpdateCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateCertificate">REST API Reference for UpdateCertificate Operation</seealso> public virtual UpdateCertificateResponse UpdateCertificate(string certificateId, CertificateStatus newStatus) { var request = new UpdateCertificateRequest(); request.CertificateId = certificateId; request.NewStatus = newStatus; return UpdateCertificate(request); } /// <summary> /// Updates the status of the specified certificate. This operation is idempotent. /// /// /// <para> /// Certificates must be in the ACTIVE state to authenticate devices that use a certificate /// to connect to AWS IoT. /// </para> /// /// <para> /// Within a few minutes of updating a certificate from the ACTIVE state to any other /// state, AWS IoT disconnects all devices that used that certificate to connect. Devices /// cannot use a certificate that is not in the ACTIVE state to reconnect. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateCertificate service method.</param> /// /// <returns>The response from the UpdateCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateCertificate">REST API Reference for UpdateCertificate Operation</seealso> public virtual UpdateCertificateResponse UpdateCertificate(UpdateCertificateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateCertificateResponseUnmarshaller.Instance; return Invoke<UpdateCertificateResponse>(request, options); } /// <summary> /// Updates the status of the specified certificate. This operation is idempotent. /// /// /// <para> /// Certificates must be in the ACTIVE state to authenticate devices that use a certificate /// to connect to AWS IoT. /// </para> /// /// <para> /// Within a few minutes of updating a certificate from the ACTIVE state to any other /// state, AWS IoT disconnects all devices that used that certificate to connect. Devices /// cannot use a certificate that is not in the ACTIVE state to reconnect. /// </para> /// </summary> /// <param name="certificateId">The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</param> /// <param name="newStatus">The new status. <b>Note:</b> Setting the status to PENDING_TRANSFER or PENDING_ACTIVATION will result in an exception being thrown. PENDING_TRANSFER and PENDING_ACTIVATION are statuses used internally by AWS IoT. They are not intended for developer use. <b>Note:</b> The status value REGISTER_INACTIVE is deprecated and should not be used.</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 UpdateCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateCertificate">REST API Reference for UpdateCertificate Operation</seealso> public virtual Task<UpdateCertificateResponse> UpdateCertificateAsync(string certificateId, CertificateStatus newStatus, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new UpdateCertificateRequest(); request.CertificateId = certificateId; request.NewStatus = newStatus; return UpdateCertificateAsync(request, cancellationToken); } /// <summary> /// Updates the status of the specified certificate. This operation is idempotent. /// /// /// <para> /// Certificates must be in the ACTIVE state to authenticate devices that use a certificate /// to connect to AWS IoT. /// </para> /// /// <para> /// Within a few minutes of updating a certificate from the ACTIVE state to any other /// state, AWS IoT disconnects all devices that used that certificate to connect. Devices /// cannot use a certificate that is not in the ACTIVE state to reconnect. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateCertificate 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 UpdateCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateCertificate">REST API Reference for UpdateCertificate Operation</seealso> public virtual Task<UpdateCertificateResponse> UpdateCertificateAsync(UpdateCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateCertificateRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateCertificateResponseUnmarshaller.Instance; return InvokeAsync<UpdateCertificateResponse>(request, options, cancellationToken); } #endregion #region UpdateDimension /// <summary> /// Updates the definition for a dimension. You cannot change the type of a dimension /// after it is created (you can delete it and re-create it). /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateDimension service method.</param> /// /// <returns>The response from the UpdateDimension service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateDimension">REST API Reference for UpdateDimension Operation</seealso> public virtual UpdateDimensionResponse UpdateDimension(UpdateDimensionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateDimensionRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateDimensionResponseUnmarshaller.Instance; return Invoke<UpdateDimensionResponse>(request, options); } /// <summary> /// Updates the definition for a dimension. You cannot change the type of a dimension /// after it is created (you can delete it and re-create it). /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateDimension 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 UpdateDimension service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateDimension">REST API Reference for UpdateDimension Operation</seealso> public virtual Task<UpdateDimensionResponse> UpdateDimensionAsync(UpdateDimensionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateDimensionRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateDimensionResponseUnmarshaller.Instance; return InvokeAsync<UpdateDimensionResponse>(request, options, cancellationToken); } #endregion #region UpdateDomainConfiguration /// <summary> /// Updates values stored in the domain configuration. Domain configurations for default /// endpoints can't be updated. /// /// <note> /// <para> /// The domain configuration feature is in public preview and is subject to change. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateDomainConfiguration service method.</param> /// /// <returns>The response from the UpdateDomainConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateValidationException"> /// The certificate is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateDomainConfiguration">REST API Reference for UpdateDomainConfiguration Operation</seealso> public virtual UpdateDomainConfigurationResponse UpdateDomainConfiguration(UpdateDomainConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateDomainConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateDomainConfigurationResponseUnmarshaller.Instance; return Invoke<UpdateDomainConfigurationResponse>(request, options); } /// <summary> /// Updates values stored in the domain configuration. Domain configurations for default /// endpoints can't be updated. /// /// <note> /// <para> /// The domain configuration feature is in public preview and is subject to change. /// </para> /// </note> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateDomainConfiguration 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 UpdateDomainConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateValidationException"> /// The certificate is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateDomainConfiguration">REST API Reference for UpdateDomainConfiguration Operation</seealso> public virtual Task<UpdateDomainConfigurationResponse> UpdateDomainConfigurationAsync(UpdateDomainConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateDomainConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateDomainConfigurationResponseUnmarshaller.Instance; return InvokeAsync<UpdateDomainConfigurationResponse>(request, options, cancellationToken); } #endregion #region UpdateDynamicThingGroup /// <summary> /// Updates a dynamic thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateDynamicThingGroup service method.</param> /// /// <returns>The response from the UpdateDynamicThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidQueryException"> /// The query is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateDynamicThingGroup">REST API Reference for UpdateDynamicThingGroup Operation</seealso> public virtual UpdateDynamicThingGroupResponse UpdateDynamicThingGroup(UpdateDynamicThingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateDynamicThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateDynamicThingGroupResponseUnmarshaller.Instance; return Invoke<UpdateDynamicThingGroupResponse>(request, options); } /// <summary> /// Updates a dynamic thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateDynamicThingGroup 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 UpdateDynamicThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidQueryException"> /// The query is invalid. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateDynamicThingGroup">REST API Reference for UpdateDynamicThingGroup Operation</seealso> public virtual Task<UpdateDynamicThingGroupResponse> UpdateDynamicThingGroupAsync(UpdateDynamicThingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateDynamicThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateDynamicThingGroupResponseUnmarshaller.Instance; return InvokeAsync<UpdateDynamicThingGroupResponse>(request, options, cancellationToken); } #endregion #region UpdateEventConfigurations /// <summary> /// Updates the event configurations. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateEventConfigurations service method.</param> /// /// <returns>The response from the UpdateEventConfigurations service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateEventConfigurations">REST API Reference for UpdateEventConfigurations Operation</seealso> public virtual UpdateEventConfigurationsResponse UpdateEventConfigurations(UpdateEventConfigurationsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateEventConfigurationsRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateEventConfigurationsResponseUnmarshaller.Instance; return Invoke<UpdateEventConfigurationsResponse>(request, options); } /// <summary> /// Updates the event configurations. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateEventConfigurations 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 UpdateEventConfigurations service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateEventConfigurations">REST API Reference for UpdateEventConfigurations Operation</seealso> public virtual Task<UpdateEventConfigurationsResponse> UpdateEventConfigurationsAsync(UpdateEventConfigurationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateEventConfigurationsRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateEventConfigurationsResponseUnmarshaller.Instance; return InvokeAsync<UpdateEventConfigurationsResponse>(request, options, cancellationToken); } #endregion #region UpdateIndexingConfiguration /// <summary> /// Updates the search configuration. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateIndexingConfiguration service method.</param> /// /// <returns>The response from the UpdateIndexingConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateIndexingConfiguration">REST API Reference for UpdateIndexingConfiguration Operation</seealso> public virtual UpdateIndexingConfigurationResponse UpdateIndexingConfiguration(UpdateIndexingConfigurationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateIndexingConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateIndexingConfigurationResponseUnmarshaller.Instance; return Invoke<UpdateIndexingConfigurationResponse>(request, options); } /// <summary> /// Updates the search configuration. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateIndexingConfiguration 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 UpdateIndexingConfiguration service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateIndexingConfiguration">REST API Reference for UpdateIndexingConfiguration Operation</seealso> public virtual Task<UpdateIndexingConfigurationResponse> UpdateIndexingConfigurationAsync(UpdateIndexingConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateIndexingConfigurationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateIndexingConfigurationResponseUnmarshaller.Instance; return InvokeAsync<UpdateIndexingConfigurationResponse>(request, options, cancellationToken); } #endregion #region UpdateJob /// <summary> /// Updates supported fields of the specified job. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateJob service method.</param> /// /// <returns>The response from the UpdateJob service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateJob">REST API Reference for UpdateJob Operation</seealso> public virtual UpdateJobResponse UpdateJob(UpdateJobRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateJobRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateJobResponseUnmarshaller.Instance; return Invoke<UpdateJobResponse>(request, options); } /// <summary> /// Updates supported fields of the specified job. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateJob 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 UpdateJob service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateJob">REST API Reference for UpdateJob Operation</seealso> public virtual Task<UpdateJobResponse> UpdateJobAsync(UpdateJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateJobRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateJobResponseUnmarshaller.Instance; return InvokeAsync<UpdateJobResponse>(request, options, cancellationToken); } #endregion #region UpdateMitigationAction /// <summary> /// Updates the definition for the specified mitigation action. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateMitigationAction service method.</param> /// /// <returns>The response from the UpdateMitigationAction service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateMitigationAction">REST API Reference for UpdateMitigationAction Operation</seealso> public virtual UpdateMitigationActionResponse UpdateMitigationAction(UpdateMitigationActionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateMitigationActionRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateMitigationActionResponseUnmarshaller.Instance; return Invoke<UpdateMitigationActionResponse>(request, options); } /// <summary> /// Updates the definition for the specified mitigation action. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateMitigationAction 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 UpdateMitigationAction service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateMitigationAction">REST API Reference for UpdateMitigationAction Operation</seealso> public virtual Task<UpdateMitigationActionResponse> UpdateMitigationActionAsync(UpdateMitigationActionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateMitigationActionRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateMitigationActionResponseUnmarshaller.Instance; return InvokeAsync<UpdateMitigationActionResponse>(request, options, cancellationToken); } #endregion #region UpdateProvisioningTemplate /// <summary> /// Updates a fleet provisioning template. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateProvisioningTemplate service method.</param> /// /// <returns>The response from the UpdateProvisioningTemplate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateProvisioningTemplate">REST API Reference for UpdateProvisioningTemplate Operation</seealso> public virtual UpdateProvisioningTemplateResponse UpdateProvisioningTemplate(UpdateProvisioningTemplateRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateProvisioningTemplateRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateProvisioningTemplateResponseUnmarshaller.Instance; return Invoke<UpdateProvisioningTemplateResponse>(request, options); } /// <summary> /// Updates a fleet provisioning template. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateProvisioningTemplate 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 UpdateProvisioningTemplate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateProvisioningTemplate">REST API Reference for UpdateProvisioningTemplate Operation</seealso> public virtual Task<UpdateProvisioningTemplateResponse> UpdateProvisioningTemplateAsync(UpdateProvisioningTemplateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateProvisioningTemplateRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateProvisioningTemplateResponseUnmarshaller.Instance; return InvokeAsync<UpdateProvisioningTemplateResponse>(request, options, cancellationToken); } #endregion #region UpdateRoleAlias /// <summary> /// Updates a role alias. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateRoleAlias service method.</param> /// /// <returns>The response from the UpdateRoleAlias service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateRoleAlias">REST API Reference for UpdateRoleAlias Operation</seealso> public virtual UpdateRoleAliasResponse UpdateRoleAlias(UpdateRoleAliasRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateRoleAliasRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateRoleAliasResponseUnmarshaller.Instance; return Invoke<UpdateRoleAliasResponse>(request, options); } /// <summary> /// Updates a role alias. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateRoleAlias 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 UpdateRoleAlias service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateRoleAlias">REST API Reference for UpdateRoleAlias Operation</seealso> public virtual Task<UpdateRoleAliasResponse> UpdateRoleAliasAsync(UpdateRoleAliasRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateRoleAliasRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateRoleAliasResponseUnmarshaller.Instance; return InvokeAsync<UpdateRoleAliasResponse>(request, options, cancellationToken); } #endregion #region UpdateScheduledAudit /// <summary> /// Updates a scheduled audit, including which checks are performed and how often the /// audit takes place. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateScheduledAudit service method.</param> /// /// <returns>The response from the UpdateScheduledAudit service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateScheduledAudit">REST API Reference for UpdateScheduledAudit Operation</seealso> public virtual UpdateScheduledAuditResponse UpdateScheduledAudit(UpdateScheduledAuditRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateScheduledAuditRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateScheduledAuditResponseUnmarshaller.Instance; return Invoke<UpdateScheduledAuditResponse>(request, options); } /// <summary> /// Updates a scheduled audit, including which checks are performed and how often the /// audit takes place. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateScheduledAudit 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 UpdateScheduledAudit service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateScheduledAudit">REST API Reference for UpdateScheduledAudit Operation</seealso> public virtual Task<UpdateScheduledAuditResponse> UpdateScheduledAuditAsync(UpdateScheduledAuditRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateScheduledAuditRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateScheduledAuditResponseUnmarshaller.Instance; return InvokeAsync<UpdateScheduledAuditResponse>(request, options, cancellationToken); } #endregion #region UpdateSecurityProfile /// <summary> /// Updates a Device Defender security profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateSecurityProfile service method.</param> /// /// <returns>The response from the UpdateSecurityProfile service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateSecurityProfile">REST API Reference for UpdateSecurityProfile Operation</seealso> public virtual UpdateSecurityProfileResponse UpdateSecurityProfile(UpdateSecurityProfileRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateSecurityProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateSecurityProfileResponseUnmarshaller.Instance; return Invoke<UpdateSecurityProfileResponse>(request, options); } /// <summary> /// Updates a Device Defender security profile. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateSecurityProfile 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 UpdateSecurityProfile service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateSecurityProfile">REST API Reference for UpdateSecurityProfile Operation</seealso> public virtual Task<UpdateSecurityProfileResponse> UpdateSecurityProfileAsync(UpdateSecurityProfileRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateSecurityProfileRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateSecurityProfileResponseUnmarshaller.Instance; return InvokeAsync<UpdateSecurityProfileResponse>(request, options, cancellationToken); } #endregion #region UpdateStream /// <summary> /// Updates an existing stream. The stream version will be incremented by one. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateStream service method.</param> /// /// <returns>The response from the UpdateStream service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateStream">REST API Reference for UpdateStream Operation</seealso> public virtual UpdateStreamResponse UpdateStream(UpdateStreamRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateStreamRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateStreamResponseUnmarshaller.Instance; return Invoke<UpdateStreamResponse>(request, options); } /// <summary> /// Updates an existing stream. The stream version will be incremented by one. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateStream 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 UpdateStream service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateStream">REST API Reference for UpdateStream Operation</seealso> public virtual Task<UpdateStreamResponse> UpdateStreamAsync(UpdateStreamRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateStreamRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateStreamResponseUnmarshaller.Instance; return InvokeAsync<UpdateStreamResponse>(request, options, cancellationToken); } #endregion #region UpdateThing /// <summary> /// Updates the data for a thing. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateThing service method.</param> /// /// <returns>The response from the UpdateThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateThing">REST API Reference for UpdateThing Operation</seealso> public virtual UpdateThingResponse UpdateThing(UpdateThingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateThingRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateThingResponseUnmarshaller.Instance; return Invoke<UpdateThingResponse>(request, options); } /// <summary> /// Updates the data for a thing. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateThing 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 UpdateThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateThing">REST API Reference for UpdateThing Operation</seealso> public virtual Task<UpdateThingResponse> UpdateThingAsync(UpdateThingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateThingRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateThingResponseUnmarshaller.Instance; return InvokeAsync<UpdateThingResponse>(request, options, cancellationToken); } #endregion #region UpdateThingGroup /// <summary> /// Update a thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateThingGroup service method.</param> /// /// <returns>The response from the UpdateThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateThingGroup">REST API Reference for UpdateThingGroup Operation</seealso> public virtual UpdateThingGroupResponse UpdateThingGroup(UpdateThingGroupRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateThingGroupResponseUnmarshaller.Instance; return Invoke<UpdateThingGroupResponse>(request, options); } /// <summary> /// Update a thing group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateThingGroup 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 UpdateThingGroup service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.VersionConflictException"> /// An exception thrown when the version of an entity specified with the <code>expectedVersion</code> /// parameter does not match the latest version in the system. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateThingGroup">REST API Reference for UpdateThingGroup Operation</seealso> public virtual Task<UpdateThingGroupResponse> UpdateThingGroupAsync(UpdateThingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateThingGroupRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateThingGroupResponseUnmarshaller.Instance; return InvokeAsync<UpdateThingGroupResponse>(request, options, cancellationToken); } #endregion #region UpdateThingGroupsForThing /// <summary> /// Updates the groups to which the thing belongs. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateThingGroupsForThing service method.</param> /// /// <returns>The response from the UpdateThingGroupsForThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateThingGroupsForThing">REST API Reference for UpdateThingGroupsForThing Operation</seealso> public virtual UpdateThingGroupsForThingResponse UpdateThingGroupsForThing(UpdateThingGroupsForThingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateThingGroupsForThingRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateThingGroupsForThingResponseUnmarshaller.Instance; return Invoke<UpdateThingGroupsForThingResponse>(request, options); } /// <summary> /// Updates the groups to which the thing belongs. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateThingGroupsForThing 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 UpdateThingGroupsForThing service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateThingGroupsForThing">REST API Reference for UpdateThingGroupsForThing Operation</seealso> public virtual Task<UpdateThingGroupsForThingResponse> UpdateThingGroupsForThingAsync(UpdateThingGroupsForThingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateThingGroupsForThingRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateThingGroupsForThingResponseUnmarshaller.Instance; return InvokeAsync<UpdateThingGroupsForThingResponse>(request, options, cancellationToken); } #endregion #region UpdateTopicRuleDestination /// <summary> /// Updates a topic rule destination. You use this to change the status, endpoint URL, /// or confirmation URL of the destination. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateTopicRuleDestination service method.</param> /// /// <returns>The response from the UpdateTopicRuleDestination service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateTopicRuleDestination">REST API Reference for UpdateTopicRuleDestination Operation</seealso> public virtual UpdateTopicRuleDestinationResponse UpdateTopicRuleDestination(UpdateTopicRuleDestinationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateTopicRuleDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateTopicRuleDestinationResponseUnmarshaller.Instance; return Invoke<UpdateTopicRuleDestinationResponse>(request, options); } /// <summary> /// Updates a topic rule destination. You use this to change the status, endpoint URL, /// or confirmation URL of the destination. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateTopicRuleDestination 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 UpdateTopicRuleDestination service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.ConflictingResourceUpdateException"> /// A conflicting resource update exception. This exception is thrown when two pending /// updates cause a conflict. /// </exception> /// <exception cref="Amazon.IoT.Model.InternalException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/UpdateTopicRuleDestination">REST API Reference for UpdateTopicRuleDestination Operation</seealso> public virtual Task<UpdateTopicRuleDestinationResponse> UpdateTopicRuleDestinationAsync(UpdateTopicRuleDestinationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateTopicRuleDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateTopicRuleDestinationResponseUnmarshaller.Instance; return InvokeAsync<UpdateTopicRuleDestinationResponse>(request, options, cancellationToken); } #endregion #region ValidateSecurityProfileBehaviors /// <summary> /// Validates a Device Defender security profile behaviors specification. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ValidateSecurityProfileBehaviors service method.</param> /// /// <returns>The response from the ValidateSecurityProfileBehaviors service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ValidateSecurityProfileBehaviors">REST API Reference for ValidateSecurityProfileBehaviors Operation</seealso> public virtual ValidateSecurityProfileBehaviorsResponse ValidateSecurityProfileBehaviors(ValidateSecurityProfileBehaviorsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ValidateSecurityProfileBehaviorsRequestMarshaller.Instance; options.ResponseUnmarshaller = ValidateSecurityProfileBehaviorsResponseUnmarshaller.Instance; return Invoke<ValidateSecurityProfileBehaviorsResponse>(request, options); } /// <summary> /// Validates a Device Defender security profile behaviors specification. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ValidateSecurityProfileBehaviors 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 ValidateSecurityProfileBehaviors service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ValidateSecurityProfileBehaviors">REST API Reference for ValidateSecurityProfileBehaviors Operation</seealso> public virtual Task<ValidateSecurityProfileBehaviorsResponse> ValidateSecurityProfileBehaviorsAsync(ValidateSecurityProfileBehaviorsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ValidateSecurityProfileBehaviorsRequestMarshaller.Instance; options.ResponseUnmarshaller = ValidateSecurityProfileBehaviorsResponseUnmarshaller.Instance; return InvokeAsync<ValidateSecurityProfileBehaviorsResponse>(request, options, cancellationToken); } #endregion } }
52.506441
385
0.654159
[ "Apache-2.0" ]
pranavmishra7/awssdks
sdk/src/Services/IoT/Generated/_bcl45/AmazonIoTClient.cs
1,027,131
C#
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ // **NOTE** This file was generated by a tool and any changes will be overwritten. // <auto-generated/> // Template Source: IEntityRequest.cs.tt namespace Microsoft.Graph { using System; using System.IO; using System.Net.Http; using System.Threading; using System.Linq.Expressions; /// <summary> /// The interface IWindows10TeamGeneralConfigurationRequest. /// </summary> public partial interface IWindows10TeamGeneralConfigurationRequest : IBaseRequest { /// <summary> /// Creates the specified Windows10TeamGeneralConfiguration using POST. /// </summary> /// <param name="windows10TeamGeneralConfigurationToCreate">The Windows10TeamGeneralConfiguration to create.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created Windows10TeamGeneralConfiguration.</returns> System.Threading.Tasks.Task<Windows10TeamGeneralConfiguration> CreateAsync(Windows10TeamGeneralConfiguration windows10TeamGeneralConfigurationToCreate, CancellationToken cancellationToken = default); /// <summary> /// Creates the specified Windows10TeamGeneralConfiguration using POST and returns a <see cref="GraphResponse{Windows10TeamGeneralConfiguration}"/> object. /// </summary> /// <param name="windows10TeamGeneralConfigurationToCreate">The Windows10TeamGeneralConfiguration to create.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The <see cref="GraphResponse{Windows10TeamGeneralConfiguration}"/> object of the request.</returns> System.Threading.Tasks.Task<GraphResponse<Windows10TeamGeneralConfiguration>> CreateResponseAsync(Windows10TeamGeneralConfiguration windows10TeamGeneralConfigurationToCreate, CancellationToken cancellationToken = default); /// <summary> /// Deletes the specified Windows10TeamGeneralConfiguration. /// </summary> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The task to await.</returns> System.Threading.Tasks.Task DeleteAsync(CancellationToken cancellationToken = default); /// <summary> /// Deletes the specified Windows10TeamGeneralConfiguration and returns a <see cref="GraphResponse"/> object. /// </summary> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The task of <see cref="GraphResponse"/> to await.</returns> System.Threading.Tasks.Task<GraphResponse> DeleteResponseAsync(CancellationToken cancellationToken = default); /// <summary> /// Gets the specified Windows10TeamGeneralConfiguration. /// </summary> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The Windows10TeamGeneralConfiguration.</returns> System.Threading.Tasks.Task<Windows10TeamGeneralConfiguration> GetAsync(CancellationToken cancellationToken = default); /// <summary> /// Gets the specified Windows10TeamGeneralConfiguration and returns a <see cref="GraphResponse{Windows10TeamGeneralConfiguration}"/> object. /// </summary> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The <see cref="GraphResponse{Windows10TeamGeneralConfiguration}"/> object of the request.</returns> System.Threading.Tasks.Task<GraphResponse<Windows10TeamGeneralConfiguration>> GetResponseAsync(CancellationToken cancellationToken = default); /// <summary> /// Updates the specified Windows10TeamGeneralConfiguration using PATCH. /// </summary> /// <param name="windows10TeamGeneralConfigurationToUpdate">The Windows10TeamGeneralConfiguration to update.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <exception cref="ClientException">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception> /// <returns>The updated Windows10TeamGeneralConfiguration.</returns> System.Threading.Tasks.Task<Windows10TeamGeneralConfiguration> UpdateAsync(Windows10TeamGeneralConfiguration windows10TeamGeneralConfigurationToUpdate, CancellationToken cancellationToken = default); /// <summary> /// Updates the specified Windows10TeamGeneralConfiguration using PATCH and returns a <see cref="GraphResponse{Windows10TeamGeneralConfiguration}"/> object. /// </summary> /// <param name="windows10TeamGeneralConfigurationToUpdate">The Windows10TeamGeneralConfiguration to update.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <exception cref="ClientException">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception> /// <returns>The <see cref="GraphResponse{Windows10TeamGeneralConfiguration}"/> object of the request.</returns> System.Threading.Tasks.Task<GraphResponse<Windows10TeamGeneralConfiguration>> UpdateResponseAsync(Windows10TeamGeneralConfiguration windows10TeamGeneralConfigurationToUpdate, CancellationToken cancellationToken = default); /// <summary> /// Updates the specified Windows10TeamGeneralConfiguration using PUT. /// </summary> /// <param name="windows10TeamGeneralConfigurationToUpdate">The Windows10TeamGeneralConfiguration object to update.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The task to await.</returns> System.Threading.Tasks.Task<Windows10TeamGeneralConfiguration> PutAsync(Windows10TeamGeneralConfiguration windows10TeamGeneralConfigurationToUpdate, CancellationToken cancellationToken = default); /// <summary> /// Updates the specified Windows10TeamGeneralConfiguration using PUT and returns a <see cref="GraphResponse{Windows10TeamGeneralConfiguration}"/> object. /// </summary> /// <param name="windows10TeamGeneralConfigurationToUpdate">The Windows10TeamGeneralConfiguration object to update.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The task of <see cref="GraphResponse{Windows10TeamGeneralConfiguration}"/> to await.</returns> System.Threading.Tasks.Task<GraphResponse<Windows10TeamGeneralConfiguration>> PutResponseAsync(Windows10TeamGeneralConfiguration windows10TeamGeneralConfigurationToUpdate, CancellationToken cancellationToken = default); /// <summary> /// Adds the specified expand value to the request. /// </summary> /// <param name="value">The expand value.</param> /// <returns>The request object to send.</returns> IWindows10TeamGeneralConfigurationRequest Expand(string value); /// <summary> /// Adds the specified expand value to the request. /// </summary> /// <param name="expandExpression">The expression from which to calculate the expand value.</param> /// <returns>The request object to send.</returns> IWindows10TeamGeneralConfigurationRequest Expand(Expression<Func<Windows10TeamGeneralConfiguration, object>> expandExpression); /// <summary> /// Adds the specified select value to the request. /// </summary> /// <param name="value">The select value.</param> /// <returns>The request object to send.</returns> IWindows10TeamGeneralConfigurationRequest Select(string value); /// <summary> /// Adds the specified select value to the request. /// </summary> /// <param name="selectExpression">The expression from which to calculate the select value.</param> /// <returns>The request object to send.</returns> IWindows10TeamGeneralConfigurationRequest Select(Expression<Func<Windows10TeamGeneralConfiguration, object>> selectExpression); } }
65.969466
230
0.711872
[ "MIT" ]
Aliases/msgraph-sdk-dotnet
src/Microsoft.Graph/Generated/requests/IWindows10TeamGeneralConfigurationRequest.cs
8,642
C#
// *********************************************************************** // Assembly : XLabs.Platform.iOS // Author : XLabs Team // Created : 12-27-2015 // // Last Modified By : XLabs Team // Last Modified On : 01-04-2016 // *********************************************************************** // <copyright file="MediaPickerPopoverDelegate.cs" company="XLabs Team"> // Copyright (c) XLabs Team. All rights reserved. // </copyright> // <summary> // This project is licensed under the Apache 2.0 license // https://github.com/XLabs/Xamarin-Forms-Labs/blob/master/LICENSE // // XLabs is a open source project that aims to provide a powerfull and cross // platform set of controls tailored to work with Xamarin Forms. // </summary> // *********************************************************************** // using UIKit; [assembly: Xamarin.Forms.Dependency(typeof(XLabs.Platform.Services.Media.MediaPickerPopoverDelegate))] namespace XLabs.Platform.Services.Media { /// <summary> /// Class MediaPickerPopoverDelegate. /// </summary> internal class MediaPickerPopoverDelegate : UIPopoverControllerDelegate { /// <summary> /// The _picker /// </summary> private readonly UIImagePickerController _picker; /// <summary> /// The _picker delegate /// </summary> private readonly MediaPickerDelegate _pickerDelegate; /// <summary> /// Initializes a new instance of the <see cref="MediaPickerPopoverDelegate"/> class. /// </summary> /// <param name="pickerDelegate">The picker delegate.</param> /// <param name="picker">The picker.</param> internal MediaPickerPopoverDelegate(MediaPickerDelegate pickerDelegate, UIImagePickerController picker) { _pickerDelegate = pickerDelegate; _picker = picker; } /// <summary> /// Shoulds the dismiss. /// </summary> /// <param name="popoverController">The popover controller.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> public override bool ShouldDismiss(UIPopoverController popoverController) { return true; } /// <summary> /// Dids the dismiss. /// </summary> /// <param name="popoverController">The popover controller.</param> public override void DidDismiss(UIPopoverController popoverController) { _pickerDelegate.Canceled(_picker); } } }
36.619718
111
0.57
[ "Apache-2.0" ]
danrocks/MyVirtualClinic
MyVirtualClinic/MyVirtualClinic.iOS/MediaPickerPopoverDelegate.cs
2,602
C#
using System.Text.Json.Serialization; namespace Essensoft.Paylink.Alipay.Domain { /// <summary> /// AlipayOpenMiniInnerbaseinfoQueryModel Data Structure. /// </summary> public class AlipayOpenMiniInnerbaseinfoQueryModel : AlipayObject { /// <summary> /// 小程序类型,TINYAPP_TEMPLATE,TINYAPP_NORMAL,TINYAPP_PLUGIN,使用mini_app_name查询的时候,该字段要求必传。 /// </summary> [JsonPropertyName("app_sub_type")] public string AppSubType { get; set; } /// <summary> /// 租户code,alipay or taobao /// </summary> [JsonPropertyName("inst_code")] public string InstCode { get; set; } /// <summary> /// 小程序ID,mini_app_id 和 mini_app_name 两个需要有其中一个必填,当填了mini_app_id时只使用id去进行查询。 /// </summary> [JsonPropertyName("mini_app_id")] public string MiniAppId { get; set; } /// <summary> /// 小程序name,mini_app_id 和 mini_app_name 两个需要有其中一个必填,当填了mini_app_id时只使用id去进行查询。 /// </summary> [JsonPropertyName("mini_app_name")] public string MiniAppName { get; set; } } }
31.657143
94
0.629964
[ "MIT" ]
Frunck8206/payment
src/Essensoft.Paylink.Alipay/Domain/AlipayOpenMiniInnerbaseinfoQueryModel.cs
1,286
C#
#region MigraDoc - Creating Documents on the Fly // // Authors: // Stefan Lange // Klaus Potzesny // David Stephensen // // Copyright (c) 2001-2019 empira Software GmbH, Cologne Area (Germany) // // http://www.pdfsharp.com // http://www.migradoc.com // http://sourceforge.net/projects/pdfsharp // // 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 namespace PikaPDF.DocumentObjectModel.Shapes.Enums { /// <summary> /// Specifies the position of a shape. Values are used for both LeftPositon and TopPosition. /// </summary> public enum ShapePosition { /// <summary> /// Undefined position. /// </summary> Undefined, /// <summary> /// Left-aligned position. /// </summary> Left, /// <summary> /// Right-aligned position. /// </summary> Right, /// <summary> /// Centered position. /// </summary> Center, /// <summary> /// Top-aligned position. /// </summary> Top, /// <summary> /// Bottom-aligned position. /// </summary> Bottom, /// <summary> /// Used with mirrored margins: left-aligned on right page and right-aligned on left page. /// </summary> Inside, /// <summary> /// Used with mirrored margins: left-aligned on left page and right-aligned on right page. /// </summary> Outside } }
31.037037
98
0.640016
[ "MIT" ]
marcindawidziuk/PikaPDF
src/PikaPDF.DocumentObjectModel/Shapes/Enums/ShapePosition.cs
2,514
C#
namespace DotNetInterceptTester.My_System.IO.StreamWriter { public class Write_System_IO_StreamWriter_System_Single { public static bool _Write_System_IO_StreamWriter_System_Single( ) { //Parameters System.Single _value = null; //Exception Exception exception_Real = null; Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnValue_Real = System.IO.StreamWriter.Write(_value); } catch( Exception e ) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnValue_Intercepted = System.IO.StreamWriter.Write(_value); } catch( Exception e ) { exception_Intercepted = e; } } } }
17.795455
70
0.669221
[ "MIT" ]
SecurityInnovation/Holodeck
Test/Automation/DotNetInterceptTester/DotNetInterceptTester/System.IO.StreamWriter.Write(Single).cs
783
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.ComponentModel.Composition; using Microsoft.VisualStudio.ProjectSystem.Properties; namespace Microsoft.VisualStudio.ProjectSystem.VS.WindowsForms { /// <summary> /// A project-specific editor provider that is responsible for handling two things; /// /// 1) Add the Windows Forms designer to the list of editor factories for a "designable" source file, and /// determines whether it opens by default. /// /// 2) Persists whether the designer opens by default when the user uses Open With -> Set As Default. /// </summary> [Export(typeof(IProjectSpecificEditorProvider))] [AppliesTo(ProjectCapability.DotNet)] [Order(Order.BeforeDefault)] // Need to run before CPS's version before its deleted internal partial class WindowsFormsEditorProvider : IProjectSpecificEditorProvider { private static readonly SubTypeDescriptor[] s_subTypeDescriptors = new[] { new SubTypeDescriptor("Form", VSResources.WindowsFormEditor_DisplayName, useDesignerByDefault: true), new SubTypeDescriptor("Designer", VSResources.WindowsFormEditor_DisplayName, useDesignerByDefault: true), new SubTypeDescriptor("UserControl", VSResources.UserControlEditor_DisplayName, useDesignerByDefault: true), new SubTypeDescriptor("Component", VSResources.ComponentEditor_DisplayName, useDesignerByDefault: false) }; private readonly UnconfiguredProject _project; private readonly Lazy<IPhysicalProjectTree> _projectTree; private readonly Lazy<IProjectSystemOptions> _options; [ImportingConstructor] public WindowsFormsEditorProvider(UnconfiguredProject project, Lazy<IPhysicalProjectTree> projectTree, Lazy<IProjectSystemOptions> options) { _project = project; _projectTree = projectTree; _options = options; ProjectSpecificEditorProviders = new OrderPrecedenceImportCollection<IProjectSpecificEditorProvider, INamedExportMetadataView>(projectCapabilityCheckProvider: project); } [ImportMany] public OrderPrecedenceImportCollection<IProjectSpecificEditorProvider, INamedExportMetadataView> ProjectSpecificEditorProviders { get; } public async Task<IProjectSpecificEditorInfo?> GetSpecificEditorAsync(string documentMoniker) { Requires.NotNullOrEmpty(documentMoniker, nameof(documentMoniker)); IProjectSpecificEditorInfo? editor = await GetDefaultEditorAsync(documentMoniker); if (editor == null) return null; SubTypeDescriptor? descriptor = await GetSubTypeDescriptorAsync(documentMoniker); if (descriptor == null) return null; bool isDefaultEditor = await _options.Value.GetUseDesignerByDefaultAsync(descriptor.SubType, descriptor.UseDesignerByDefault); return new EditorInfo(editor.EditorFactory, descriptor.DisplayName, isDefaultEditor); } public async Task<bool> SetUseGlobalEditorAsync(string documentMoniker, bool useGlobalEditor) { Requires.NotNullOrEmpty(documentMoniker, nameof(documentMoniker)); SubTypeDescriptor? editorInfo = await GetSubTypeDescriptorAsync(documentMoniker); if (editorInfo == null) return false; // 'useGlobalEditor' means use the default editor that is registered for source files await _options.Value.SetUseDesignerByDefaultAsync(editorInfo.SubType, !useGlobalEditor); return true; } private async Task<IProjectSpecificEditorInfo?> GetDefaultEditorAsync(string documentMoniker) { IProjectSpecificEditorProvider? defaultProvider = GetDefaultEditorProvider(); if (defaultProvider == null) return null; return await defaultProvider.GetSpecificEditorAsync(documentMoniker); } private async Task<SubTypeDescriptor?> GetSubTypeDescriptorAsync(string documentMoniker) { string? subType = await GetSubTypeAsync(documentMoniker); if (subType != null) { foreach (SubTypeDescriptor descriptor in s_subTypeDescriptors) { if (StringComparers.PropertyLiteralValues.Equals(subType, descriptor.SubType)) return descriptor; } } return null; } private async Task<string?> GetSubTypeAsync(string documentMoniker) { IProjectItemTree? item = await FindCompileItemByMonikerAsync(documentMoniker); if (item == null) return null; ConfiguredProject? project = await _project.GetSuggestedConfiguredProjectAsync(); IRule? browseObject = GetBrowseObjectProperties(project!, item); if (browseObject == null) return null; return await browseObject.GetPropertyValueAsync(Compile.SubTypeProperty); } protected virtual IRule? GetBrowseObjectProperties(ConfiguredProject project, IProjectItemTree item) { // For unit testing purposes return item.GetBrowseObjectPropertiesViaSnapshotIfAvailable(project); } private async Task<IProjectItemTree?> FindCompileItemByMonikerAsync(string documentMoniker) { IProjectTreeServiceState result = await _projectTree.Value.TreeService.PublishAnyNonLoadingTreeAsync(); if (result.TreeProvider.FindByPath(result.Tree, documentMoniker) is IProjectItemTree treeItem && treeItem.Parent?.Flags.Contains(ProjectTreeFlags.SourceFile) == false && StringComparers.ItemTypes.Equals(treeItem.Item?.ItemType, Compile.SchemaName)) { return treeItem; } return null; } private IProjectSpecificEditorProvider? GetDefaultEditorProvider() { Lazy<IProjectSpecificEditorProvider> editorProvider = ProjectSpecificEditorProviders.FirstOrDefault(p => string.Equals(p.Metadata.Name, "Default", StringComparisons.NamedExports)); return editorProvider?.Value; } } }
46.65035
201
0.671563
[ "MIT" ]
brunom/project-system
src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/WindowsForms/WindowsFormsEditorProvider.cs
6,531
C#
using AutoMapper; using AutoMapper.Internal; using ElectronicWallet.Database.Entities; using ElectronicWallet.Repositories.Contracts; using ElectronicWallet.Common; using ElectronicWallet.Services.Contracts; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; namespace ElectronicWallet.Services { public abstract class ManagementServiceBase<T, TEntity> : IManagementServiceBase<T, TEntity> where T : class where TEntity : class { protected readonly IRepositoryBase<TEntity> Repository; protected readonly IMapper Mapper; public virtual string IdPropertyName => nameof(User.Id); public virtual string InactivatePropertyName => nameof(User.IsActive); public ManagementServiceBase(IRepositoryBase<TEntity> repository, IMapper mapper) { Repository = repository; Mapper = mapper; } public virtual async Task<T> CreateAsync(T request) { if (request == null) return null; T result = null; try { var entity = Mapper.Map<TEntity>(request); //auditory data if (entity is EntityBase _entity) { //_entity.CreatedBy = _entity.ModifiedBy = RequestUtils.GetUserEmail(); _entity.CreatedAt = _entity.CreatedAt = DateTime.UtcNow; SetAuditoryDataToInternalEntitiesProperties(_entity, true); } await Repository.CreateAsync(entity); await Repository.SaveChangesAsync(); result = request; var id = GetIdValue(entity); result.GetType().GetProperty(IdPropertyName).SetValue(result, id); } catch (Exception ex) { Console.WriteLine("Error creating entity. Entity = {name}, Request = {request}, Exception: {ex}", typeof(TEntity).Name, request, ex); } return result; } public virtual async Task<PagedResult<T>> GetAllAsync(int page, int size) { PagedResult<T> result = null; try { var entities = await Repository.ReadAsync(page, size); result = Mapper.Map<PagedResult<T>>(entities); } catch (Exception ex) { Console.WriteLine("Error getting all entities. Entity = {name}, Page = {page}, Size = {size}, Exception: {ex}", typeof(TEntity).Name, page, size, ex); } return result; } public virtual async Task<T> GetAsync(Expression<Func<TEntity, bool>> condition) { if (condition == null) return null; T result = null; try { var entity = await GetEntityByProperty(condition); result = Mapper.Map<T>(entity); } catch (Exception ex) { Console.WriteLine("Error getting entity by property. Entity = {name}, Condition = {condition}, Exception: {ex}", typeof(TEntity).Name, condition, ex); } return result; } public virtual async Task<bool> InactivateAsync(int id) { if (id == default) return false; bool success = false; try { var condition = CreateEntityByPropertyCondition(IdPropertyName, id); var entity = await GetEntityByProperty(condition); var property = entity.GetType().GetProperty(InactivatePropertyName); property.SetValue(entity, false); //auditory data if (entity is EntityBase _entity) { //_entity.ModifiedBy = RequestUtils.GetUserEmail(); _entity.UpdatedAt = DateTime.UtcNow; SetAuditoryDataToInternalEntitiesProperties(_entity); } await Repository.UpdateAsync(entity); await Repository.SaveChangesAsync(); success = true; } catch (Exception ex) { Console.WriteLine("Error inactivating entity. Entity = {name}, Id = {id}, Exception: {ex}", typeof(TEntity).Name, id, ex); } return success; } public virtual async Task<PagedResult<T>> SearchAsync(Expression<Func<TEntity, bool>> filters, int page, int size) { if (filters == null) return null; PagedResult<T> result = null; try { var entities = await Repository.WherePaginatedAsync(filters, Math.Abs(page), Math.Abs(size)); result = Mapper.Map<PagedResult<T>>(entities); } catch (Exception ex) { Console.WriteLine("Error searching entities. Entity = {name}, Filters = {filters}, Page = {page}, Size = {size}, Exception: {ex}", typeof(TEntity).Name, filters, page, size, ex); } return result; } public virtual async Task<bool> UpdateAsync(T request) { if (request == null) return false; bool success = false; try { var id = GetIdValue(request); var condition = CreateEntityByPropertyCondition(IdPropertyName, id); var entity = await GetEntityByProperty(condition); entity = Mapper.Map(request, entity); //auditory data if (entity is EntityBase _entity) { //_entity.ModifiedBy = RequestUtils.GetUserEmail(); _entity.UpdatedAt = DateTime.UtcNow; SetAuditoryDataToInternalEntitiesProperties(_entity); } await Repository.UpdateAsync(entity); await Repository.SaveChangesAsync(); success = true; } catch (Exception ex) { Console.WriteLine("Error updating entity. Entity = {name}, Request = {request}, Exception: {ex}", typeof(TEntity).Name, request, ex); } return success; } public virtual async Task<bool> DeleteAsync(Expression<Func<TEntity, bool>> condition) { if (condition == null) return false; bool success = true; try { var entity = await GetEntityByProperty(condition); await Repository.DeleteAsync(entity); await Repository.SaveChangesAsync(); } catch (Exception ex) { success = false; Console.WriteLine("Error deleting entity. Entity = {name}, Condition = {condition}, Exception: {ex}", typeof(TEntity).Name, condition, ex); } return success; } public async Task<bool> ExistAsync(Expression<Func<TEntity, bool>> condition) { if (condition == null) return false; bool exist = false; try { exist = await Repository.ExistsAsync(condition); } catch (Exception ex) { Console.WriteLine("Error checking if entity exist. Entity = {name}, Condition = {condition}, Exception: {ex}", typeof(TEntity).Name, condition, ex); } return exist; } private async Task<TEntity> GetEntityByProperty(Expression<Func<TEntity, bool>> condition) { if (condition == null) return null; TEntity entity = null; try { entity = await Repository.FindAsync(condition); } catch (Exception ex) { Console.WriteLine("Error getting entity by property. Entity = {name}, Condition = {condition}, Exception: {ex}", typeof(TEntity).Name, condition, ex); } return entity; } private Expression<Func<TEntity, bool>> CreateEntityByPropertyCondition(string propertyName, object propertyValue) { var param = Expression.Parameter(typeof(TEntity)); var condition = Expression.Lambda<Func<TEntity, bool>>( Expression.Equal ( Expression.Property(param, propertyName), Expression.Constant(propertyValue, propertyValue.GetType()) ), param); return condition; } private object GetIdValue(object source) => source.GetType().GetProperty(IdPropertyName).GetValue(source); private void SetAuditoryDataToInternalEntitiesProperties(EntityBase entity, bool isCreating = false) { var entityProperties = entity.GetType().GetProperties().Where(x => x.PropertyType.IsNonStringEnumerable()); if (entityProperties == null || entityProperties.Count() == 0) return; foreach (var entityProperty in entityProperties) { var entityPropertyValues = entityProperty?.GetValue(entity) as IEnumerable<EntityBase>; entityPropertyValues?.ToList().ForEach(x => { if (isCreating) { x.CreatedBy = entity.CreatedBy; x.CreatedAt = entity.CreatedAt; } x.ModifiedBy = entity.ModifiedBy; x.UpdatedAt = entity.UpdatedAt; SetAuditoryDataToInternalEntitiesProperties(x, isCreating); }); } } } }
35.3
194
0.545326
[ "MIT" ]
vebg/ElectronicWallet
ElectronicWallet.Services/ManagementServiceBase.cs
9,886
C#
// -------------------------------------------------------------------------------------------------------------------- // <copyright company="Exit Games GmbH"> // Exit Games GmbH, 2012 // </copyright> // <summary> // TimeKeeper Helper. See class description. // </summary> // <author>developer@exitgames.com</author> // -------------------------------------------------------------------------------------------------------------------- namespace ExitGames.Client.DemoParticle { using System; /// <summary> /// A utility class that turns it's ShouldExecute property to true after a set interval time has passed. /// </summary> /// <remarks> /// TimeKeepers can be useful to execute tasks in a certain interval within a game loop (integrating a recurring task into a certain thread). /// /// An interval can be overridden, when you set ShouldExecute to true. /// Call Reset after execution of whatever you do to re-enable the TimeKeeper (ShouldExecute becomes false until interval passed). /// Being based on Environment.TickCount, this is not very precise but cheap. /// </remarks> public class TimeKeeper { private int lastExecutionTime = Environment.TickCount; private bool shouldExecute; /// <summary>Interval in which ShouldExecute should be true (and something is executed).</summary> public int Interval { get; set; } /// <summary>A disabled TimeKeeper never turns ShouldExecute to true. Reset won't affect IsEnabled!</summary> public bool IsEnabled { get; set; } /// <summary>Turns true of the time interval has passed (after reset or creation) or someone set ShouldExecute manually.</summary> /// <remarks>Call Reset to start a new interval.</remarks> public bool ShouldExecute { get { return (this.IsEnabled && (this.shouldExecute || (Environment.TickCount - this.lastExecutionTime > this.Interval))); } set { this.shouldExecute = value; } } /// <summary> /// Creates a new TimeKeeper and sets it's interval. /// </summary> /// <param name="interval"></param> public TimeKeeper(int interval) { this.IsEnabled = true; this.Interval = interval; } /// <summary>ShouldExecute becomes false and the time interval is refreshed for next execution.</summary> /// <remarks>Does not affect IsEnabled.</remarks> public void Reset() { this.shouldExecute = false; this.lastExecutionTime = Environment.TickCount; } } }
42.936508
147
0.572274
[ "MIT" ]
DragonEyes7/ConcoursUBI17
Proto/Assets/Photon Unity Networking/UtilityScripts/TimeKeeper.cs
2,707
C#
using System; using System.Collections; using System.Collections.Generic; using System.Linq; namespace StackExchange.Redis.DataTypes.Collections { public class RedisSet<T> : ISet<T> { private const string RedisKeyTemplate = "Set:{0}"; private readonly IDatabase database; private readonly string redisKey; public RedisSet(IDatabase database, string name) { this.database = database ?? throw new ArgumentNullException(nameof(database)); this.redisKey = string.Format(RedisKeyTemplate, name ?? throw new ArgumentNullException(nameof(name))); } public bool Add(T item) => database.SetAdd(redisKey, item.ToRedisValue()); public long Add(IEnumerable<T> items) { if (items is null) { throw new ArgumentNullException(nameof(items)); } if (!items.Any()) { return 0; } return database.SetAdd(redisKey, items.ToRedisValues()); } public void ExceptWith(IEnumerable<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } SetCombineAndStore(SetOperation.Difference, other); } public void ExceptWith(RedisSet<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } SetCombineAndStore(SetOperation.Difference, other); } public void IntersectWith(IEnumerable<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } SetCombineAndStore(SetOperation.Intersect, other); } public void IntersectWith(RedisSet<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } SetCombineAndStore(SetOperation.Intersect, other); } public bool IsProperSubsetOf(IEnumerable<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } return Count < other.Count() && IsSubsetOf(other); } public bool IsProperSubsetOf(RedisSet<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } return Count < other.Count && IsSubsetOf(other); } public bool IsProperSupersetOf(IEnumerable<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } return Count > other.Count() && IsSupersetOf(other); } public bool IsProperSupersetOf(RedisSet<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } return Count > other.Count && IsSupersetOf(other); } public bool IsSubsetOf(IEnumerable<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } return !this.Except(other).Any(); } public bool IsSubsetOf(RedisSet<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } return !SetCombine(SetOperation.Difference, other).Any(); } public bool IsSupersetOf(IEnumerable<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } return !other.Except(this).Any(); } public bool IsSupersetOf(RedisSet<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } return !other.SetCombine(SetOperation.Difference, this).Any(); } public bool Overlaps(IEnumerable<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } foreach (var item in other) { if (Contains(item)) { return true; } } return false; } public bool Overlaps(RedisSet<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } return SetCombine(SetOperation.Intersect, other).Any(); } public bool SetEquals(IEnumerable<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } return IsSubsetOf(other) && IsSupersetOf(other); } public bool SetEquals(RedisSet<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } return IsSubsetOf(other) && IsSupersetOf(other); } public void SymmetricExceptWith(IEnumerable<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } var otherSet = new RedisSet<T>(database, Guid.NewGuid().ToString()); try { otherSet.Add(other); SymmetricExceptWith(otherSet); } finally { otherSet.Clear(); } } public void SymmetricExceptWith(RedisSet<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } var intersectedSet = new RedisSet<T>(database, Guid.NewGuid().ToString()); try { SetCombineAndStore(SetOperation.Intersect, intersectedSet, this, other); SetCombineAndStore(SetOperation.Union, other); SetCombineAndStore(SetOperation.Difference, intersectedSet); } finally { intersectedSet.Clear(); } } public void UnionWith(IEnumerable<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } SetCombineAndStore(SetOperation.Union, other); } public void UnionWith(RedisSet<T> other) { if (other is null) { throw new ArgumentNullException(nameof(other)); } SetCombineAndStore(SetOperation.Union, other); } void ICollection<T>.Add(T item) => Add(item); public void Clear() => database.KeyDelete(redisKey); public bool Contains(T item) => database.SetContains(redisKey, item.ToRedisValue()); void ICollection<T>.CopyTo(T[] array, int index) { if (array is null) { throw new ArgumentNullException(nameof(array)); } if (index < 0 || index > array.Length) { throw new ArgumentOutOfRangeException(nameof(index)); } if (array.Length - index < this.Count) { throw new ArgumentException("Destination array is not long enough to copy all the items in the collection. Check array index and length."); } foreach (var item in this) { array[index++] = item; } } public int Count { get { long count = database.SetLength(redisKey); if (count > int.MaxValue) { throw new OverflowException("Count exceeds maximum value of integer."); } return (int)count; } } bool ICollection<T>.IsReadOnly => false; public bool Remove(T item) => database.SetRemove(redisKey, item.ToRedisValue()); public IEnumerator<T> GetEnumerator() => database.SetScan(redisKey) .Select(redisValue => redisValue.To<T>()) .GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); private void SetCombineAndStore(SetOperation operation, IEnumerable<T> other) { var redisTempSet = new RedisSet<T>(database, Guid.NewGuid().ToString()); try { redisTempSet.Add(other); SetCombineAndStore(operation, redisTempSet); } finally { redisTempSet.Clear(); } } private void SetCombineAndStore(SetOperation operation, RedisSet<T> other) { SetCombineAndStore(operation, this, this, other); } private void SetCombineAndStore(SetOperation operation, RedisSet<T> destination, RedisSet<T> first, RedisSet<T> second) { database.SetCombineAndStore(operation, destination.redisKey, first.redisKey, second.redisKey); } private RedisValue[] SetCombine(SetOperation operation, RedisSet<T> other) => database.SetCombine(operation, redisKey, other.redisKey); } }
28.244898
155
0.514761
[ "MIT" ]
ArinGhazarian/StackExchange.Redis.DataTypes
src/StackExchange.Redis.DataTypes/Collections/RedisSet.cs
9,690
C#
using System; namespace ChiantiaEsercizio1 { class Program { static void Main(string[] args) { string parola = " "; int cc = 0; int d1 = 0; int sommac = 0; int somma1 = 0; int mediac = 0; int medIA1 = 0; while (parola != "fine") ; { Console.WriteLine("inserisci una parola"); parola = Console.ReadLine(); int lungh = parola.Length; if (lungh < 0) ; { cc++ sommac++; } else if (lungh <= 0) { c1++ } } } }
22.470588
58
0.337696
[ "MIT" ]
ItisMajo-2021-3DINFO-Informatica/esercizistrighe-repo-MarcoChiantia
ChiantiaEsercizio1/ChiantiaEsercizio1/Program.cs
766
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; //[InitializeOnLoad] public class Startup : EditorWindow { string myString = "Welcome to Card Engine Tool v0.1"; bool groupEnabled; bool myBool = true; float myFloat = 1.23f; static Startup() { EditorApplication.update += StartUp; } static void StartUp() { EditorApplication.update -= StartUp; ShowWindow(); } // Add menu item named "Game Options" to the Window menu [MenuItem("Window/Start Up")] public static void ShowWindow() { // Show existing window instance. If one doesn't exist, create one. EditorWindow.GetWindow(typeof(Startup)); } private void OnGUI() { GUILayout.Label("Base Settings", EditorStyles.boldLabel); myString = EditorGUILayout.TextField("Text Field", myString); groupEnabled = EditorGUILayout.BeginToggleGroup("Optional Settings", groupEnabled); myBool = EditorGUILayout.Toggle("Toggle", myBool); myFloat = EditorGUILayout.Slider("Slider", myFloat, -3, 3); EditorGUILayout.EndToggleGroup(); } static void Update() { Debug.Log("Updating"); } }
25.16
91
0.647854
[ "MIT" ]
AnneChoV/CardEngineTool
Card Engine Tool/Assets/Editor/Startup.cs
1,260
C#
using MediatR; using Microsoft.EntityFrameworkCore; using ModelWrapper.Extensions.FullSearch; using Store.Core.Domain.Interfaces.Infrastructures.Data.Contexts; using System.Threading; using System.Threading.Tasks; using Store.Core.Domain.Resources; using Microsoft.Extensions.Localization; namespace Store.Core.Application.Default.Samples.Queries.GetSamplesByFilter { public class GetSamplesByFilterQueryHandler : IRequestHandler<GetSamplesByFilterQuery, GetSamplesByFilterQueryResponse> { private IStringLocalizer StringLocalizer { get; set; } private IDefaultDbContext Context { get; set; } public GetSamplesByFilterQueryHandler( IStringLocalizer<Messages> stringLocalizer, IDefaultDbContext context) { StringLocalizer = stringLocalizer; Context = context; } public async Task<GetSamplesByFilterQueryResponse> Handle(GetSamplesByFilterQuery request, CancellationToken cancellationToken) { long resultCount = 0; var data = await Context.Samples .FullSearch(request, out resultCount) .AsNoTracking() .ToListAsync(cancellationToken); return new GetSamplesByFilterQueryResponse(request, data, StringLocalizer["Successful operation!"], resultCount); } } }
38.583333
135
0.702664
[ "MIT" ]
isilveira/ModelWrapper
samples/Store/Store.Core.Application/Default/Samples/Queries/GetSamplesByFilter/GetSamplesByFilterQueryHandler.cs
1,389
C#
using System; using System.IO; using System.Threading; using System.Threading.Tasks; #pragma warning disable CS0675 // Bitwise-or operator used on a sign-extended operand namespace BinaryEncoding { public partial class Binary { public static class Varint { public const int MaxVarintLen16 = 3; public const int MaxVarintLen32 = 5; public const int MaxVarintLen64 = 10; public static int GetByteCount(short value) => GetByteCount((ulong)value); public static int GetByteCount(int value) => GetByteCount((ulong)value); public static int GetByteCount(long value) => GetByteCount((ulong)value); public static int GetByteCount(ushort value) => GetByteCount((ulong)value); public static int GetByteCount(uint value) => GetByteCount((ulong)value); public static int GetByteCount(ulong value) { int i; for (i = 0; i < 9 && value >= 0x80; i++, value >>= 7) { } return i + 1; } public static byte[] GetBytes(short value) => GetBytes((ulong) value); public static byte[] GetBytes(int value) => GetBytes((ulong) value); public static byte[] GetBytes(long value) => GetBytes((ulong) value); public static byte[] GetBytes(ushort value) => GetBytes((ulong) value); public static byte[] GetBytes(uint value) => GetBytes((ulong) value); public static byte[] GetBytes(ulong value) { var buffer = new byte[GetByteCount(value)]; Write(buffer, 0, value); return buffer; } public static int Write(Span<byte> buffer, ushort value) => Write(buffer, (ulong)value); public static int Write(byte[] buffer, int offset, ushort value) => Write(buffer.AsSpan(offset), (ulong)value); public static int Write(Span<byte> buffer, short value) => Write(buffer, (long)value); public static int Write(byte[] buffer, int offset, short value) => Write(buffer.AsSpan(offset), (long)value); public static int Write(byte[] buffer, int offset, uint value) => Write(buffer.AsSpan(offset), (ulong)value); public static int Write(Span<byte> buffer, uint value) => Write(buffer, (ulong)value); public static int Write(byte[] buffer, int offset, int value) => Write(buffer.AsSpan(offset), (long)value); public static int Write(Span<byte> buffer, int value) => Write(buffer, (long)value); public static int Write(byte[] buffer, int offset, ulong value) => Write(buffer.AsSpan(offset), value); public static int Write(Span<byte> buffer, ulong value) { int i = 0; while (value >= 0x80) { buffer[i] = (byte)(value | 0x80); value >>= 7; i++; } buffer[i] = (byte)value; return i + 1; } public static int Write(byte[] buffer, int offset, long value) => Write(buffer.AsSpan(offset), value); public static int Write(Span<byte> buffer, long value) { var ux = (ulong)value << 1; if (value < 0) ux ^= ux; return Write(buffer, ux); } public static int Write(Stream stream, ushort value) => Write(stream, (ulong) value); public static int Write(Stream stream, uint value) => Write(stream, (ulong)value); public static int Write(Stream stream, ulong value) { int i = 0; while (value >= 0x80) { stream.WriteByte((byte)(value | 0x80)); value >>= 7; i++; } stream.WriteByte((byte) value); return i + 1; } public static Task<int> WriteAsync(Stream stream, ushort value, CancellationToken cancellationToken = default(CancellationToken)) => WriteAsync(stream, (ulong)value, cancellationToken); public static Task<int> WriteAsync(Stream stream, uint value, CancellationToken cancellationToken = default(CancellationToken)) => WriteAsync(stream, (ulong)value, cancellationToken); public static async Task<int> WriteAsync(Stream stream, ulong value, CancellationToken cancellationToken = default(CancellationToken)) { int i = 0; byte[] buffer = new byte[1]; while (value >= 0x80) { buffer[0] = (byte)(value | 0x80); await stream.WriteAsync(buffer, 0, 1, cancellationToken); value >>= 7; i++; } buffer[0] = (byte)value; await stream.WriteAsync(buffer, 0, 1, cancellationToken); return i + 1; } public static int Write(Stream stream, short value) => Write(stream, (long)value); public static int Write(Stream stream, int value) => Write(stream, (long)value); public static int Write(Stream stream, long value) { var ux = (ulong)value << 1; if (value < 0) ux ^= ux; return Write(stream, ux); } public static Task<int> WriteAsync(Stream stream, short value, CancellationToken cancellationToken = default(CancellationToken)) => WriteAsync(stream, (long)value, cancellationToken); public static Task<int> WriteAsync(Stream stream, int value, CancellationToken cancellationToken = default(CancellationToken)) => WriteAsync(stream, (long)value, cancellationToken); public static Task<int> WriteAsync(Stream stream, long value, CancellationToken cancellationToken = default(CancellationToken)) { var ux = (ulong)value << 1; if (value < 0) ux ^= ux; return WriteAsync(stream, ux, cancellationToken); } public static int Read(byte[] buffer, int offset, out ushort value) => Read(buffer.AsSpan(offset), out value); public static int Read(ReadOnlySpan<byte> buffer, out ushort value) { var n = Read(buffer, out ulong l); value = (ushort)l; return n; } public static int Read(byte[] buffer, int offset, out short value) => Read(buffer.AsSpan(offset), out value); public static int Read(ReadOnlySpan<byte> buffer, out short value) { var n = Read(buffer, out long l); value = (short)l; return n; } public static int Read(byte[] buffer, int offset, out uint value) => Read(buffer.AsSpan(offset), out value); public static int Read(ReadOnlySpan<byte> buffer, out uint value) { var n = Read(buffer, out ulong l); value = (uint)l; return n; } public static int Read(byte[] buffer, int offset, out int value) => Read(buffer.AsSpan(offset), out value); public static int Read(ReadOnlySpan<byte> buffer, out int value) { var n = Read(buffer, out long l); value = (int)l; return n; } public static int Read(byte[] buffer, int offset, out ulong value) => Read(buffer.AsSpan(offset), out value); public static int Read(ReadOnlySpan<byte> buffer, out ulong value) { value = 0; int s = 0; for (var i = 0; i < buffer.Length; i++) { if (buffer[i] < 0x80) { if (i > 9 || i == 9 && buffer[i] > 1) { value = 0; return -(i + 1); // overflow } value |= (ulong)(buffer[i]) << s; return i + 1; } value |= (ulong)(buffer[i] & 0x7f) << s; s += 7; } value = 0; return 0; } public static int Read(byte[] buffer, int offset, out long value) => Read(buffer.AsSpan(offset), out value); public static int Read(ReadOnlySpan<byte> buffer, out long value) { int n = Read(buffer, out ulong ux); value = (long)(ux >> 1); if ((ux & 1) != 0) value ^= value; return n; } public static int Read(Stream stream, out ushort value) { var n = Read(stream, out ulong l); value = (ushort)l; return n; } public static int Read(Stream stream, out uint value) { var n = Read(stream, out ulong l); value = (uint)l; return n; } public static int Read(Stream stream, out ulong value) { value = 0; int s = 0; for (var i = 0; ; i++) { var r = stream.ReadByte(); if (r == -1) throw new EndOfStreamException(); var b = (byte)r; if (b < 0x80) { if (i > 9 || i == 9 && b > 1) { return i + 1; } value |= (ulong)(b << s); return i + 1; } value |= (ulong)(b & 0x7f) << s; s += 7; } } public static int Read(Stream stream, out short value) { var n = Read(stream, out ulong l); value = (short)l; return n; } public static int Read(Stream stream, out int value) { var n = Read(stream, out ulong l); value = (int)l; return n; } public static int Read(Stream stream, out long value) { var n = Read(stream, out ulong ux); value = (long)(ux >> 1); if ((ux & 1) != 0) value ^= value; return n; } public static async Task<ulong> ReadAsync(Stream stream, CancellationToken cancellationToken = default(CancellationToken)) { ulong value = 0; int s = 0; byte[] buffer = new byte[1]; for (var i = 0; ; i++) { cancellationToken.ThrowIfCancellationRequested(); if (await stream.ReadAsync(buffer, 0, 1, cancellationToken) < 1) throw new EndOfStreamException(); if (buffer[0] < 0x80) { if (i > 9 || i == 9 && buffer[0] > 1) { return value; } value |= (ulong)(buffer[0] << s); return value; } value |= (ulong)(buffer[0] & 0x7f) << s; s += 7; } } public static Task<short> ReadInt16Async(Stream stream, CancellationToken cancellationToken = default(CancellationToken)) => ReadAsync(stream, cancellationToken) .ContinueWith(t => (short)t.Result, TaskContinuationOptions.NotOnCanceled | TaskContinuationOptions.NotOnFaulted); public static Task<int> ReadInt32Async(Stream stream, CancellationToken cancellationToken = default(CancellationToken)) => ReadAsync(stream, cancellationToken) .ContinueWith(t => (int)t.Result, TaskContinuationOptions.NotOnCanceled | TaskContinuationOptions.NotOnFaulted); public static Task<long> ReadInt64Async(Stream stream, CancellationToken cancellationToken = default(CancellationToken)) => ReadAsync(stream, cancellationToken) .ContinueWith(t => { var value = (long)(t.Result >> 1); if ((t.Result & 1) != 0) value ^= value; return value; }, TaskContinuationOptions.NotOnCanceled | TaskContinuationOptions.NotOnFaulted); public static Task<ushort> ReadUInt16Async(Stream stream, CancellationToken cancellationToken = default(CancellationToken)) => ReadAsync(stream, cancellationToken) .ContinueWith(t => (ushort)t.Result, TaskContinuationOptions.NotOnCanceled | TaskContinuationOptions.NotOnFaulted); public static Task<uint> ReadUInt32Async(Stream stream, CancellationToken cancellationToken = default(CancellationToken)) => ReadAsync(stream, cancellationToken) .ContinueWith(t => (uint)t.Result, TaskContinuationOptions.NotOnCanceled | TaskContinuationOptions.NotOnFaulted); public static Task<ulong> ReadUInt64Async(Stream stream, CancellationToken cancellationToken = default(CancellationToken)) => ReadAsync(stream, cancellationToken); } } }
43.068966
197
0.50797
[ "MIT" ]
tabrath/BinaryEncoding
src/BinaryEncoding/Binary.Varint.cs
13,741
C#